From: Mark Andrews Date: Mon, 27 Aug 2007 03:04:17 +0000 (+0000) Subject: 2214. [bug] Deregister OpenSSL lock callback when cleaning X-Git-Tag: v9.4.2rc1~39^2~27 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=634a4da58460979fa0fcad5304b810d189f9cf49;p=thirdparty%2Fbind9.git 2214. [bug] Deregister OpenSSL lock callback when cleaning up. Reorder OpenSSL cleanup so that RAND_cleanup() is called before the locks are destroyed. [RT #17098] --- diff --git a/CHANGES b/CHANGES index bf9f0b8ffa0..b5a1a0d9f2e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +2214. [bug] Deregister OpenSSL lock callback when cleaning + up. Reorder OpenSSL cleanup so that RAND_cleanup() + is called before the locks are destroyed. [RT #17098] + 2213. [bug] SIG0 diagnostic failure messages were looking at the wrong status code. [RT #17101] diff --git a/lib/dns/openssl_link.c b/lib/dns/openssl_link.c index d3e000236f1..c60a241b069 100644 --- a/lib/dns/openssl_link.c +++ b/lib/dns/openssl_link.c @@ -31,7 +31,7 @@ /* * Principal Author: Brian Wellington - * $Id: openssl_link.c,v 1.14 2007/06/19 23:47:16 tbox Exp $ + * $Id: openssl_link.c,v 1.15 2007/08/27 03:03:41 marka Exp $ */ #ifdef OPENSSL @@ -197,6 +197,7 @@ dst__openssl_init() { mem_free(rm); #endif cleanup_mutexinit: + CRYPTO_set_locking_callback(NULL); DESTROYMUTEXBLOCK(locks, nlocks); cleanup_mutexalloc: mem_free(locks); @@ -240,16 +241,17 @@ dst__openssl_destroy() { } #endif #endif - if (locks != NULL) { - DESTROYMUTEXBLOCK(locks, nlocks); - mem_free(locks); - } if (rm != NULL) { #if OPENSSL_VERSION_NUMBER >= 0x00907000L RAND_cleanup(); #endif mem_free(rm); } + if (locks != NULL) { + CRYPTO_set_locking_callback(NULL); + DESTROYMUTEXBLOCK(locks, nlocks); + mem_free(locks); + } } isc_result_t