version 1.14, 2001/12/28 13:57:33 |
version 1.15, 2001/12/28 14:50:54 |
|
|
Key *server_host_key; |
Key *server_host_key; |
u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; |
u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; |
u_int klen, kout, slen, sbloblen; |
u_int klen, kout, slen, sbloblen; |
int plen, min, max, nbits; |
int min, max, nbits; |
DH *dh; |
DH *dh; |
|
|
nbits = dh_estimate(kex->we_need * 8); |
nbits = dh_estimate(kex->we_need * 8); |
|
|
packet_send(); |
packet_send(); |
|
|
debug("expecting SSH2_MSG_KEX_DH_GEX_GROUP"); |
debug("expecting SSH2_MSG_KEX_DH_GEX_GROUP"); |
packet_read_expect(&plen, SSH2_MSG_KEX_DH_GEX_GROUP); |
packet_read_expect(SSH2_MSG_KEX_DH_GEX_GROUP); |
|
|
if ((p = BN_new()) == NULL) |
if ((p = BN_new()) == NULL) |
fatal("BN_new"); |
fatal("BN_new"); |
|
|
packet_send(); |
packet_send(); |
|
|
debug("expecting SSH2_MSG_KEX_DH_GEX_REPLY"); |
debug("expecting SSH2_MSG_KEX_DH_GEX_REPLY"); |
packet_read_expect(&plen, SSH2_MSG_KEX_DH_GEX_REPLY); |
packet_read_expect(SSH2_MSG_KEX_DH_GEX_REPLY); |
|
|
/* key, cert */ |
/* key, cert */ |
server_host_key_blob = packet_get_string(&sbloblen); |
server_host_key_blob = packet_get_string(&sbloblen); |
|
|
DH *dh = dh; |
DH *dh = dh; |
u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; |
u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; |
u_int sbloblen, klen, kout; |
u_int sbloblen, klen, kout; |
int min = -1, max = -1, nbits = -1, type, plen, slen; |
int min = -1, max = -1, nbits = -1, type, slen; |
|
|
if (kex->load_host_key == NULL) |
if (kex->load_host_key == NULL) |
fatal("Cannot load hostkey"); |
fatal("Cannot load hostkey"); |
|
|
if (server_host_key == NULL) |
if (server_host_key == NULL) |
fatal("Unsupported hostkey type %d", kex->hostkey_type); |
fatal("Unsupported hostkey type %d", kex->hostkey_type); |
|
|
type = packet_read(&plen); |
type = packet_read(); |
switch (type) { |
switch (type) { |
case SSH2_MSG_KEX_DH_GEX_REQUEST: |
case SSH2_MSG_KEX_DH_GEX_REQUEST: |
debug("SSH2_MSG_KEX_DH_GEX_REQUEST received"); |
debug("SSH2_MSG_KEX_DH_GEX_REQUEST received"); |
|
|
dh_gen_key(dh, kex->we_need * 8); |
dh_gen_key(dh, kex->we_need * 8); |
|
|
debug("expecting SSH2_MSG_KEX_DH_GEX_INIT"); |
debug("expecting SSH2_MSG_KEX_DH_GEX_INIT"); |
packet_read_expect(&plen, SSH2_MSG_KEX_DH_GEX_INIT); |
packet_read_expect(SSH2_MSG_KEX_DH_GEX_INIT); |
|
|
/* key, cert */ |
/* key, cert */ |
if ((dh_client_pub = BN_new()) == NULL) |
if ((dh_client_pub = BN_new()) == NULL) |