mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +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 length;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = CheckBitString(cert->source, &cert->srcIdx, &length, cert->maxIdx, 1,
|
ret = CheckBitString(cert->source, &cert->srcIdx, &length, cert->maxIdx, 1,
|
||||||
NULL);
|
NULL);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@ -6731,6 +6732,9 @@ static int GetSignature(DecodedCert* cert)
|
|||||||
cert->signature = &cert->source[cert->srcIdx];
|
cert->signature = &cert->source[cert->srcIdx];
|
||||||
cert->srcIdx += cert->sigLength;
|
cert->srcIdx += cert->sigLength;
|
||||||
|
|
||||||
|
if (cert->srcIdx != cert->maxIdx)
|
||||||
|
return ASN_PARSE_E;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user