Skip to content

Commit 735bc9c

Browse files
committed
Remove unnecessary OpenSSL init and unit 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
1 parent 54f4eea commit 735bc9c

File tree

5 files changed

+5
-43
lines changed

5 files changed

+5
-43
lines changed

tests/unit_tests/openvpn/test_auth_token.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,5 @@ main(void)
428428
cmocka_unit_test_setup_teardown(auth_token_test_session_mismatch, setup, teardown)
429429
};
430430

431-
#if defined(ENABLE_CRYPTO_OPENSSL)
432-
OpenSSL_add_all_algorithms();
433-
#endif
434-
435-
int ret = cmocka_run_group_tests_name("auth-token tests", tests, NULL, NULL);
436-
437-
return ret;
431+
return cmocka_run_group_tests_name("auth-token tests", tests, NULL, NULL);
438432
}

tests/unit_tests/openvpn/test_crypto.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -963,15 +963,5 @@ main(void)
963963
cmocka_unit_test(epoch_test_derive_data_key)
964964
};
965965

966-
#if defined(ENABLE_CRYPTO_OPENSSL)
967-
OpenSSL_add_all_algorithms();
968-
#endif
969-
970-
int ret = cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);
971-
972-
#if defined(ENABLE_CRYPTO_OPENSSL)
973-
EVP_cleanup();
974-
#endif
975-
976-
return ret;
966+
return cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);
977967
}

tests/unit_tests/openvpn/test_ncp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,6 @@ int
407407
main(void)
408408
{
409409
openvpn_unit_test_setup();
410-
#if defined(ENABLE_CRYPTO_OPENSSL)
411-
OpenSSL_add_all_algorithms();
412-
#endif
410+
413411
return cmocka_run_group_tests(ncp_tests, NULL, NULL);
414412
}

tests/unit_tests/openvpn/test_pkt.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -765,15 +765,5 @@ main(void)
765765
cmocka_unit_test(test_extract_control_message)
766766
};
767767

768-
#if defined(ENABLE_CRYPTO_OPENSSL)
769-
OpenSSL_add_all_algorithms();
770-
#endif
771-
772-
int ret = cmocka_run_group_tests_name("pkt tests", tests, NULL, NULL);
773-
774-
#if defined(ENABLE_CRYPTO_OPENSSL)
775-
EVP_cleanup();
776-
#endif
777-
778-
return ret;
768+
return cmocka_run_group_tests_name("pkt tests", tests, NULL, NULL);
779769
}

tests/unit_tests/openvpn/test_tls_crypt.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -673,15 +673,5 @@ main(void)
673673
cmocka_unit_test(test_tls_crypt_v2_write_client_key_file_metadata),
674674
};
675675

676-
#if defined(ENABLE_CRYPTO_OPENSSL)
677-
OpenSSL_add_all_algorithms();
678-
#endif
679-
680-
int ret = cmocka_run_group_tests_name("tls-crypt tests", tests, NULL, NULL);
681-
682-
#if defined(ENABLE_CRYPTO_OPENSSL)
683-
EVP_cleanup();
684-
#endif
685-
686-
return ret;
676+
return cmocka_run_group_tests_name("tls-crypt tests", tests, NULL, NULL);
687677
}

0 commit comments

Comments
 (0)