]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Tue, 18 Feb 2003 06:24:45 +0000 (06:24 +0000)
committerMark Andrews <marka@isc.org>
Tue, 18 Feb 2003 06:24:45 +0000 (06:24 +0000)
1395.   [port]          OpenSSL 0.9.7 defines CRYPTO_LOCK_ENGINE but doesn't
                        have a working implementation.  [RT #4079]

CHANGES
lib/dns/sec/dst/openssl_link.c

diff --git a/CHANGES b/CHANGES
index 8a25f34b0fb3de1929154210572bedf16b442194..20c79761c066355026c22e0c37a90c8bc5e22fec 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@
 1426.   [cleanup]      Disable RFC2535 style DNSSEC.  This is incompatible
                        with the forthcoming DS style DNSSEC.
 
+1395.  [port]          OpenSSL 0.9.7 defines CRYPTO_LOCK_ENGINE but doesn't
+                       have a working implementation.  [RT #4079]
+
 1382.  [bug]           make install failed with --enable-libbind. [RT #3656]
 
 1381.  [bug]           named failed to correctly process answers that
index 5df661e902e2081e16268ef4ab2d291d678e2fa7..adb784bae068d4287d229af34e973d724b85baeb 100644 (file)
@@ -19,7 +19,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: openssl_link.c,v 1.46 2001/07/31 03:45:04 marka Exp $
+ * $Id: openssl_link.c,v 1.46.8.1 2003/02/18 06:24:45 marka Exp $
  */
 #ifdef OPENSSL
 
 #include <openssl/rand.h>
 #include <openssl/crypto.h>
 
-#ifdef CRYPTO_LOCK_ENGINE
+#if defined(CRYPTO_LOCK_ENGINE) && (OPENSSL_VERSION_NUMBER < 0x00907000L)
+#define USE_ENGINE 1
+#endif
+
+#ifdef USE_ENGINE
 #include <openssl/engine.h>
 #endif
 
@@ -46,7 +50,7 @@ static RAND_METHOD *rm = NULL;
 static isc_mutex_t *locks = NULL;
 static int nlocks;
 
-#ifdef CRYPTO_LOCK_ENGINE
+#ifdef USE_ENGINE
 static ENGINE *e;
 #endif
 
@@ -120,7 +124,7 @@ dst__openssl_init() {
        rm->add = entropy_add;
        rm->pseudorand = entropy_getpseudo;
        rm->status = NULL;
-#ifdef CRYPTO_LOCK_ENGINE
+#ifdef USE_ENGINE
        e = ENGINE_new();
        if (e == NULL) {
                result = ISC_R_NOMEMORY;
@@ -133,7 +137,7 @@ dst__openssl_init() {
 #endif
        return (ISC_R_SUCCESS);
 
-#ifdef CRYPTO_LOCK_ENGINE
+#ifdef USE_ENGINE
  cleanup_rm:
        dst__mem_free(rm);
 #endif
@@ -146,6 +150,12 @@ dst__openssl_init() {
 
 void
 dst__openssl_destroy() {
+#ifdef USE_ENGINE
+       if (e != NULL) {
+               ENGINE_free(e);
+               e = NULL;
+       }
+#endif
        if (locks != NULL) {
                RUNTIME_CHECK(isc_mutexblock_destroy(locks, nlocks) ==
                              ISC_R_SUCCESS);