forked from wolfSSL/wolfssl
Maintenance: ASN.1
1. Add an additional check in GetCertHeader() to see that sigIndex is bounded by maxIdx.
This commit is contained in:
@ -4553,7 +4553,10 @@ static int GetCertHeader(DecodedCert* cert)
|
|||||||
|
|
||||||
if (GetSequence(cert->source, &cert->srcIdx, &len, cert->maxIdx) < 0)
|
if (GetSequence(cert->source, &cert->srcIdx, &len, cert->maxIdx) < 0)
|
||||||
return ASN_PARSE_E;
|
return ASN_PARSE_E;
|
||||||
|
|
||||||
cert->sigIndex = len + cert->srcIdx;
|
cert->sigIndex = len + cert->srcIdx;
|
||||||
|
if (cert->sigIndex > cert->maxIdx)
|
||||||
|
return ASN_PARSE_E;
|
||||||
|
|
||||||
if (GetExplicitVersion(cert->source, &cert->srcIdx, &cert->version,
|
if (GetExplicitVersion(cert->source, &cert->srcIdx, &cert->version,
|
||||||
cert->sigIndex) < 0)
|
cert->sigIndex) < 0)
|
||||||
|
Reference in New Issue
Block a user