version 1.218, 2015/01/19 20:07:45 |
version 1.219, 2015/01/19 20:16:15 |
|
|
struct sockaddr *xxx_hostaddr; |
struct sockaddr *xxx_hostaddr; |
|
|
static int |
static int |
verify_host_key_callback(Key *hostkey) |
verify_host_key_callback(Key *hostkey, struct ssh *ssh) |
{ |
{ |
if (verify_host_key(xxx_host, xxx_hostaddr, hostkey) == -1) |
if (verify_host_key(xxx_host, xxx_hostaddr, hostkey) == -1) |
fatal("Host key verification failed."); |
fatal("Host key verification failed."); |
|
|
ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) |
ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) |
{ |
{ |
char *myproposal[PROPOSAL_MAX] = { KEX_CLIENT }; |
char *myproposal[PROPOSAL_MAX] = { KEX_CLIENT }; |
Kex *kex; |
struct kex *kex; |
|
|
xxx_host = host; |
xxx_host = host; |
xxx_hostaddr = hostaddr; |
xxx_hostaddr = hostaddr; |
|
|
(time_t)options.rekey_interval); |
(time_t)options.rekey_interval); |
|
|
/* start key exchange */ |
/* start key exchange */ |
kex = kex_setup(myproposal); |
kex_setup(active_state, myproposal); |
active_state->kex = kex; |
kex = active_state->kex; |
#ifdef WITH_OPENSSL |
#ifdef WITH_OPENSSL |
kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client; |
kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client; |
kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client; |
kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client; |
|
|
kex->server_version_string=server_version_string; |
kex->server_version_string=server_version_string; |
kex->verify_host_key=&verify_host_key_callback; |
kex->verify_host_key=&verify_host_key_callback; |
|
|
dispatch_run(DISPATCH_BLOCK, &kex->done, kex); |
dispatch_run(DISPATCH_BLOCK, &kex->done, active_state); |
|
|
if (options.use_roaming && !kex->roaming) { |
if (options.use_roaming && !kex->roaming) { |
debug("Roaming not allowed by server"); |
debug("Roaming not allowed by server"); |