mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Merge pull request #3578 from SparkiDev/x509_len
ASN X509: Don't allow any more data after signature
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user