]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that with openssl 1.1 control-use-cert: no uses less cpu, by
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 25 Nov 2016 16:14:14 +0000 (16:14 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 25 Nov 2016 16:14:14 +0000 (16:14 +0000)
  using no encryption over the unix socket.

git-svn-id: file:///svn/unbound/trunk@3936 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/remote.c
doc/Changelog
smallapp/unbound-control.c

index 417c6a24ad35f09064a17fae282b07d7e92799ca..bbd0cff200ab6516a42a63339b75f26a93017c50 100644 (file)
@@ -146,6 +146,7 @@ timeval_divide(struct timeval* avg, const struct timeval* sum, size_t d)
  * the command : "openssl dhparam -C 2048"
  * (some openssl versions reject DH that is 'too small', eg. 512).
  */
+#if OPENSSL_VERSION_NUMBER < 0x10100000
 #ifndef S_SPLINT_S
 static DH *get_dh2048(void)
 {
@@ -203,6 +204,7 @@ err:
        return NULL;
 }
 #endif /* SPLINT */
+#endif /* OPENSSL_VERSION_NUMBER < 0x10100000 */
 
 struct daemon_remote*
 daemon_remote_create(struct config_file* cfg)
@@ -246,12 +248,15 @@ daemon_remote_create(struct config_file* cfg)
 #ifdef HAVE_SSL_CTX_SET_SECURITY_LEVEL
                SSL_CTX_set_security_level(rc->ctx, 0);
 #endif
-               if(!SSL_CTX_set_cipher_list(rc->ctx, "aNULL")) {
+               if(!SSL_CTX_set_cipher_list(rc->ctx, "aNULL, eNULL")) {
                        log_crypto_err("Failed to set aNULL cipher list");
                        daemon_remote_delete(rc);
                        return NULL;
                }
 
+               /* in openssl 1.1, the securitylevel 0 allows eNULL, that
+                * does not need the DH */
+#if OPENSSL_VERSION_NUMBER < 0x10100000
                /* Since we have no certificates and hence no source of
                 * DH params, let's generate and set them
                 */
@@ -260,6 +265,7 @@ daemon_remote_create(struct config_file* cfg)
                        daemon_remote_delete(rc);
                        return NULL;
                }
+#endif
                return rc;
        }
        rc->use_cert = 1;
index 7c90fb30c2456a729630919b83daf739a249aede..f4c07b4c90fc433e52cc877ab229220180da8ecd 100644 (file)
@@ -1,3 +1,7 @@
+25 November 2016: Wouter
+       - Fix that with openssl 1.1 control-use-cert: no uses less cpu, by
+         using no encryption over the unix socket.
+
 22 Novenber 2016: Ralph
        - Make access-control-tag-data RDATA absolute. This makes the RDATA
          origin consistent between local-data and access-control-tag-data.
index 663497205ce7b37ef305bcb708d8724b81cfe131..3734447cfab4bc3738837ebe7c03f095af2afd28 100644 (file)
@@ -179,7 +179,7 @@ setup_ctx(struct config_file* cfg)
 #ifdef HAVE_SSL_CTX_SET_SECURITY_LEVEL
                SSL_CTX_set_security_level(ctx, 0);
 #endif
-               if(!SSL_CTX_set_cipher_list(ctx, "aNULL"))
+               if(!SSL_CTX_set_cipher_list(ctx, "aNULL, eNULL"))
                        ssl_err("Error setting NULL cipher!");
        }
        return ctx;