From: Harlan Stenn Date: Wed, 10 May 2000 23:19:30 +0000 (-0000) Subject: ChangeLog, configure, configure.in, ntp_crypto.c, ntp_proto.c: X-Git-Tag: NTP_4_0_99_J~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da5ffdef1d188dd8e27f3aef12a7b16857aab111;p=thirdparty%2Fntp.git ChangeLog, configure, configure.in, ntp_crypto.c, ntp_proto.c: * configure.in: 4.0.99i9 * ntpd/ntp_crypto.c: tstamp and autokey cleanup From: Dave Mills * ntpd/ntp_proto.c (clock_update): Only call expire_all() if AUTOKEY From many folks, including Reg Clemens bk: 3919ee823auVgbbwZl-0i3mze9Btzg --- diff --git a/ChangeLog b/ChangeLog index f1ed56655..09565c72b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ +2000-05-10 Harlan Stenn + + * configure.in: 4.0.99i9 + + * ntpd/ntp_crypto.c: tstamp and autokey cleanup + From: Dave Mills + + * ntpd/ntp_proto.c (clock_update): Only call expire_all() if + AUTOKEY + From many folks, including Reg Clemens + 2000-05-07 Harlan Stenn + * configure.in: 4.0.99i8 + * flock-build: Use new --with-crypto choices * build (KEYSUF): Deal with new --with-crypto * configure.in: --with-crypto={md5,autokey,rsaref}; diff --git a/configure b/configure index de95c2967..9988a48ae 100755 --- a/configure +++ b/configure @@ -1089,7 +1089,7 @@ fi PACKAGE=ntp -VERSION=4.0.99i7 +VERSION=4.0.99i9 if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then diff --git a/configure.in b/configure.in index e129be52c..ac6c0a3a7 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_CANONICAL_SYSTEM AC_DEFINE_UNQUOTED(STR_SYSTEM, "$target") AM_CONFIG_HEADER(config.h) AC_ARG_PROGRAM -AM_INIT_AUTOMAKE(ntp, 4.0.99i7) +AM_INIT_AUTOMAKE(ntp, 4.0.99i9) AC_PREREQ(2.14) ac_cv_var_oncore_ok=no diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 9ae95635f..039310e9b 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -327,7 +327,8 @@ crypto_recv( temp = public_key.bits / 8; if (!crypto_enable) { rval = 0; - } else if (tstamp < peer->recauto.tstamp) { + } else if (tstamp == 0 || tstamp < + peer->recauto.tstamp) { break; } else if (peer->pubkey == NULL || temp != ntohl(ap->siglen)) { @@ -350,8 +351,7 @@ crypto_recv( peer->flags &= ~FLAG_AUTOKEY; break; } - if (tstamp > 0) - peer->flags |= FLAG_AUTOKEY; + peer->flags |= FLAG_AUTOKEY; #endif /* PUBKEY */ peer->flash &= ~TEST10; peer->recauto.tstamp = tstamp; @@ -372,7 +372,8 @@ crypto_recv( temp = public_key.bits / 8; if (!crypto_enable) { rval = 0; - } else if (tstamp < peer->pcookie.tstamp) { + } else if (tstamp == 0 || tstamp < + peer->pcookie.tstamp) { break; } else if (peer->pubkey == NULL || temp != ntohl(cp->siglen)) { @@ -395,7 +396,7 @@ crypto_recv( peer->flags &= ~FLAG_AUTOKEY; break; } - if (!(peer->flags & FLAG_MCAST2) && tstamp > 0) + if (!(peer->flags & FLAG_MCAST2)) peer->flags |= FLAG_AUTOKEY; #else temp = ntohl(cp->key); @@ -422,7 +423,8 @@ crypto_recv( case CRYPTO_DH | CRYPTO_RESP: temp = ntohl(pkt[i + 3]); j = i + 4 + temp / 4; - if (tstamp < peer->pcookie.tstamp) { + if (tstamp == 0 || tstamp < + peer->pcookie.tstamp) { break; } else if (peer->pubkey == NULL || ntohl(pkt[j]) != public_key.bits / 8) { @@ -479,7 +481,8 @@ crypto_recv( case CRYPTO_NAME | CRYPTO_RESP: temp = ntohl(pkt[i + 3]); j = i + 4 + temp / 4; - if (tstamp < peer->pcookie.tstamp) { + if (tstamp == 0 || tstamp < + peer->pcookie.tstamp) { break; } else if (ntohl(pkt[j]) != public_key.bits / 8) { diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 763f2c189..72f79bc4c 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -401,15 +401,9 @@ receive( &rbufp->recv_srcadr, &rbufp->dstadr->sin, 0, sys_private, 0); - } else if (hismode == MODE_CLIENT) { - pkeyid = peer->hcookie; } else { #ifdef PUBKEY - if (crypto_enable) - pkeyid = peer->pcookie.key; - else - pkeyid = peer->pcookie.key; - + pkeyid = peer->pcookie.key; #else if (hismode == MODE_SERVER) pkeyid = peer->pcookie.key; @@ -704,7 +698,7 @@ receive( * 4. Check to see that one or more hashes of the current key ID * matches the previous key ID or ultimate original key ID * obtained from the broadcaster or symmetric peer. If no - * match, arm for an autokey values update. + * match, sit the dance and wait for timeout. */ if (peer->flags & FLAG_SKEY) { peer->flash |= TEST10; @@ -1027,7 +1021,9 @@ clock_update(void) } if (oleap == LEAP_NOTINSYNC) { report_event(EVNT_SYNCCHG, (struct peer *)0); +#ifdef AUTOKEY expire_all(); +#endif } if (ostratum != sys_stratum) report_event(EVNT_PEERSTCHG, (struct peer *)0);