summaryrefslogtreecommitdiff
path: root/src/lib/tests/auth_test.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-07-02 01:12:51 +0200
committerSander Vrijders <sander@ouroboros.rocks>2026-07-08 11:02:23 +0200
commit92258b43691a7c8fa420941a4d3b3f870e05d55f (patch)
tree1940da81b2f80f7b2b455c755c6a28d8da0bdb08 /src/lib/tests/auth_test.c
parent4c836008dcac27e0a8258b07270a8a529b2d9167 (diff)
downloadouroboros-92258b43691a7c8fa420941a4d3b3f870e05d55f.tar.gz
ouroboros-92258b43691a7c8fa420941a4d3b3f870e05d55f.zip
lib: Harden crypto unit tests
Stop the non-OpenSSL runners from masking a real failure as SKIP by only downgrading to SKIP if they passed. Fix a stray call that ran test_kex_dhe_wrong_algo in the skip branch. Fix double free + free of an uninitialised pointer in test_store_add. Test that a KDF- less derive must fail. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/tests/auth_test.c')
-rw-r--r--src/lib/tests/auth_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/tests/auth_test.c b/src/lib/tests/auth_test.c
index af7cf81c..61f97683 100644
--- a/src/lib/tests/auth_test.c
+++ b/src/lib/tests/auth_test.c
@@ -304,7 +304,7 @@ static int test_store_add(void)
fail_add:
crypt_free_crt(_root_ca_crt);
fail_load:
- crypt_free_crt(_root_ca_crt);
+ auth_destroy_ctx(ctx);
fail_create:
TEST_FAIL();
return TEST_RC_FAIL;
@@ -737,7 +737,8 @@ int auth_test(int argc,
(void) test_auth_bad_signature;
(void) test_crt_str;
- ret = TEST_RC_SKIP;
+ if (ret == 0)
+ ret = TEST_RC_SKIP;
#endif
return ret;
}