]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove unnecessary OpenSSL init and cleanup commands in unit tests
authorArne Schwabe <arne@rfc2549.org>
Mon, 16 Mar 2026 12:11:48 +0000 (13:11 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 16 Mar 2026 13:47:34 +0000 (14:47 +0100)
After the removal of OpenSSL 1.0.2 support these instructions are
no longer needed and the main OpenVPN program also no longer calls
them in init_ssl_lib or free_ssl_lib.

Also remove them from the unit tests. This also solves a
deprecation warning on EVP_cleanup when compiling with aws-lc

Change-Id: I228f6fd9ff18256f09d4348df1fc48853f8e7306
Signed-off-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1568
Message-Id: <20260316121148.25189-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36153.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 369c7510788d44747b75fceb61edbf30b87638f0)

tests/unit_tests/openvpn/test_auth_token.c
tests/unit_tests/openvpn/test_crypto.c
tests/unit_tests/openvpn/test_ncp.c
tests/unit_tests/openvpn/test_pkt.c
tests/unit_tests/openvpn/test_tls_crypt.c

index e1fcc69966be615950ad9e2fe7a360b62177967c..9438b6c8be9bfe286aedeef64a5aa6723fea74a0 100644 (file)
@@ -418,11 +418,5 @@ main(void)
         cmocka_unit_test_setup_teardown(auth_token_test_session_mismatch, setup, teardown)
     };
 
-#if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
-#endif
-
-    int ret = cmocka_run_group_tests_name("auth-token tests", tests, NULL, NULL);
-
-    return ret;
+    return cmocka_run_group_tests_name("auth-token tests", tests, NULL, NULL);
 }
index a1d7ddd62a71f43616e052de0db0d0b856d33ccb..7ee163dbcf85638b728243048d09ae14a2615b0c 100644 (file)
@@ -963,15 +963,5 @@ main(void)
         cmocka_unit_test(epoch_test_derive_data_key)
     };
 
-#if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
-#endif
-
-    int ret = cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);
-
-#if defined(ENABLE_CRYPTO_OPENSSL)
-    EVP_cleanup();
-#endif
-
-    return ret;
+    return cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);
 }
index 9f569a7efbf1092f013a2ca2301e1c3f46360a5d..224a017e612d3368511cfc10912d258aa92ab84f 100644 (file)
@@ -394,8 +394,6 @@ int
 main(void)
 {
     openvpn_unit_test_setup();
-#if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
-#endif
+
     return cmocka_run_group_tests(ncp_tests, NULL, NULL);
 }
index ca62b38ac7f9ada6d6fc18345fad610dd8b3ba30..d51d35eb7247c8383743032b421cf48a479597e7 100644 (file)
@@ -765,15 +765,5 @@ main(void)
         cmocka_unit_test(test_extract_control_message)
     };
 
-#if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
-#endif
-
-    int ret = cmocka_run_group_tests_name("pkt tests", tests, NULL, NULL);
-
-#if defined(ENABLE_CRYPTO_OPENSSL)
-    EVP_cleanup();
-#endif
-
-    return ret;
+    return cmocka_run_group_tests_name("pkt tests", tests, NULL, NULL);
 }
index 730841e4f7c15b89325181a54603a10f5df86660..69f78fd9230ac724695b194ed81318740a0700e4 100644 (file)
@@ -673,15 +673,5 @@ main(void)
         cmocka_unit_test(test_tls_crypt_v2_write_client_key_file_metadata),
     };
 
-#if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
-#endif
-
-    int ret = cmocka_run_group_tests_name("tls-crypt tests", tests, NULL, NULL);
-
-#if defined(ENABLE_CRYPTO_OPENSSL)
-    EVP_cleanup();
-#endif
-
-    return ret;
+    return cmocka_run_group_tests_name("tls-crypt tests", tests, NULL, NULL);
 }