[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>
This commit is contained in:
parent
2cd24473b8
commit
5c66395939
@ -902,6 +902,7 @@ int x509_parse ( struct x509_certificate *cert, const void *data, size_t len ) {
|
|||||||
memset ( cert, 0, sizeof ( *cert ) );
|
memset ( cert, 0, sizeof ( *cert ) );
|
||||||
cert->raw.data = data;
|
cert->raw.data = data;
|
||||||
cert->raw.len = len;
|
cert->raw.len = len;
|
||||||
|
asn1_shrink_any ( &cert->raw );
|
||||||
|
|
||||||
/* Enter certificate */
|
/* Enter certificate */
|
||||||
memcpy ( &cursor, &cert->raw, sizeof ( cursor ) );
|
memcpy ( &cursor, &cert->raw, sizeof ( cursor ) );
|
||||||
|
Reference in New Issue
Block a user