]> 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:26:04 +0000 (14:26 +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 f58acf4bc14ca89961928cc841f9f585d511d7e5..13419d9c640cd725218136ac159f0c0961b7e00d 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
@@ -316,6 +315,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 0f9b86198108fad9e154681c8fb29b871d62a78a..57f4bf179123ecea9018ab00c9c31fbb676e8bef 100644 (file)
@@ -495,6 +495,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 c92f7b59a92545a8a0cb364eabfdb9e116a002c3..382940a420d47944fd97c844fed0e0d49a2bc658 100644 (file)
@@ -1048,6 +1048,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;
@@ -1070,8 +1071,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;