diff options
Diffstat (limited to 'sshconnect.c')
-rw-r--r-- | sshconnect.c | 12 |
1 files changed, 10 insertions, 2 deletions
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); |