Skip to content

Commit 9d3a95a

Browse files
account for error return in test case when building without pkcs7 streaming
1 parent 0e2749e commit 9d3a95a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/api.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25671,9 +25671,17 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
2567125671
tmpBytePtr = pkcs7->singleCert;
2567225672
pkcs7->singleCert = NULL;
2567325673
}
25674+
#if defined(NO_PKCS7_STREAM)
25675+
/* when none streaming mode is used and PKCS7 is in bad state buffer error
25676+
* is returned from kari parse which gets set to bad func arg */
25677+
ExpectIntEQ(wc_PKCS7_DecodeEnvelopedData(pkcs7, output,
25678+
(word32)sizeof(output), decoded, (word32)sizeof(decoded)),
25679+
BAD_FUNC_ARG);
25680+
#else
2567425681
ExpectIntEQ(wc_PKCS7_DecodeEnvelopedData(pkcs7, output,
2567525682
(word32)sizeof(output), decoded, (word32)sizeof(decoded)),
2567625683
ASN_PARSE_E);
25684+
#endif
2567725685
if (pkcs7 != NULL) {
2567825686
pkcs7->singleCert = tmpBytePtr;
2567925687
}

0 commit comments

Comments
 (0)