From: Harlan Stenn Date: Tue, 21 Mar 2000 03:38:20 +0000 (-0000) Subject: ntp_config.c, ntp_peer.c, ntpq_ops.c: X-Git-Tag: NTP_4_0_99_J~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96c5ccd761d820d8c8e87fdaa0f63969ea846544;p=thirdparty%2Fntp.git ntp_config.c, ntp_peer.c, ntpq_ops.c: Dave did some cleanup and fixes. bk: 38d6eeacDWmRJNCGPfdcyK783d-i-g --- diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 88581d5951..5965b91aed 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -1308,27 +1308,39 @@ getconfig( case CONFIG_CRYPTO: crypto_enable = 1; - for (i = 2; i < ntokens; i++) { - switch (matchkey(tokens[i], - crypto_keywords)) { + for (i = 1; i < ntokens; i++) { + int temp; + temp = matchkey(tokens[i++], crypto_keywords); + if (i > ntokens - 1) { + msyslog(LOG_ERR, + "crypto: missing file name"); + errflg++; + break; + } + switch(temp) { case CONF_CRYPTO_FLAGS: crypto_config(CRYPTO_CONF_FLAGS, - tokens[i++]); + tokens[i]); + break; case CONF_CRYPTO_DH: crypto_config(CRYPTO_CONF_DH, - tokens[i++]); + tokens[i]); break; case CONF_CRYPTO_PRIVATEKEY: crypto_config(CRYPTO_CONF_PRIV, - tokens[i++]); + tokens[i]); break; case CONF_CRYPTO_PUBLICKEY: crypto_config(CRYPTO_CONF_PUBL, - tokens[i++]); + tokens[i]); + break; + default: + msyslog(LOG_ERR, + "crypto: unknown keyword"); break; } } diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index 470a107f33..d614d8e488 100644 --- a/ntpd/ntp_peer.c +++ b/ntpd/ntp_peer.c @@ -547,7 +547,7 @@ peer_config( peer->keyid); #endif #ifdef PUBKEY - if (!(peer->flags & FLAG_SKEY)) + if (!(peer->flags & FLAG_SKEY) || peer->hmode == MODE_BROADCAST) return (peer); crypto_public(peer, keystr); #endif /* PUBKEY */ diff --git a/ntpq/ntpq_ops.c b/ntpq/ntpq_ops.c index 8827a84364..8a8a961d80 100644 --- a/ntpq/ntpq_ops.c +++ b/ntpq/ntpq_ops.c @@ -940,7 +940,7 @@ printassoc( conf = "yes"; else conf = "no"; - if (statval & CTL_PST_REACH) { + if (statval & CTL_PST_REACH || 1) { reach = "yes"; if (statval & CTL_PST_AUTHENABLE) { if (statval & CTL_PST_AUTHENTIC)