aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-11-03 14:03:07 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2024-11-03 14:03:07 -0500
commitdcc65c2cacf2261eb705ff8ac7d1a0263ced79f4 (patch)
treec898c02f7e5b081c64932ce1ab5ebde9b27bdace /tests
parent44044eb0fb28b774773e3284fd147c91d59d64e3 (diff)
parente0d30c1d8f407bfef05a9cc36398bb0894a96c39 (diff)
merge develop
Diffstat (limited to 'tests')
-rw-r--r--tests/test.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/test.c b/tests/test.c
index 20a0e5d..a1f5abe 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -289,10 +289,13 @@ static int TestPublicApiArgumentValidation()
NCPublicKey pubKey;
uint8_t hmacKeyOut[NC_HMAC_KEY_SIZE];
uint8_t nonce[NC_NIP44_IV_SIZE];
-
+
NCEncryptionArgs cryptoData;
- PRINTL("TEST: Public API argument validation tests")
+ PRINTL("TEST: Public API argument validation tests");
+
+ /* Zero fill the structure to inialize */
+ ZERO_FILL(&cryptoData, sizeof(cryptoData));
{
TEST(NCEncryptionGetIvSize(NC_ENC_VERSION_NIP44), sizeof(nonce));
@@ -507,8 +510,16 @@ static int TestPublicApiArgumentValidation()
macArgs.payloadSize = 0;
TEST(NCVerifyMac(ctx, &secKey, &pubKey, &macArgs), ARG_RANGE_ERROR_POS_3)
}
-
- PRINTL("\nPASSED: Public API argument validation tests completed")
+
+ ENSURE(NCDestroyContext(ctx) == NC_SUCCESS);
+
+#ifdef NOSCRYPTUTIL_H
+ NCUtilContextFree(ctx);
+#else
+ free(ctx);
+#endif
+
+ PRINTL("\nPASSED: Public API argument validation tests completed");
return 0;
}