Merge pull request #5076 from JacobBarthelmeh/fuzzing
fix for sanity check on PKCS7 indef read
This commit is contained in:
commit
7e803f346d
@ -4610,10 +4610,15 @@ static int PKCS7_VerifySignedData(PKCS7* pkcs7, const byte* hashBuf,
|
|||||||
ret = ASN_PARSE_E;
|
ret = ASN_PARSE_E;
|
||||||
}
|
}
|
||||||
/* if indef, skip EOF */
|
/* if indef, skip EOF */
|
||||||
if (isIndef && pkiMsg[idx] == ASN_EOC && pkiMsg[idx+1] == 0) {
|
if (isIndef) {
|
||||||
|
if (idx + 1 >= pkiMsgSz) {
|
||||||
|
ret = ASN_PARSE_E;
|
||||||
|
}
|
||||||
|
else if (pkiMsg[idx] == ASN_EOC && pkiMsg[idx+1] == 0) {
|
||||||
idx += 2; /* skip EOF + zero byte */
|
idx += 2; /* skip EOF + zero byte */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user