From: Harlan Stenn Date: Wed, 27 Apr 2005 09:53:39 +0000 (-0400) Subject: [Bug 401] ntpdc: only ask for keyid once, from Jason Fountain X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc040c053bf8defd36b81def82636e5dc2afe701;p=thirdparty%2Fntp.git [Bug 401] ntpdc: only ask for keyid once, from Jason Fountain bk: 426f6123oenVGJZeylx1paX_KJGIwg --- diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index 3168596ea9..b037a85818 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -873,13 +873,17 @@ sendrequest( + MAX_MAC_LEN - sizeof(struct req_pkt_tail)); if (info_auth_keyid == 0) { - maclen = getkeyid("Keyid: "); - if (maclen == 0) { - (void) fprintf(stderr, - "Invalid key identifier\n"); - return 1; + if (((struct conf_peer *)qpkt.data)->keyid > 0) + info_auth_keyid = ((struct conf_peer *)qpkt.data)->keyid; + else { + maclen = getkeyid("Keyid: "); + if (maclen == 0) { + (void) fprintf(stderr, + "Invalid key identifier\n"); + return 1; + } + info_auth_keyid = maclen; } - info_auth_keyid = maclen; } if (!authistrusted(info_auth_keyid)) { pass = getpass("MD5 Password: ");