]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[crypto] Add x509_truncate() to truncate a certificate chain
authorMichael Brown <mcb30@ipxe.org>
Tue, 13 Feb 2024 16:27:31 +0000 (16:27 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 14 Feb 2024 16:40:05 +0000 (16:40 +0000)
commit3e721e0c0836588b64deb6e1c1befd08f0f02e71
tree417c4347622771d4fb5183cf292a69e621826519
parente10dfe5dc7a5985333c85d6b196196b5cce9303a
[crypto] Add x509_truncate() to truncate a certificate chain

Downloading a cross-signed certificate chain to partially replace
(rather than simply extend) an existing chain will require the ability
to discard all certificates after a specified link in the chain.

Extract the relevant logic from x509_free_chain() and expose it
separately as x509_truncate().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/crypto/x509.c
src/include/ipxe/x509.h
src/tests/x509_test.c