Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
mcb30 committed Mar 22, 2012
1 parent 2cd2447 commit 5c66395
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/crypto/x509.c
Expand Up @@ -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 ) );
Expand Down

0 comments on commit 5c66395

Please sign in to comment.