]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
authistrustedip() - use it in more places
authorHarlan Stenn <stenn@ntp.org>
Sun, 31 Dec 2017 10:49:37 +0000 (02:49 -0800)
committerHarlan Stenn <stenn@ntp.org>
Sun, 31 Dec 2017 10:49:37 +0000 (02:49 -0800)
bk: 5a48c0c1kWXL9GdHqJAEh5q2GmfopA

ChangeLog
ntpd/ntp_control.c
ntpd/ntp_request.c

index bf3f9b10feee29336ee0bf2e241d9237e6f3560c..8698574f145494ea48dded8ec603b91ffccc2b4c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,7 +66,8 @@
 * When using pkg-config, report --modversion.  HStenn.
 * Clean up libevent configure checks.  HStenn.
 * sntp: show the IP of who sent us a crypto-NAK.  HStenn.
-* Allow .../N to specify subnet bits for IPs in ntp.keys.  HStenn.
+* Allow .../N to specify subnet bits for IPs in ntp.keys.  HStenn, JPerlinger.
+* authistrustedip() - use it in more places.  HStenn, JPerlinger.
 
 ---
 (4.2.8p10) 2017/03/21 Released by Harlan Stenn <stenn@ntp.org>
index 1c2fae0e50118010190f411f2f8ca31b1cb383fd..57d65238c137a5d3316124916b38da6b62b1efa7 100644 (file)
@@ -1264,7 +1264,7 @@ process_control(
                            rbufp->recv_length, properlen, res_keyid,
                            maclen));
 
-               if (!authistrusted(res_keyid))
+               if (!authistrustedip(res_keyid, &rbufp->recv_srcadr))
                        DPRINTF(3, ("invalid keyid %08x\n", res_keyid));
                else if (authdecrypt(res_keyid, (u_int32 *)pkt,
                                     rbufp->recv_length - maclen,
index 5e0e6f82f15941384725c6063fb8872866f08006..1acbf80d46545f0521ea1e5c42e1ed213a3909e2 100644 (file)
@@ -582,6 +582,7 @@ process_private(
                 * him.  If the wrong key was used, or packet doesn't
                 * have mac, return.
                 */
+               /* XXX: Use authistrustedip(), or equivalent. */
                if (!INFO_IS_AUTH(inpkt->auth_seq) || !info_auth_keyid
                    || ntohl(tailinpkt->keyid) != info_auth_keyid) {
                        DPRINTF(5, ("failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n",