account for no AES build and add err trace macro

This commit is contained in:
JacobBarthelmeh
2025-09-30 09:48:16 -06:00
parent 328f505702
commit 12cfca4060
2 changed files with 10 additions and 1 deletions

View File

@@ -2182,7 +2182,11 @@ int test_wc_PKCS7_DecodeEnvelopedData_multiple_recipients(void)
ret = wc_PKCS7_DecodeEnvelopedData(pkcs7, testDerBuffer,
(word32)testDerBufferSz, decodedData, sizeof(decodedData));
#if defined(NO_AES) || defined(NO_AES_256)
ExpectIntEQ(ret, ALGO_ID_E);
#else
ExpectIntGT(ret, 0);
#endif
wc_PKCS7_Free(pkcs7);
}
@@ -2197,7 +2201,11 @@ int test_wc_PKCS7_DecodeEnvelopedData_multiple_recipients(void)
ret = wc_PKCS7_DecodeEnvelopedData(pkcs7, testDerBuffer,
(word32)testDerBufferSz, decodedData, sizeof(decodedData));
#if defined(NO_AES) || defined(NO_AES_256)
ExpectIntEQ(ret, ALGO_ID_E);
#else
ExpectIntGT(ret, 0);
#endif
wc_PKCS7_Free(pkcs7);
}

View File

@@ -11975,7 +11975,8 @@ static int wc_PKCS7_DecryptRecipientInfos(wc_PKCS7* pkcs7, byte* in,
decryptedKey, decryptedKeySz,
recipFound);
if (ret != 0) {
if (ret != WC_PKCS7_WANT_READ_E && *recipFound == 0) {
if (ret != WC_NO_ERR_TRACE(WC_PKCS7_WANT_READ_E) &&
*recipFound == 0) {
continue; /* try next recipient */
}
else {