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
 	memset ( cert, 0, sizeof ( *cert ) );
902
 	memset ( cert, 0, sizeof ( *cert ) );
903
 	cert->raw.data = data;
903
 	cert->raw.data = data;
904
 	cert->raw.len = len;
904
 	cert->raw.len = len;
905
+	asn1_shrink_any ( &cert->raw );
905
 
906
 
906
 	/* Enter certificate */
907
 	/* Enter certificate */
907
 	memcpy ( &cursor, &cert->raw, sizeof ( cursor ) );
908
 	memcpy ( &cursor, &cert->raw, sizeof ( cursor ) );

Loading…
Cancel
Save