From 69bf8dc41d92bec6cf90c481c837dec08a97952b Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 11 Feb 2013 16:03:51 +0000 Subject: [PATCH] - Fixup openssl_thread init code to only run if compiled with SSL. git-svn-id: file:///svn/unbound/trunk@2843 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/daemon.c | 4 ++-- doc/Changelog | 3 +++ util/net_help.c | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/daemon/daemon.c b/daemon/daemon.c index 61258174f..b91683feb 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -211,7 +211,7 @@ daemon_init(void) comp_meth = (void*)SSL_COMP_get_compression_methods(); # endif (void)SSL_library_init(); -# if defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) +# if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) if(!ub_openssl_lock_init()) fatal_exit("could not init openssl locks"); # endif @@ -574,7 +574,7 @@ daemon_delete(struct daemon* daemon) ERR_remove_state(0); ERR_free_strings(); RAND_cleanup(); -# if defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) +# if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) ub_openssl_lock_delete(); # endif #elif defined(HAVE_NSS) diff --git a/doc/Changelog b/doc/Changelog index 8d10747a4..9a3645523 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +11 February 2013: Wouter + - Fixup openssl_thread init code to only run if compiled with SSL. + 7 February 2013: Wouter - detect endianness in lookup3 on BSD. - add libunbound.ttl at end of result structure, version bump for diff --git a/util/net_help.c b/util/net_help.c index 054fa5086..64bd876dc 100644 --- a/util/net_help.c +++ b/util/net_help.c @@ -726,7 +726,7 @@ void* outgoing_ssl_fd(void* sslctx, int fd) #endif } -#if defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) +#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) /** global lock list for openssl locks */ static lock_basic_t *ub_openssl_locks = NULL; @@ -751,7 +751,7 @@ ub_crypto_lock_cb(int mode, int type, const char *ATTR_UNUSED(file), int ub_openssl_lock_init(void) { -#if defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) +#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) int i; ub_openssl_locks = (lock_basic_t*)malloc( sizeof(lock_basic_t)*CRYPTO_num_locks()); @@ -768,7 +768,7 @@ int ub_openssl_lock_init(void) void ub_openssl_lock_delete(void) { -#if defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) +#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) int i; if(!ub_openssl_locks) return; -- 2.47.3