|
Lines 301-316
keygrab_ssh2(con *c)
Link Here
|
| 301 |
} |
301 |
} |
| 302 |
|
302 |
|
| 303 |
static void |
303 |
static void |
| 304 |
keyprint_one(char *host, struct sshkey *key) |
304 |
keyprint_one(const char *host, struct sshkey *key) |
| 305 |
{ |
305 |
{ |
| 306 |
char *hostport; |
306 |
char *hostport; |
| 307 |
|
307 |
const char *known_host, *hashed; |
| 308 |
if (hash_hosts && (host = host_hash(host, NULL, 0)) == NULL) |
|
|
| 309 |
fatal("host_hash failed"); |
| 310 |
|
308 |
|
| 311 |
hostport = put_host_port(host, ssh_port); |
309 |
hostport = put_host_port(host, ssh_port); |
|
|
310 |
if (hash_hosts && (hashed = host_hash(host, NULL, 0)) == NULL) |
| 311 |
fatal("host_hash failed"); |
| 312 |
known_host = hash_hosts ? hashed : hostport; |
| 312 |
if (!get_cert) |
313 |
if (!get_cert) |
| 313 |
fprintf(stdout, "%s ", hostport); |
314 |
fprintf(stdout, "%s ", known_host); |
| 314 |
sshkey_write(key, stdout); |
315 |
sshkey_write(key, stdout); |
| 315 |
fputs("\n", stdout); |
316 |
fputs("\n", stdout); |
| 316 |
free(hostport); |
317 |
free(hostport); |