From 12cfca4060b52ce0f3cd49f1a0213102c6f30c7c Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 30 Sep 2025 09:48:16 -0600 Subject: [PATCH] account for no AES build and add err trace macro --- tests/api/test_pkcs7.c | 8 ++++++++ wolfcrypt/src/pkcs7.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/api/test_pkcs7.c b/tests/api/test_pkcs7.c index 332bc3b03..ec4f7f333 100644 --- a/tests/api/test_pkcs7.c +++ b/tests/api/test_pkcs7.c @@ -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); } diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 25ed7295f..cce0c6b08 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -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 {