X.509: Fix v3 parsing with issuerUniqueID/subjectUniqueID present

The current position pointer was not updated when issuerUniqueID or
subjectUniqueID were present. This could result in extensions being
ignored.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-05-10 12:36:19 +03:00
parent 2e3f286253
commit 144f10446a

View file

@ -1348,7 +1348,8 @@ static int x509_parse_tbs_certificate(const u8 *buf, size_t len,
wpa_printf(MSG_DEBUG, "X509: issuerUniqueID");
/* TODO: parse UniqueIdentifier ::= BIT STRING */
if (hdr.payload + hdr.length == end)
pos = hdr.payload + hdr.length;
if (pos == end)
return 0;
if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
@ -1366,7 +1367,8 @@ static int x509_parse_tbs_certificate(const u8 *buf, size_t len,
wpa_printf(MSG_DEBUG, "X509: subjectUniqueID");
/* TODO: parse UniqueIdentifier ::= BIT STRING */
if (hdr.payload + hdr.length == end)
pos = hdr.payload + hdr.length;
if (pos == end)
return 0;
if (asn1_get_next(pos, end - pos, &hdr) < 0 ||