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

2b78f7
diff -up ntp-4.2.6p5/ntpd/ntp_proto.c.cve-2015-1798 ntp-4.2.6p5/ntpd/ntp_proto.c
2b78f7
--- ntp-4.2.6p5/ntpd/ntp_proto.c.cve-2015-1798	2015-04-08 12:50:57.997021032 +0200
2b78f7
+++ ntp-4.2.6p5/ntpd/ntp_proto.c	2015-04-08 12:50:58.005021047 +0200
2b78f7
@@ -1130,18 +1130,20 @@ receive(
2b78f7
 		return;
2b78f7
 
2b78f7
 	/* 
2b78f7
-	 * If the digest fails, the client cannot authenticate a server
2b78f7
+	 * If the digest fails or it's missing for authenticated
2b78f7
+	 * associations, the client cannot authenticate a server
2b78f7
 	 * reply to a client packet previously sent. The loopback check
2b78f7
 	 * is designed to avoid a bait-and-switch attack, which was
2b78f7
 	 * possible in past versions. If symmetric modes, return a
2b78f7
 	 * crypto-NAK. The peer should restart the protocol.
2b78f7
 	 */
2b78f7
-	} else if (!AUTH(has_mac || (restrict_mask & RES_DONTTRUST),
2b78f7
-	    is_authentic)) {
2b78f7
+	} else if (!AUTH(peer->keyid || has_mac ||
2b78f7
+			 (restrict_mask & RES_DONTTRUST), is_authentic)) {
2b78f7
 		report_event(PEVNT_AUTH, peer, "digest");
2b78f7
 		peer->flash |= TEST5;		/* bad auth */
2b78f7
 		peer->badauth++;
2b78f7
-		if (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE)
2b78f7
+		if (has_mac &&
2b78f7
+		    (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE))
2b78f7
 			fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask);
2b78f7
 		if (peer->flags & FLAG_PREEMPT) {
2b78f7
 			unpeer(peer);