aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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;
}