Blob Blame History Raw
From c79ff443ba029eaf7da8781aef0b1ddbed467781 Mon Sep 17 00:00:00 2001
From: Petr Mensik <pemensik@redhat.com>
Date: Fri, 14 Jun 2019 12:30:01 +0200
Subject: [PATCH] Fix OpenSSL random generator warnings Squashed commit of the
 following:

commit 70492c6361e55309dae0e48ae031e295f0a46a5e
Author: Evan Hunt <each@isc.org>
Date:   Sat Sep 16 21:01:06 2017 -0700

    [master] silence compiler warning

    (cherry picked from commit 6e5ae91479408540f04337c9dc27c3f3fffae6c7)

commit 4d8c2767b584d993eb898d2210c85ffce214d1dc
Author: Mark Andrews <marka@isc.org>
Date:   Fri Dec 22 08:48:38 2017 +1100

    add POST(argc);

    (cherry picked from commit be5a0eaa7adafc454658e09672d865eb453baeab)
    (cherry picked from commit 0163c3b8130cbed705c3267948ab49eebe26286d)

commit c64b5b10a3a175482b89eddbe63d8b5107a2fbf3
Author: Petr Mensik <pemensik@redhat.com>
Date:   Thu Jun 13 22:23:14 2019 +0200

    fixup! completed and corrected the crypto-random change
---
 bin/named/server.c                | 3 +++
 bin/tests/system/tkey/keydelete.c | 1 +
 lib/dns/tests/dstrandom_test.c    | 3 +--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/named/server.c b/bin/named/server.c
index db0270900f..1afb461226 100644
--- a/bin/named/server.c
+++ b/bin/named/server.c
@@ -8100,6 +8100,8 @@ load_configuration(const char *filename, ns_server_t *server,
 			}
 #endif
 		} else {
+			result = isc_entropy_createfilesource(ns_g_entropy,
+			                                      randomdev);
 #ifdef PATH_RANDOMDEV
 			if (ns_g_fallbackentropy != NULL) {
 				level = ISC_LOG_INFO;
@@ -8893,6 +8895,7 @@ ns_server_create(isc_mem_t *mctx, ns_server_t **serverp) {
 	server->in_roothints = NULL;
 	server->blackholeacl = NULL;
 	server->keepresporder = NULL;
+	server->rngctx = NULL;
 
 	/* Must be first. */
 	CHECKFATAL(dst_lib_init2(ns_g_mctx, ns_g_entropy,
diff --git a/bin/tests/system/tkey/keydelete.c b/bin/tests/system/tkey/keydelete.c
index 3d5ac74486..55ebb66a60 100644
--- a/bin/tests/system/tkey/keydelete.c
+++ b/bin/tests/system/tkey/keydelete.c
@@ -172,6 +172,7 @@ main(int argc, char **argv) {
 		randomfile = argv[2];
 		argv += 2;
 		argc -= 2;
+		POST(argc);
 	}
 	keyname = argv[1];
 
diff --git a/lib/dns/tests/dstrandom_test.c b/lib/dns/tests/dstrandom_test.c
index d2c72e7685..56738d14a4 100644
--- a/lib/dns/tests/dstrandom_test.c
+++ b/lib/dns/tests/dstrandom_test.c
@@ -14,8 +14,6 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id$ */
-
 /*! \file */
 
 #include <config.h>
@@ -24,6 +22,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <isc/entropy.h>
 #include <isc/mem.h>
-- 
2.20.1