diff options
author | Niels Provos <provos@cvs.openbsd.org> | 2000-11-29 13:51:28 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 2000-11-29 13:51:28 +0000 |
commit | 0e9a90edeacebf49de28c9f14cdb08f4b9369f87 (patch) | |
tree | 65e61c154cf76be07a94637f4827769d8c49e76a | |
parent | 195a3f927e8a574b0246d47c32a0da1ca27461be (diff) |
show IP address and hostname when new key is encountered. okay markus@
-rw-r--r-- | usr.bin/ssh/sshconnect.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c index 6248e1c5a0c..dfc55331abf 100644 --- a/usr.bin/ssh/sshconnect.c +++ b/usr.bin/ssh/sshconnect.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.81 2000/11/06 23:16:35 markus Exp $"); +RCSID("$OpenBSD: sshconnect.c,v 1.82 2000/11/29 13:51:27 provos Exp $"); #include <openssl/bn.h> #include <openssl/dsa.h> @@ -500,12 +500,10 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key, if (options.proxy_command != NULL && options.check_host_ip) options.check_host_ip = 0; - if (options.check_host_ip) { - if (getnameinfo(hostaddr, hostaddr->sa_len, ntop, sizeof(ntop), - NULL, 0, NI_NUMERICHOST) != 0) - fatal("check_host_key: getnameinfo failed"); - ip = xstrdup(ntop); - } + if (getnameinfo(hostaddr, hostaddr->sa_len, ntop, sizeof(ntop), + NULL, 0, NI_NUMERICHOST) != 0) + fatal("check_host_key: getnameinfo failed"); + ip = xstrdup(ntop); /* * Store the host key from the known host file in here so that we can @@ -569,10 +567,10 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key, char prompt[1024]; char *fp = key_fingerprint(host_key); snprintf(prompt, sizeof(prompt), - "The authenticity of host '%.200s' can't be established.\n" + "The authenticity of host '%.200s (%s)' can't be established.\n" "%s key fingerprint is %s.\n" "Are you sure you want to continue connecting (yes/no)? ", - host, type, fp); + host, ip, type, fp); if (!read_yes_or_no(prompt, -1)) fatal("Aborted by user!\n"); } @@ -648,8 +646,8 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key, */ break; } - if (options.check_host_ip) - xfree(ip); + + xfree(ip); } /* |