From 67f54eea66071d30d29eb607a81b4b43e6cf28f6 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 3 Jul 2017 13:37:37 +0000 Subject: [PATCH] - Fix openssl 1.1.0 load of ssl error strings from ssl init. git-svn-id: file:///svn/unbound/trunk@4260 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/daemon.c | 4 +++- doc/Changelog | 1 + smallapp/unbound-anchor.c | 4 +++- smallapp/unbound-control.c | 4 +++- testcode/petal.c | 4 +++- testcode/streamtcp.c | 4 +++- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/daemon/daemon.c b/daemon/daemon.c index e8d56aec9..e95dbfbc3 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -221,7 +221,9 @@ daemon_init(void) # ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS ERR_load_crypto_strings(); # endif +#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_CRYPTO) ERR_load_SSL_strings(); +#endif # ifdef USE_GOST (void)sldns_key_EVP_load_gost_id(); # endif @@ -239,7 +241,7 @@ daemon_init(void) # if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) (void)SSL_library_init(); # else - (void)OPENSSL_init_ssl(0, NULL); + (void)OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL); # endif # if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) if(!ub_openssl_lock_init()) diff --git a/doc/Changelog b/doc/Changelog index c1a9ce56e..e9510a5bc 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -4,6 +4,7 @@ - Fix #1331: libunbound segfault in threaded mode when context is deleted. - Fix pythonmod link line option flag. + - Fix openssl 1.1.0 load of ssl error strings from ssl init. 29 June 2017: Wouter - Fix python example0 return module wait instead of error for pass. diff --git a/smallapp/unbound-anchor.c b/smallapp/unbound-anchor.c index 19ee85b1a..c060ad394 100644 --- a/smallapp/unbound-anchor.c +++ b/smallapp/unbound-anchor.c @@ -2326,7 +2326,9 @@ int main(int argc, char* argv[]) #ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS ERR_load_crypto_strings(); #endif +#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) ERR_load_SSL_strings(); +#endif #if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_CRYPTO) OpenSSL_add_all_algorithms(); #else @@ -2337,7 +2339,7 @@ int main(int argc, char* argv[]) #if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) (void)SSL_library_init(); #else - (void)OPENSSL_init_ssl(0, NULL); + (void)OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL); #endif if(dolist) do_list_builtin(); diff --git a/smallapp/unbound-control.c b/smallapp/unbound-control.c index aa2db4a61..c6dcc8eab 100644 --- a/smallapp/unbound-control.c +++ b/smallapp/unbound-control.c @@ -763,7 +763,9 @@ int main(int argc, char* argv[]) #ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS ERR_load_crypto_strings(); #endif +#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) ERR_load_SSL_strings(); +#endif #if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_CRYPTO) OpenSSL_add_all_algorithms(); #else @@ -774,7 +776,7 @@ int main(int argc, char* argv[]) #if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) (void)SSL_library_init(); #else - (void)OPENSSL_init_ssl(0, NULL); + (void)OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL); #endif if(!RAND_status()) { diff --git a/testcode/petal.c b/testcode/petal.c index b30549365..1c26fa700 100644 --- a/testcode/petal.c +++ b/testcode/petal.c @@ -643,7 +643,9 @@ int main(int argc, char* argv[]) #ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS ERR_load_crypto_strings(); #endif +#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) ERR_load_SSL_strings(); +#endif #if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_CRYPTO) OpenSSL_add_all_algorithms(); #else @@ -654,7 +656,7 @@ int main(int argc, char* argv[]) #if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) (void)SSL_library_init(); #else - (void)OPENSSL_init_ssl(0, NULL); + (void)OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL); #endif do_service(addr, port, key, cert); diff --git a/testcode/streamtcp.c b/testcode/streamtcp.c index f5eb8fc48..b494507de 100644 --- a/testcode/streamtcp.c +++ b/testcode/streamtcp.c @@ -410,7 +410,9 @@ int main(int argc, char** argv) return 1; } if(usessl) { +#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) ERR_load_SSL_strings(); +#endif #if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_CRYPTO) OpenSSL_add_all_algorithms(); #else @@ -421,7 +423,7 @@ int main(int argc, char** argv) #if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL) (void)SSL_library_init(); #else - (void)OPENSSL_init_ssl(0, NULL); + (void)OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL); #endif } send_em(svr, udp, usessl, noanswer, argc, argv);