|
Lines 71-76
extern uid_t original_effective_uid;
Link Here
|
| 71 |
|
71 |
|
| 72 |
static int show_other_keys(struct hostkeys *, struct sshkey *); |
72 |
static int show_other_keys(struct hostkeys *, struct sshkey *); |
| 73 |
static void warn_changed_key(struct sshkey *); |
73 |
static void warn_changed_key(struct sshkey *); |
|
|
74 |
static void warn_missing_key(struct sshkey *); |
| 74 |
|
75 |
|
| 75 |
/* Expand a proxy command */ |
76 |
/* Expand a proxy command */ |
| 76 |
static char * |
77 |
static char * |
|
Lines 836-841
check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
Link Here
|
| 836 |
free(ra); |
837 |
free(ra); |
| 837 |
free(fp); |
838 |
free(fp); |
| 838 |
} |
839 |
} |
|
|
840 |
if (options.verify_host_key_dns && |
| 841 |
options.strict_host_key_checking && |
| 842 |
!matching_host_key_dns) { |
| 843 |
snprintf(msg, sizeof(msg), |
| 844 |
"Are you sure you want to continue connecting " |
| 845 |
"(yes/no)? "); |
| 846 |
if (!confirm(msg)) |
| 847 |
goto fail; |
| 848 |
msg[0] = '\0'; |
| 849 |
} |
| 839 |
hostkey_trusted = 1; |
850 |
hostkey_trusted = 1; |
| 840 |
break; |
851 |
break; |
| 841 |
case HOST_NEW: |
852 |
case HOST_NEW: |
|
Lines 1231-1240
verify_host_key(char *host, struct sockaddr *hostaddr, struct sshkey *host_key)
Link Here
|
| 1231 |
if (flags & DNS_VERIFY_MATCH) { |
1242 |
if (flags & DNS_VERIFY_MATCH) { |
| 1232 |
matching_host_key_dns = 1; |
1243 |
matching_host_key_dns = 1; |
| 1233 |
} else { |
1244 |
} else { |
| 1234 |
warn_changed_key(plain); |
1245 |
if (flags & DNS_VERIFY_MISSING) { |
| 1235 |
error("Update the SSHFP RR in DNS " |
1246 |
warn_missing_key(plain); |
| 1236 |
"with the new host key to get rid " |
1247 |
error("Add this host key to " |
| 1237 |
"of this message."); |
1248 |
"the SSHFP RR in DNS to get rid " |
|
|
1249 |
"of this message."); |
| 1250 |
} else { |
| 1251 |
warn_changed_key(plain); |
| 1252 |
error("Update the SSHFP RR in DNS " |
| 1253 |
"with the new host key to get rid " |
| 1254 |
"of this message."); |
| 1255 |
} |
| 1238 |
} |
1256 |
} |
| 1239 |
} |
1257 |
} |
| 1240 |
} |
1258 |
} |
|
Lines 1366-1377
warn_changed_key(struct sshkey *host_key)
Link Here
|
| 1366 |
error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); |
1384 |
error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); |
| 1367 |
error("It is also possible that a host key has just been changed."); |
1385 |
error("It is also possible that a host key has just been changed."); |
| 1368 |
error("The fingerprint for the %s key sent by the remote host is\n%s.", |
1386 |
error("The fingerprint for the %s key sent by the remote host is\n%s.", |
| 1369 |
key_type(host_key), fp); |
1387 |
sshkey_type(host_key), fp); |
| 1370 |
error("Please contact your system administrator."); |
1388 |
error("Please contact your system administrator."); |
| 1371 |
|
1389 |
|
| 1372 |
free(fp); |
1390 |
free(fp); |
| 1373 |
} |
1391 |
} |
| 1374 |
|
1392 |
|
|
|
1393 |
static void |
| 1394 |
warn_missing_key(struct sshkey *host_key) |
| 1395 |
{ |
| 1396 |
char *fp; |
| 1397 |
|
| 1398 |
fp = sshkey_fingerprint(host_key, options.fingerprint_hash, |
| 1399 |
SSH_FP_DEFAULT); |
| 1400 |
if (fp == NULL) |
| 1401 |
fatal("%s: sshkey_fingerprint fail", __func__); |
| 1402 |
|
| 1403 |
error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); |
| 1404 |
error("@ WARNING: REMOTE HOST IDENTIFICATION IS MISSING @"); |
| 1405 |
error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); |
| 1406 |
error("The fingerprint for the %s key sent by the remote host is\n%s.", |
| 1407 |
sshkey_type(host_key), fp); |
| 1408 |
error("Please contact your system administrator."); |
| 1409 |
|
| 1410 |
free(fp); |
| 1411 |
} |
| 1375 |
/* |
1412 |
/* |
| 1376 |
* Execute a local command |
1413 |
* Execute a local command |
| 1377 |
*/ |
1414 |
*/ |