Merge pull request #2899 from embhorn/zd9564

Adding check for invalid SAN ext with no entries
pull/2903/head
JacobBarthelmeh 2020-04-13 15:31:06 -06:00 committed by GitHub
commit f309173518
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -7635,6 +7635,13 @@ static int DecodeAltNames(const byte* input, int sz, DecodedCert* cert)
return ASN_PARSE_E;
}
if (length == 0) {
/* RFC 5280 4.2.1.6. Subject Alternative Name
If the subjectAltName extension is present, the sequence MUST
contain at least one entry. */
return ASN_PARSE_E;
}
cert->weOwnAltNames = 1;
while (length > 0) {