@@ -27019,8 +27019,8 @@ static int test_wc_PKCS7_EncodeSignedData(void)
2701927019 pkcs7->rng = &rng;
2702027020 }
2702127021 ExpectIntEQ(wc_PKCS7_GetStreamMode(pkcs7), 0);
27022- ExpectIntEQ(wc_PKCS7_SetStreamMode(pkcs7, 1), 0);
27023- ExpectIntEQ(wc_PKCS7_SetStreamMode(NULL, 1), BAD_FUNC_ARG);
27022+ ExpectIntEQ(wc_PKCS7_SetStreamMode(pkcs7, 1, NULL, NULL ), 0);
27023+ ExpectIntEQ(wc_PKCS7_SetStreamMode(NULL, 1, NULL, NULL ), BAD_FUNC_ARG);
2702427024 ExpectIntEQ(wc_PKCS7_GetStreamMode(pkcs7), 1);
2702527025
2702627026 ExpectIntGT(signedSz = wc_PKCS7_EncodeSignedData(pkcs7, output,
@@ -28287,16 +28287,46 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
2828728287 pkcs7->privateKey = (testVectors + i)->privateKey;
2828828288 pkcs7->privateKeySz = (testVectors + i)->privateKeySz;
2828928289 }
28290- ExpectIntEQ(wc_PKCS7_SetStreamMode(pkcs7, 1), 0);
28290+ ExpectIntEQ(wc_PKCS7_SetStreamMode(pkcs7, 1, NULL, NULL ), 0);
2829128291
28292- ExpectIntGE( encodedSz = wc_PKCS7_EncodeEnvelopedData(pkcs7, output,
28293- (word32)sizeof(output)), 0) ;
28292+ encodedSz = wc_PKCS7_EncodeEnvelopedData(pkcs7, output,
28293+ (word32)sizeof(output));
2829428294
28295- decodedSz = wc_PKCS7_DecodeEnvelopedData(pkcs7, output,
28296- (word32)encodedSz, decoded, (word32)sizeof(decoded));
28297- ExpectIntGE(decodedSz, 0);
28298- /* Verify the size of each buffer. */
28299- ExpectIntEQ((word32)sizeof(input)/sizeof(char), decodedSz);
28295+ switch ((testVectors + i)->encryptOID) {
28296+ #ifndef NO_DES3
28297+ case DES3b:
28298+ case DESb:
28299+ ExpectIntEQ(encodedSz, BAD_FUNC_ARG);
28300+ break;
28301+ #endif
28302+ #ifdef HAVE_AESCCM
28303+ #ifdef WOLFSSL_AES_128
28304+ case AES128CCMb:
28305+ ExpectIntEQ(encodedSz, BAD_FUNC_ARG);
28306+ break;
28307+ #endif
28308+ #ifdef WOLFSSL_AES_192
28309+ case AES192CCMb:
28310+ ExpectIntEQ(encodedSz, BAD_FUNC_ARG);
28311+ break;
28312+ #endif
28313+ #ifdef WOLFSSL_AES_256
28314+ case AES256CCMb:
28315+ ExpectIntEQ(encodedSz, BAD_FUNC_ARG);
28316+ break;
28317+ #endif
28318+ #endif
28319+ default:
28320+ ExpectIntGE(encodedSz, 0);
28321+ }
28322+
28323+ if (encodedSz > 0) {
28324+ decodedSz = wc_PKCS7_DecodeEnvelopedData(pkcs7, output,
28325+ (word32)encodedSz, decoded, (word32)sizeof(decoded));
28326+ ExpectIntGE(decodedSz, 0);
28327+ /* Verify the size of each buffer. */
28328+ ExpectIntEQ((word32)sizeof(input)/sizeof(char), decodedSz);
28329+ }
2830028330 wc_PKCS7_Free(pkcs7);
2830128331 pkcs7 = NULL;
2830228332 ExpectNotNull(pkcs7 = wc_PKCS7_New(HEAP_HINT, testDevId));
0 commit comments