version 1.1.1.15, 2018/08/26 07:41:11 |
version 1.1.1.16, 2019/04/20 17:13:53 |
|
|
/* $OpenBSD: ssh-keyscan.c,v 1.120 2018/06/06 18:29:18 markus Exp $ */ |
/* $OpenBSD: ssh-keyscan.c,v 1.126 2019/01/26 22:35:01 djm Exp $ */ |
/* |
/* |
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. |
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. |
* |
* |
Line 64 int hash_hosts = 0; /* Hash hostname on |
|
Line 64 int hash_hosts = 0; /* Hash hostname on |
|
|
|
int print_sshfp = 0; /* Print SSHFP records instead of known_hosts */ |
int print_sshfp = 0; /* Print SSHFP records instead of known_hosts */ |
|
|
|
int found_one = 0; /* Successfully found a key */ |
|
|
#define MAXMAXFD 256 |
#define MAXMAXFD 256 |
|
|
/* The number of seconds after which to give up on a TCP connection */ |
/* The number of seconds after which to give up on a TCP connection */ |
Line 244 keygrab_ssh2(con *c) |
|
Line 246 keygrab_ssh2(con *c) |
|
exit(1); |
exit(1); |
} |
} |
#ifdef WITH_OPENSSL |
#ifdef WITH_OPENSSL |
c->c_ssh->kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client; |
c->c_ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client; |
c->c_ssh->kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client; |
c->c_ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client; |
c->c_ssh->kex->kex[KEX_DH_GRP14_SHA256] = kexdh_client; |
c->c_ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client; |
c->c_ssh->kex->kex[KEX_DH_GRP16_SHA512] = kexdh_client; |
c->c_ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_client; |
c->c_ssh->kex->kex[KEX_DH_GRP18_SHA512] = kexdh_client; |
c->c_ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_client; |
c->c_ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; |
c->c_ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; |
c->c_ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; |
c->c_ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; |
c->c_ssh->kex->kex[KEX_ECDH_SHA2] = kexecdh_client; |
c->c_ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_client; |
#endif |
#endif |
c->c_ssh->kex->kex[KEX_C25519_SHA256] = kexc25519_client; |
c->c_ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_client; |
|
c->c_ssh->kex->kex[KEX_KEM_SNTRUP4591761X25519_SHA512] = kex_gen_client; |
ssh_set_verify_host_key_callback(c->c_ssh, key_print_wrapper); |
ssh_set_verify_host_key_callback(c->c_ssh, key_print_wrapper); |
/* |
/* |
* do the key-exchange until an error occurs or until |
* do the key-exchange until an error occurs or until |
Line 268 keyprint_one(const char *host, struct ss |
|
Line 271 keyprint_one(const char *host, struct ss |
|
char *hostport; |
char *hostport; |
const char *known_host, *hashed; |
const char *known_host, *hashed; |
|
|
|
found_one = 1; |
|
|
if (print_sshfp) { |
if (print_sshfp) { |
export_dns_rr(host, key, stdout, 0); |
export_dns_rr(host, key, stdout, 0); |
return; |
return; |
Line 781 main(int argc, char **argv) |
|
Line 786 main(int argc, char **argv) |
|
while (ncon > 0) |
while (ncon > 0) |
conloop(); |
conloop(); |
|
|
return (0); |
return found_one ? 0 : 1; |
} |
} |