From: Michael Brown Date: Thu, 22 Mar 2012 11:01:13 +0000 (+0000) Subject: [crypto] Shrink raw certificate data to fit certificate X-Git-Tag: v1.20.1~1902 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c6639593969e6b7b6b4796cbb833c002819857c;p=thirdparty%2Fipxe.git [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 --- 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 ) );