diff options
author | Darren Tucker <dtucker@zip.com.au> | 2008-06-13 04:47:34 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2008-06-13 04:47:34 +1000 |
commit | 78913e0059a7f5ff1770488cdf49823e290daa45 (patch) | |
tree | e0c772b76dba6a1a0afd1afec590f1629b0e306f | |
parent | 30ac73bcc2b2fa7b997cb572e5b03ea9107b7641 (diff) |
- grunk@cvs.openbsd.org 2008/06/12 00:13:55
[sshconnect.c]
Make ssh print the random art also when ssh'ing to a host using IP only.
spotted by naddy@, ok and help djm@ dtucker@
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | sshconnect.c | 12 |
2 files changed, 28 insertions, 3 deletions
@@ -47,6 +47,23 @@ | |||
47 | will cause trouble in some cases. | 47 | will cause trouble in some cases. |
48 | Also do a computation of -1 once, and not in a loop several times. | 48 | Also do a computation of -1 once, and not in a loop several times. |
49 | spotted by otto@ | 49 | spotted by otto@ |
50 | - dtucker@cvs.openbsd.org 2008/06/12 00:03:49 | ||
51 | [dns.c canohost.c sshconnect.c] | ||
52 | Do not pass "0" strings as ports to getaddrinfo because the lookups | ||
53 | can slow things down and we never use the service info anyway. bz | ||
54 | #859, patch from YOSHIFUJI Hideaki and John Devitofranceschi. ok | ||
55 | deraadt@ djm@ | ||
56 | djm belives that the reason for the "0" strings is to ensure that | ||
57 | it's not possible to call getaddrinfo with both host and port being | ||
58 | NULL. In the case of canohost.c host is a local array. In the | ||
59 | case of sshconnect.c, it's checked for null immediately before use. | ||
60 | In dns.c it ultimately comes from ssh.c:main() and is guaranteed to | ||
61 | be non-null but it's not obvious, so I added a warning message in | ||
62 | case it is ever passed a null. | ||
63 | - grunk@cvs.openbsd.org 2008/06/12 00:13:55 | ||
64 | [sshconnect.c] | ||
65 | Make ssh print the random art also when ssh'ing to a host using IP only. | ||
66 | spotted by naddy@, ok and help djm@ dtucker@ | ||
50 | 67 | ||
51 | 20080611 | 68 | 20080611 |
52 | - (djm) [channels.c configure.ac] | 69 | - (djm) [channels.c configure.ac] |
@@ -4209,4 +4226,4 @@ | |||
4209 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 4226 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
4210 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 4227 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
4211 | 4228 | ||
4212 | $Id: ChangeLog,v 1.4974 2008/06/12 18:45:50 dtucker Exp $ | 4229 | $Id: ChangeLog,v 1.4975 2008/06/12 18:47:34 dtucker Exp $ |
diff --git a/sshconnect.c b/sshconnect.c index 0a4bf36b6..7602da340 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect.c,v 1.205 2008/06/12 00:03:49 dtucker Exp $ */ | 1 | /* $OpenBSD: sshconnect.c,v 1.206 2008/06/12 00:13:55 grunk Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -611,6 +611,7 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port, | |||
611 | char msg[1024]; | 611 | char msg[1024]; |
612 | int len, host_line, ip_line; | 612 | int len, host_line, ip_line; |
613 | const char *host_file = NULL, *ip_file = NULL; | 613 | const char *host_file = NULL, *ip_file = NULL; |
614 | int display_randomart; | ||
614 | 615 | ||
615 | /* | 616 | /* |
616 | * Force accepting of the host key for loopback/localhost. The | 617 | * Force accepting of the host key for loopback/localhost. The |
@@ -656,6 +657,13 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port, | |||
656 | } else { | 657 | } else { |
657 | ip = xstrdup("<no hostip for proxy command>"); | 658 | ip = xstrdup("<no hostip for proxy command>"); |
658 | } | 659 | } |
660 | |||
661 | /* | ||
662 | * check_host_ip may be set to zero in the next step, so if it | ||
663 | * conveys a request to display the random art, save it away. | ||
664 | */ | ||
665 | display_randomart = (options.check_host_ip == SSHCTL_CHECKHOSTIP_FPR); | ||
666 | |||
659 | /* | 667 | /* |
660 | * Turn off check_host_ip if the connection is to localhost, via proxy | 668 | * Turn off check_host_ip if the connection is to localhost, via proxy |
661 | * command or if we don't have a hostname to compare with | 669 | * command or if we don't have a hostname to compare with |
@@ -740,7 +748,7 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port, | |||
740 | logit("Warning: Permanently added the %s host " | 748 | logit("Warning: Permanently added the %s host " |
741 | "key for IP address '%.128s' to the list " | 749 | "key for IP address '%.128s' to the list " |
742 | "of known hosts.", type, ip); | 750 | "of known hosts.", type, ip); |
743 | } else if (options.check_host_ip == SSHCTL_CHECKHOSTIP_FPR) { | 751 | } else if (display_randomart) { |
744 | fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); | 752 | fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); |
745 | ra = key_fingerprint(host_key, SSH_FP_MD5, | 753 | ra = key_fingerprint(host_key, SSH_FP_MD5, |
746 | SSH_FP_RANDOMART); | 754 | SSH_FP_RANDOMART); |