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