From: "cron2 (Code Review)" Date: Mon, 16 Mar 2026 13:52:21 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="zaenfaOX2dI="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Remove unnecessary OpenSSL init and cleanup commands in unit tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --zaenfaOX2dI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/15= 68?usp=3Demail ) Change subject: Remove unnecessary OpenSSL init and cleanup commands in uni= t tests ...................................................................... Remove unnecessary OpenSSL init and cleanup commands in unit tests 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 Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1568 Message-Id: <20260316121148.25189-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 153.html Signed-off-by: Gert Doering --- M tests/unit_tests/openvpn/test_auth_token.c M tests/unit_tests/openvpn/test_crypto.c M tests/unit_tests/openvpn/test_ncp.c M tests/unit_tests/openvpn/test_pkt.c M tests/unit_tests/openvpn/test_tls_crypt.c 5 files changed, 5 insertions(+), 43 deletions(-) diff --git a/tests/unit_tests/openvpn/test_auth_token.c b/tests/unit_tests/= openvpn/test_auth_token.c index 82c20c1..d28bd8a 100644 --- a/tests/unit_tests/openvpn/test_auth_token.c +++ b/tests/unit_tests/openvpn/test_auth_token.c @@ -428,11 +428,5 @@ cmocka_unit_test_setup_teardown(auth_token_test_session_mismatch, = setup, teardown) }; -#if defined(ENABLE_CRYPTO_OPENSSL) - OpenSSL_add_all_algorithms(); -#endif - - int ret =3D cmocka_run_group_tests_name("auth-token tests", tests, NUL= L, NULL); - - return ret; + return cmocka_run_group_tests_name("auth-token tests", tests, NULL, NU= LL); } diff --git a/tests/unit_tests/openvpn/test_crypto.c b/tests/unit_tests/open= vpn/test_crypto.c index 1679d88..cb4eaa2 100644 --- a/tests/unit_tests/openvpn/test_crypto.c +++ b/tests/unit_tests/openvpn/test_crypto.c @@ -963,15 +963,5 @@ cmocka_unit_test(epoch_test_derive_data_key) }; -#if defined(ENABLE_CRYPTO_OPENSSL) - OpenSSL_add_all_algorithms(); -#endif - - int ret =3D cmocka_run_group_tests_name("crypto tests", tests, NULL, N= ULL); - -#if defined(ENABLE_CRYPTO_OPENSSL) - EVP_cleanup(); -#endif - - return ret; + return cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL); } diff --git a/tests/unit_tests/openvpn/test_ncp.c b/tests/unit_tests/openvpn= /test_ncp.c index 52a41ee..29365db 100644 --- a/tests/unit_tests/openvpn/test_ncp.c +++ b/tests/unit_tests/openvpn/test_ncp.c @@ -407,8 +407,6 @@ 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); } diff --git a/tests/unit_tests/openvpn/test_pkt.c b/tests/unit_tests/openvpn= /test_pkt.c index a94732d..cad2ce0 100644 --- a/tests/unit_tests/openvpn/test_pkt.c +++ b/tests/unit_tests/openvpn/test_pkt.c @@ -765,15 +765,5 @@ cmocka_unit_test(test_extract_control_message) }; -#if defined(ENABLE_CRYPTO_OPENSSL) - OpenSSL_add_all_algorithms(); -#endif - - int ret =3D 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); } diff --git a/tests/unit_tests/openvpn/test_tls_crypt.c b/tests/unit_tests/o= penvpn/test_tls_crypt.c index ed82279..1776d71 100644 --- a/tests/unit_tests/openvpn/test_tls_crypt.c +++ b/tests/unit_tests/openvpn/test_tls_crypt.c @@ -673,15 +673,5 @@ cmocka_unit_test(test_tls_crypt_v2_write_client_key_file_metadata), }; -#if defined(ENABLE_CRYPTO_OPENSSL) - OpenSSL_add_all_algorithms(); -#endif - - int ret =3D 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, NUL= L); } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1568?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I228f6fd9ff18256f09d4348df1fc48853f8e7306 Gerrit-Change-Number: 1568 Gerrit-PatchSet: 4 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel --zaenfaOX2dI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

Remove unnecessary OpenSSL init and cleanup comm=
ands in unit tests

After the removal of OpenSSL 1.0.2 support these = instructions are
no longer needed and the main OpenVPN program also no l= onger calls
them in init_ssl_lib or free_ssl_lib.

Also remove the= m from the unit tests. This also solves a
deprecation warning on EVP_cle= anup when compiling with aws-lc

