]> 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:43:01 +0000 (14:43 +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>
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 82c20c1f45f1f886a24079e9397270ff3dc6bbfb..d28bd8a9532716021487b4a8a3cd9da92c7f11fd 100644 (file)
@@ -428,11 +428,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 1679d880a138efd9c0f99d7ec575f703b0788f76..cb4eaa29bdcf3cd726eb9cc52f3343926ad1b024 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 52a41ee54baac2fdf0cb04a907aacfcc7c137aa0..29365db2e5e9ab6cca4b2ec102f75436430e3719 100644 (file)
@@ -407,8 +407,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 a94732dab2f023d9f8095c37c620851616d857e9..cad2ce0690d147797213f042ecbe3cfc326e4018 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 ed82279f3edfcf67ac1abe04a9225fc2e1c23424..1776d71c1999c1cff93e70b6f5fe3a90bf5fce69 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);
 }