Browse Source

[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>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
5c66395939
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      src/crypto/x509.c

+ 1
- 0
src/crypto/x509.c View File

@@ -902,6 +902,7 @@ int x509_parse ( struct x509_certificate *cert, const void *data, size_t len ) {
902 902
 	memset ( cert, 0, sizeof ( *cert ) );
903 903
 	cert->raw.data = data;
904 904
 	cert->raw.len = len;
905
+	asn1_shrink_any ( &cert->raw );
905 906
 
906 907
 	/* Enter certificate */
907 908
 	memcpy ( &cursor, &cert->raw, sizeof ( cursor ) );

Loading…
Cancel
Save