Blame SOURCES/ntp-4.2.6p5-cve-2015-7974.patch

063937
diff -up ntp-4.2.6p5/ntpd/ntp_proto.c.cve-2015-7974 ntp-4.2.6p5/ntpd/ntp_proto.c
063937
--- ntp-4.2.6p5/ntpd/ntp_proto.c.cve-2015-7974	2016-01-21 14:06:18.958346184 +0100
063937
+++ ntp-4.2.6p5/ntpd/ntp_proto.c	2016-01-21 14:16:34.894828262 +0100
063937
@@ -674,10 +674,13 @@ receive(
063937
 		 * succeed in bloating the key cache. If an autokey,
063937
 		 * purge it immediately, since we won't be needing it
063937
 		 * again. If the packet is authentic, it can mobilize an
063937
-		 * association. Note that there is no key zero.
063937
+		 * association. If it's a persistent association using a
063937
+		 * symmetric key, the key ID has to match the configured
063937
+		 * value. Note that there is no key zero. 
063937
 		 */
063937
-		if (!authdecrypt(skeyid, (u_int32 *)pkt, authlen,
063937
-		    has_mac))
063937
+		if ((peer && !(peer->flags & FLAG_PREEMPT) &&
063937
+		     peer->keyid <= NTP_MAXKEY && skeyid != peer->keyid) ||
063937
+		    !authdecrypt(skeyid, (u_int32 *)pkt, authlen, has_mac))
063937
 			is_authentic = AUTH_ERROR;
063937
 		else
063937
 			is_authentic = AUTH_OK;