Change-Id: I228f6fd9ff18256f09d4348d= f1fc48853f8e7306
Signed-off-by: Arne Schwabe <arne-openvpn@...1227...= >
Acked-by: Frank Lichtenheld <frank@...2641...>
Gerrit URL:= https://gerrit.openvpn.net/c/openvpn/+/1568
Message-Id: <20260316121= 148.25189-1-frank@...2641...>
URL: https://www.mail-archive.com/openv= pn-devel@lists.sourceforge.net/msg36153.html
Signed-off-by: Gert Doering= <gert@...1296...>
---
M tests/unit_tests/openvpn/test_auth_tok= en.c
M tests/unit_tests/openvpn/test_crypto.c
M tests/unit_tests/open= vpn/test_ncp.c
M tests/unit_tests/openvpn/test_pkt.c
M tests/unit_tes= ts/openvpn/test_tls_crypt.c
5 files changed, 5 insertions(+), 43 deletio= ns(-)

diff --git a/tests/unit_tests/openvpn/test_auth_token.c b/tests/unit_tes=
ts/openvpn/test_auth_token.c
index 82c20c1..d28bd8a 100644<= /span>
--- a/tests/unit_tests/openvpn/test_auth_token.c
= +++ b/tests/unit_tests/openvpn/test_auth_token.c
@@ -= 428,11 +428,5 @@
cmocka_unit_test_setup_teardown(a= uth_token_test_session_mismatch, setup, teardown)
};

-#if d= efined(ENABLE_CRYPTO_OPENSSL)
- OpenSSL_add_all_algorithms();
-#endif
-
- int ret =3D = 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);
}
<= span>diff --git a/tests/unit_tests/openvpn/test_crypto.c b/tests/unit_tests= /openvpn/test_crypto.c

index 1679d88..cb4eaa2 100644=
--- a/tests/unit_tests/openvpn/test_crypto.c
+++ = b/tests/unit_tests/openvpn/test_crypto.c
@@ -963,15 +963,5 = @@
cmocka_unit_test(epoch_test_derive_data_key)
};

-#if defined(ENABLE_CRYPTO_OPENSSL)
- OpenSSL_add_all_algorithms();-#endif
-
- int ret =3D cmocka_run_group_tests_name("crypto tests"= ;, tests, NULL, NULL);
= -
-#if defined(ENABLE_C= RYPTO_OPENSSL)
- EVP= _cleanup();
-#endif

-
- return ret;
+ return cmocka_run_group_tests_name("crypt= o tests", tests, NULL, NULL);
}
diff = --git a/tests/unit_tests/openvpn/test_ncp.c b/tests/unit_tests/openvpn/test= _ncp.c
index 52a41ee..29365db 100644
--- a/= tests/unit_tests/openvpn/test_ncp.c
+++ b/tests/unit_tests/= openvpn/test_ncp.c
@@ -407,8 +407,6 @@
mai= n(void)
{
openvpn_unit_test_setup();<= /span>
-#if defined(ENABLE_CRY= PTO_OPENSSL)
- OpenS= SL_add_all_algorithms();
+ return cmocka_run_group_tests(ncp_tests, NULL, NULL); }
diff --git a/tests/unit_tests/openvpn/test_pkt.c = b/tests/unit_tests/openvpn/test_pkt.c
index a94732d..cad2ce= 0 100644
--- a/tests/unit_tests/openvpn/test_pkt.c+++ b/tests/unit_tests/openvpn/test_pkt.c
@@ -765,1= 5 +765,5 @@
cmocka_unit_test(test_extract_control_= message)
};

-#if defined(ENABLE_CRYPTO_OPENSSL)
<= span style=3D"color: hsl(0, 100%, 40%);">- OpenSSL_add_all_algorithms();=

-#endif
-
- int ret =3D cmocka_run_group_tests_name("pkt tes= ts", tests, NULL, NULL);
-
-#if defined(E= NABLE_CRYPTO_OPENSSL)
-= EVP_cleanup();
-#en= dif
-
- return ret;
+ return cmocka_run_group_tests_name(&q= uot;pkt tests", tests, NULL, NULL);
}
diff --git a/tests/unit_tests/openvpn/test_tls_crypt.c b/tests/unit_tests/= openvpn/test_tls_crypt.c
index ed82279..1776d71 100644

--- a/tests/unit_tests/openvpn/test_tls_crypt.c
+++ b/tests/unit_tests/openvpn/test_tls_crypt.c
@@ -673,15= +673,5 @@
cmocka_unit_test(test_tls_crypt_v2_writ= e_client_key_file_metadata),
};

-#if defined(ENABLE_CRYPTO_= OPENSSL)
- OpenSSL_a= dd_all_algorithms();
-#= endif
-
- int ret =3D cmocka_run_group_test= s_name("tls-crypt tests", tests, NULL, NULL);

-
-#if defined(ENABLE_CRYPTO_OPENSSL)
- EVP_cleanup();
-#endif
-
- return re= t;
+ return cmocka= _run_group_tests_name("tls-crypt tests", tests, NULL, NULL);
}

To view, visit change 1568= . To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I228f6fd9ff18256f09d4348df1f= c48853f8e7306
Gerrit-Change-Number: 1568
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --zaenfaOX2dI=--