|
Lines 904-910
check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
Link Here
|
| 904 |
if (want_cert && !check_host_cert(hostname, host_key)) |
904 |
if (want_cert && !check_host_cert(hostname, host_key)) |
| 905 |
goto fail; |
905 |
goto fail; |
| 906 |
if (options.check_host_ip && ip_status == HOST_NEW) { |
906 |
if (options.check_host_ip && ip_status == HOST_NEW) { |
| 907 |
if (readonly || want_cert) |
907 |
if (readonly || want_cert || num_user_hostfiles == 0) |
| 908 |
logit("%s host key for IP address " |
908 |
logit("%s host key for IP address " |
| 909 |
"'%.128s' not in list of known hosts.", |
909 |
"'%.128s' not in list of known hosts.", |
| 910 |
type, ip); |
910 |
type, ip); |
|
Lines 1004-1009
check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
Link Here
|
| 1004 |
if (options.check_host_ip && ip_status == HOST_NEW) { |
1004 |
if (options.check_host_ip && ip_status == HOST_NEW) { |
| 1005 |
snprintf(hostline, sizeof(hostline), "%s,%s", host, ip); |
1005 |
snprintf(hostline, sizeof(hostline), "%s,%s", host, ip); |
| 1006 |
hostp = hostline; |
1006 |
hostp = hostline; |
|
|
1007 |
if (num_user_hostfiles == 0) |
| 1008 |
break; |
| 1007 |
if (options.hash_known_hosts) { |
1009 |
if (options.hash_known_hosts) { |
| 1008 |
/* Add hash of host and IP separately */ |
1010 |
/* Add hash of host and IP separately */ |
| 1009 |
r = add_host_to_hostfile(user_hostfiles[0], |
1011 |
r = add_host_to_hostfile(user_hostfiles[0], |
|
Lines 1017-1025
check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
Link Here
|
| 1017 |
options.hash_known_hosts); |
1019 |
options.hash_known_hosts); |
| 1018 |
} |
1020 |
} |
| 1019 |
} else { |
1021 |
} else { |
|
|
1022 |
hostp = host; |
| 1023 |
if (num_user_hostfiles == 0) |
| 1024 |
break; |
| 1020 |
r = add_host_to_hostfile(user_hostfiles[0], host, |
1025 |
r = add_host_to_hostfile(user_hostfiles[0], host, |
| 1021 |
host_key, options.hash_known_hosts); |
1026 |
host_key, options.hash_known_hosts); |
| 1022 |
hostp = host; |
|
|
| 1023 |
} |
1027 |
} |
| 1024 |
|
1028 |
|
| 1025 |
if (!r) |
1029 |
if (!r) |
|
Lines 1084-1089
check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
Link Here
|
| 1084 |
} |
1088 |
} |
| 1085 |
/* The host key has changed. */ |
1089 |
/* The host key has changed. */ |
| 1086 |
warn_changed_key(host_key); |
1090 |
warn_changed_key(host_key); |
|
|
1091 |
if (num_user_hostfiles == 0) |
| 1092 |
goto fail; |
| 1087 |
error("Add correct host key in %.100s to get rid of this message.", |
1093 |
error("Add correct host key in %.100s to get rid of this message.", |
| 1088 |
user_hostfiles[0]); |
1094 |
user_hostfiles[0]); |
| 1089 |
error("Offending %s key in %s:%lu", key_type(host_found->key), |
1095 |
error("Offending %s key in %s:%lu", key_type(host_found->key), |