Skip to content

Commit

Permalink
Fix ssl unit tests on OpenSSL 1.0.2
Browse files Browse the repository at this point in the history
OpenSSL 1.1.1 will initialise itself using clever linker magic. For
OpenSSL 1.0.2 we need to manually initialise the library. For other
unit tests just doing the OpenSSL_add_all_algorithms is enough but
this unit test needs a more complete initialisation.

Change-Id: I378081f391ad755d0a6fd5613de5c2a8bacc389a
Acked-by: Frank Lichtenheld <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg28112.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
schwabe authored and cron2 committed Jan 22, 2024
1 parent a634cc5 commit dc4fde8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit_tests/openvpn/test_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ main(void)
};

#if defined(ENABLE_CRYPTO_OPENSSL)
OpenSSL_add_all_algorithms();
tls_init_lib();
#endif

int ret = cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);

#if defined(ENABLE_CRYPTO_OPENSSL)
EVP_cleanup();
tls_free_lib();
#endif

return ret;
Expand Down

0 comments on commit dc4fde8

Please sign in to comment.