[tls] Accept certificates without a version number

The version field of an X.509 certificate appears to be optional.

Reported-by: Sebastiano Manusia <Sebastiano.Manusia@chuv.ch>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2011-08-12 23:51:44 +01:00
parent 174df77359
commit 1691cf50bc
3 changed files with 70 additions and 37 deletions

View File

@@ -55,7 +55,7 @@ static int x509_public_key ( const struct asn1_cursor *certificate,
memcpy ( &cursor, certificate, sizeof ( cursor ) );
rc = ( asn1_enter ( &cursor, ASN1_SEQUENCE ), /* Certificate */
asn1_enter ( &cursor, ASN1_SEQUENCE ), /* tbsCertificate */
asn1_skip ( &cursor, ASN1_EXPLICIT_TAG ), /* version */
asn1_skip_if_exists ( &cursor, ASN1_EXPLICIT_TAG ), /* version */
asn1_skip ( &cursor, ASN1_INTEGER ), /* serialNumber */
asn1_skip ( &cursor, ASN1_SEQUENCE ), /* signature */
asn1_skip ( &cursor, ASN1_SEQUENCE ), /* issuer */