From 9d3a95a2876bf3380b9543268cc19584f8874d55 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Sun, 9 Jul 2023 12:42:29 -0700 Subject: [PATCH] account for error return in test case when building without pkcs7 streaming --- tests/api.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/api.c b/tests/api.c index 96f0f71745..8f2d284e74 100644 --- a/tests/api.c +++ b/tests/api.c @@ -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; }