]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not assign NULL conditionally in OpenSSL < 1.1, make it always explicit.
authorPetr Mensik <pmensik@redhat.com>
Sat, 24 Feb 2018 18:47:35 +0000 (10:47 -0800)
committerMark Andrews <marka@isc.org>
Fri, 6 Apr 2018 04:27:23 +0000 (14:27 +1000)
(cherry picked from commit edaafacf36d485eff168dff66496fe849fdf3fd5)

lib/dns/dst_openssl.h
lib/dns/openssldh_link.c
lib/dns/openssldsa_link.c
lib/dns/opensslrsa_link.c

index 393700f4c7b0a87d7f2b3de503a5e8514cad9078..6fbeb3bf06447eaae8a4bb921af8c1279e17c458 100644 (file)
@@ -14,8 +14,6 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dst_openssl.h,v 1.11 2011/03/12 04:59:48 tbox Exp $ */
-
 #ifndef DST_OPENSSL_H
 #define DST_OPENSSL_H 1
 
@@ -46,7 +44,7 @@
  *              _cb;
  * #endif
  */
-#define BN_GENCB_free(x) (x = NULL);
+#define BN_GENCB_free(x) ((void)0)
 #define BN_GENCB_new() (&_cb)
 #define BN_GENCB_get_arg(x) ((x)->arg)
 #endif
index d5b3e4e0f0613511d6d6f702f66cb591f9240e15..4d6523a0dc7fba1bccd90dd0de0848e4a4958abe 100644 (file)
@@ -33,7 +33,6 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: openssldh_link.c,v 1.20 2011/01/11 23:47:13 tbox Exp $
  */
 
 #ifdef OPENSSL
@@ -312,6 +311,7 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
                                        DST_R_OPENSSLFAILURE));
                }
                BN_GENCB_free(cb);
+               cb = NULL;
 #else
                dh = DH_generate_parameters(key->key_size, generator,
                                            NULL, NULL);
index d29e04742a4b503516cf94e7691f22310d259971..3449cf1c46e185889e8069283a6a5fd8c739d8c7 100644 (file)
@@ -491,6 +491,7 @@ openssldsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
                                               DST_R_OPENSSLFAILURE));
        }
        BN_GENCB_free(cb);
+       cb = NULL;
 #else
        dsa = DSA_generate_parameters(key->key_size, rand_array,
                                      ISC_SHA1_DIGESTLENGTH, NULL, NULL,
index f1bf3737d1698517a5373309a17bfee3c5f49f17..7bde6d8295e0920c6b93b4f61a5aab5ae7a671e8 100644 (file)
@@ -995,6 +995,7 @@ opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
        if (RSA_generate_key_ex(rsa, key->key_size, e, cb)) {
                BN_free(e);
                BN_GENCB_free(cb);
+               cb = NULL;
                SET_FLAGS(rsa);
 #if USE_EVP
                key->keydata.pkey = pkey;
@@ -1017,8 +1018,10 @@ opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
                BN_free(e);
        if (rsa != NULL)
                RSA_free(rsa);
-       if (cb != NULL)
+       if (cb != NULL) {
                BN_GENCB_free(cb);
+               cb = NULL;
+       }
        return (dst__openssl_toresult(ret));
 #else
        RSA *rsa;