ASN X509: Don't allow any more data after signature

This commit is contained in:
Sean Parkinson
2020-12-18 10:02:38 +10:00
parent b11b08bb10
commit a4f8a21b9b

View File

@@ -6722,6 +6722,7 @@ static int GetSignature(DecodedCert* cert)
{
int length;
int ret;
ret = CheckBitString(cert->source, &cert->srcIdx, &length, cert->maxIdx, 1,
NULL);
if (ret != 0)
@@ -6731,6 +6732,9 @@ static int GetSignature(DecodedCert* cert)
cert->signature = &cert->source[cert->srcIdx];
cert->srcIdx += cert->sigLength;
if (cert->srcIdx != cert->maxIdx)
return ASN_PARSE_E;
return 0;
}