version 1.208, 2008/06/12 23:24:58 |
version 1.209, 2008/06/26 11:46:31 |
|
|
char msg[1024]; |
char msg[1024]; |
int len, host_line, ip_line; |
int len, host_line, ip_line; |
const char *host_file = NULL, *ip_file = NULL; |
const char *host_file = NULL, *ip_file = NULL; |
int display_randomart; |
|
|
|
/* |
/* |
* Force accepting of the host key for loopback/localhost. The |
* Force accepting of the host key for loopback/localhost. The |
|
|
} |
} |
|
|
/* |
/* |
* check_host_ip may be set to zero in the next step, so if it |
|
* conveys a request to display the random art, save it away. |
|
*/ |
|
display_randomart = (options.check_host_ip == SSHCTL_CHECKHOSTIP_FPR); |
|
|
|
/* |
|
* Turn off check_host_ip if the connection is to localhost, via proxy |
* Turn off check_host_ip if the connection is to localhost, via proxy |
* command or if we don't have a hostname to compare with |
* command or if we don't have a hostname to compare with |
*/ |
*/ |
|
|
logit("Warning: Permanently added the %s host " |
logit("Warning: Permanently added the %s host " |
"key for IP address '%.128s' to the list " |
"key for IP address '%.128s' to the list " |
"of known hosts.", type, ip); |
"of known hosts.", type, ip); |
} else if (display_randomart) { |
} else if (options.visual_host_key) { |
fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); |
fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); |
ra = key_fingerprint(host_key, SSH_FP_MD5, |
ra = key_fingerprint(host_key, SSH_FP_MD5, |
SSH_FP_RANDOMART); |
SSH_FP_RANDOMART); |
|
|
snprintf(msg, sizeof(msg), |
snprintf(msg, sizeof(msg), |
"The authenticity of host '%.200s (%s)' can't be " |
"The authenticity of host '%.200s (%s)' can't be " |
"established%s\n" |
"established%s\n" |
"%s key fingerprint is %s.\n%s\n%s" |
"%s key fingerprint is %s.%s%s\n%s" |
"Are you sure you want to continue connecting " |
"Are you sure you want to continue connecting " |
"(yes/no)? ", |
"(yes/no)? ", |
host, ip, msg1, type, fp, ra, msg2); |
host, ip, msg1, type, fp, |
|
options.visual_host_key ? "\n" : "", |
|
options.visual_host_key ? ra : "", |
|
msg2); |
xfree(ra); |
xfree(ra); |
xfree(fp); |
xfree(fp); |
if (!confirm(msg)) |
if (!confirm(msg)) |