Skip to content

Commit

Permalink
account for error return in test case when building without pkcs7 str…
Browse files Browse the repository at this point in the history
…eaming
  • Loading branch information
JacobBarthelmeh committed Jul 9, 2023
1 parent 0e2749e commit 9d3a95a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -25671,9 +25671,17 @@ static int test_wc_PKCS7_EncodeDecodeEnvelopedData(void)
tmpBytePtr = pkcs7->singleCert;
pkcs7->singleCert = NULL;
}
#if defined(NO_PKCS7_STREAM)
/* when none streaming mode is used and PKCS7 is in bad state buffer error
* is returned from kari parse which gets set to bad func arg */
ExpectIntEQ(wc_PKCS7_DecodeEnvelopedData(pkcs7, output,
(word32)sizeof(output), decoded, (word32)sizeof(decoded)),
BAD_FUNC_ARG);
#else
ExpectIntEQ(wc_PKCS7_DecodeEnvelopedData(pkcs7, output,
(word32)sizeof(output), decoded, (word32)sizeof(decoded)),
ASN_PARSE_E);
#endif
if (pkcs7 != NULL) {
pkcs7->singleCert = tmpBytePtr;
}
Expand Down

0 comments on commit 9d3a95a

Please sign in to comment.