Merge pull request #3848 from JacobBarthelmeh/Testing

sanity check on size before compare
This commit is contained in:
Chris Conlon
2021-03-10 15:18:44 -07:00
committed by GitHub

View File

@ -8423,6 +8423,9 @@ static int wc_PKCS7_DecryptKtri(PKCS7* pkcs7, byte* in, word32 inSz,
if (GetLength(pkiMsg, idx, &length, pkiMsgSz) < 0)
return ASN_PARSE_E;
if (KEYID_SIZE > pkiMsgSz - (*idx))
return BUFFER_E;
/* if we found correct recipient, SKID will match */
if (XMEMCMP(pkiMsg + (*idx), pkcs7->issuerSubjKeyId,
KEYID_SIZE) == 0) {