Skip to content

Commit 12cfca4

Browse files
account for no AES build and add err trace macro
1 parent 328f505 commit 12cfca4

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

tests/api/test_pkcs7.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,7 +2182,11 @@ int test_wc_PKCS7_DecodeEnvelopedData_multiple_recipients(void)
21822182

21832183
ret = wc_PKCS7_DecodeEnvelopedData(pkcs7, testDerBuffer,
21842184
(word32)testDerBufferSz, decodedData, sizeof(decodedData));
2185+
#if defined(NO_AES) || defined(NO_AES_256)
2186+
ExpectIntEQ(ret, ALGO_ID_E);
2187+
#else
21852188
ExpectIntGT(ret, 0);
2189+
#endif
21862190
wc_PKCS7_Free(pkcs7);
21872191
}
21882192

@@ -2197,7 +2201,11 @@ int test_wc_PKCS7_DecodeEnvelopedData_multiple_recipients(void)
21972201

21982202
ret = wc_PKCS7_DecodeEnvelopedData(pkcs7, testDerBuffer,
21992203
(word32)testDerBufferSz, decodedData, sizeof(decodedData));
2204+
#if defined(NO_AES) || defined(NO_AES_256)
2205+
ExpectIntEQ(ret, ALGO_ID_E);
2206+
#else
22002207
ExpectIntGT(ret, 0);
2208+
#endif
22012209
wc_PKCS7_Free(pkcs7);
22022210
}
22032211

wolfcrypt/src/pkcs7.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11975,7 +11975,8 @@ static int wc_PKCS7_DecryptRecipientInfos(wc_PKCS7* pkcs7, byte* in,
1197511975
decryptedKey, decryptedKeySz,
1197611976
recipFound);
1197711977
if (ret != 0) {
11978-
if (ret != WC_PKCS7_WANT_READ_E && *recipFound == 0) {
11978+
if (ret != WC_NO_ERR_TRACE(WC_PKCS7_WANT_READ_E) &&
11979+
*recipFound == 0) {
1197911980
continue; /* try next recipient */
1198011981
}
1198111982
else {

0 commit comments

Comments
 (0)