Blame SOURCES/ntp-4.2.6p5-cve-2014-9293.patch

6d61af
diff -up ntp-4.2.6p5/ntpd/ntp_config.c.cve-2014-9293 ntp-4.2.6p5/ntpd/ntp_config.c
6d61af
--- ntp-4.2.6p5/ntpd/ntp_config.c.cve-2014-9293	2014-12-19 16:24:18.297578337 +0100
6d61af
+++ ntp-4.2.6p5/ntpd/ntp_config.c	2014-12-19 16:24:18.311578368 +0100
6d61af
@@ -1866,13 +1866,16 @@ config_auth(
6d61af
 		req_hashlen = digest_len;
6d61af
 #endif
6d61af
 	} else {
6d61af
-		int	rankey;
6d61af
+		unsigned char rankey[16];
6d61af
+
6d61af
+		if (ntp_crypto_random_buf(rankey, sizeof (rankey))) {
6d61af
+			msyslog(LOG_ERR, "ntp_crypto_random_buf() failed.");
6d61af
+			exit(1);
6d61af
+		}
6d61af
 
6d61af
-		rankey = ntp_random();
6d61af
 		req_keytype = NID_md5;
6d61af
 		req_hashlen = 16;
6d61af
-		MD5auth_setkey(req_keyid, req_keytype,
6d61af
-		    (u_char *)&rankey, sizeof(rankey));
6d61af
+		MD5auth_setkey(req_keyid, req_keytype, rankey, sizeof(rankey));
6d61af
 		authtrust(req_keyid, 1);
6d61af
 	}
6d61af
 
6d61af
diff -up ntp-4.2.6p5/ntpd/ntpd.c.cve-2014-9293 ntp-4.2.6p5/ntpd/ntpd.c
6d61af
--- ntp-4.2.6p5/ntpd/ntpd.c.cve-2014-9293	2014-12-19 16:24:02.000000000 +0100
6d61af
+++ ntp-4.2.6p5/ntpd/ntpd.c	2014-12-19 16:24:18.298578339 +0100
6d61af
@@ -593,6 +593,7 @@ ntpdmain(
6d61af
 	get_systime(&now;;
6d61af
 
6d61af
 	ntp_srandom((int)(now.l_i * now.l_uf));
6d61af
+	ntp_crypto_srandom();
6d61af
 
6d61af
 #if !defined(VMS)
6d61af
 # ifndef NODETACH