From: "cron2 (Code Review)" Date: Mon, 16 Mar 2026 13:52:19 +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="CpAMGMdUbqA="; 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 , flichtenheld Cc: openvpn-devel --CpAMGMdUbqA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1568?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld 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(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/68/1568/4 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: newpatchset 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 --CpAMGMdUbqA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #4 to the change originally created by plaisthos.<= /p>

Vi= ew Change

The following approvals got outdated and were removed: Code-Review+2 by flichtenheld

Remove unnecessary OpenSSL i=
nit and cleanup commands in unit tests

After the removal of OpenSSL = 1.0.2 support these instructions are
no longer needed and the main OpenV= PN 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
deprecatio= n warning on EVP_cleanup when compiling with aws-lc

Change-Id: I228f= 6fd9ff18256f09d4348df1fc48853f8e7306
Signed-off-by: Arne Schwabe <arn= e-openvpn@...1227...>
Acked-by: Frank Lichtenheld <frank@...2723...= .>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1568
Message= -Id: <20260316121148.25189-1-frank@...2641...>
URL: https://www.ma= il-archive.com/openvpn-devel@lists.sourceforge.net/msg36153.html
Signed-= off-by: Gert Doering <gert@...1296...>
---
M tests/unit_tests/o= penvpn/test_auth_token.c
M tests/unit_tests/openvpn/test_crypto.c
M t= ests/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 inser= tions(+), 43 deletions(-)

git pull ssh://gerrit.=
openvpn.net:29418/openvpn refs/changes/68/1568/4
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/uni= t_tests/openvpn/test_auth_token.c
@@ -428,11 +428,5 @@
cmocka_unit_test_setup_teardown(auth_token_test_sessio= n_mismatch, setup, teardown)
};

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

-
- return ret;
+ return cmocka_run_group_tests_name("auth-token tests&quo= t;, tests, NULL, NULL);
}
diff --git a/tes= ts/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/op= envpn/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_CRYPTO_OPENSSL)
- EVP_cleanup();-#endif
-
- return ret;
+ return cmocka_run_group_tests_name("crypto tests", tes= ts, NULL, NULL);
}
diff --git a/tests/unit= _tests/openvpn/test_ncp.c b/tests/unit_tests/openvpn/test_ncp.c
<= span>index 52a41ee..29365db 100644

--- a/tests/unit_tests/o= penvpn/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_algorit= hms();
-#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/test= s/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, N= ULL, NULL);
--#if defined(ENABLE_CRYPTO_OPENS= SL)
- 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/openvpn/test_tls_cry= pt.c
index ed82279..1776d71 100644
--- a/te= sts/unit_tests/openvpn/test_tls_crypt.c
+++ b/tests/unit_te= sts/openvpn/test_tls_crypt.c
@@ -673,15 +673,5 @@ cmocka_unit_test(test_tls_crypt_v2_write_client_key_file_me= tadata),
};

-#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("tls-cry= pt tests", tests, NULL, NULL);
-
-#if def= ined(ENABLE_CRYPTO_OPENSSL)
- EVP_cleanup();
-
<= span style=3D"color: hsl(0, 100%, 40%);">- return ret;
+ return cmocka_run_group_tests_nam= e("tls-crypt tests", tests, NULL, NULL);
}

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

Gerrit-MessageType: newpatchset
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>
= --CpAMGMdUbqA=--