From 669383b4afac1f0a72c3c1106f1b6d61abc16e78 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 10 Jul 2026 17:09:58 +0200 Subject: lib: Fix crypt_test without crypto backend Creating a context without OpenSSL fails (returns NULL) after adding the key rotation logic (requires HKDF). Assert instead that context creation returns NULL without OpenSSL. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/tests/crypt_test.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lib/tests') diff --git a/src/lib/tests/crypt_test.c b/src/lib/tests/crypt_test.c index f00618d8..50b7268a 100644 --- a/src/lib/tests/crypt_test.c +++ b/src/lib/tests/crypt_test.c @@ -51,12 +51,20 @@ static int test_crypt_create_destroy(void) memset(key, 0, sizeof(key)); ctx = crypt_create_ctx(&sk); +#ifdef HAVE_OPENSSL if (ctx == NULL) { printf("Failed to initialize cryptography.\n"); goto fail; } crypt_destroy_ctx(ctx); +#else + if (ctx != NULL) { + printf("Created cipher context without a backend.\n"); + crypt_destroy_ctx(ctx); + goto fail; + } +#endif TEST_SUCCESS(); -- cgit v1.2.3