]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2214. [bug] Deregister OpenSSL lock callback when cleaning
authorMark Andrews <marka@isc.org>
Mon, 27 Aug 2007 03:04:17 +0000 (03:04 +0000)
committerMark Andrews <marka@isc.org>
Mon, 27 Aug 2007 03:04:17 +0000 (03:04 +0000)
                        up.  Reorder OpenSSL cleanup so that RAND_cleanup()
                        is called before the locks are destroyed. [RT #17098]

CHANGES
lib/dns/openssl_link.c

diff --git a/CHANGES b/CHANGES
index bf9f0b8ffa07db4a2332e3a22debf25f5851cb50..b5a1a0d9f2ee5e1b8e7b797ef24a427c49c35b6b 100644 (file)
--- 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]
 
index d3e000236f1c143b1dd23a070aa8718092e07b42..c60a241b069ace25625359c0650f345c4f02897d 100644 (file)
@@ -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