aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/x509.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2012-03-22 11:01:13 +0000
committerMichael Brown <mcb30@ipxe.org>2012-03-22 11:41:21 +0000
commit5c6639593969e6b7b6b4796cbb833c002819857c (patch)
tree36c1b5d29534e26d5f3e2465bc6ec9e27c2fdd38 /src/crypto/x509.c
parent2cd24473b8e41b54f1dafc16c7b5adee8c224446 (diff)
downloadipxe-5c6639593969e6b7b6b4796cbb833c002819857c.tar.gz
[crypto] Shrink raw certificate data to fit certificate
The certificate may be part of an ASN.1-encoded certificate chain, and so may not be the only object contained within the ASN.1 cursor. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/crypto/x509.c')
-rw-r--r--src/crypto/x509.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/crypto/x509.c b/src/crypto/x509.c
index eb4855223..145c77ee1 100644
--- a/src/crypto/x509.c
+++ b/src/crypto/x509.c
@@ -902,6 +902,7 @@ int x509_parse ( struct x509_certificate *cert, const void *data, size_t len ) {
memset ( cert, 0, sizeof ( *cert ) );
cert->raw.data = data;
cert->raw.len = len;
+ asn1_shrink_any ( &cert->raw );
/* Enter certificate */
memcpy ( &cursor, &cert->raw, sizeof ( cursor ) );