version 1.3.2.1, 2006/09/30 04:06:50 |
version 1.3.2.2, 2006/11/08 00:17:14 |
|
|
Key *server_host_key; |
Key *server_host_key; |
u_char *server_host_key_blob = NULL, *signature = NULL; |
u_char *server_host_key_blob = NULL, *signature = NULL; |
u_char *kbuf, *hash; |
u_char *kbuf, *hash; |
u_int klen, kout, slen, sbloblen, hashlen; |
u_int klen, slen, sbloblen, hashlen; |
|
int kout; |
|
|
/* generate and send 'e', client DH public key */ |
/* generate and send 'e', client DH public key */ |
switch (kex->kex_type) { |
switch (kex->kex_type) { |
|
|
|
|
klen = DH_size(dh); |
klen = DH_size(dh); |
kbuf = xmalloc(klen); |
kbuf = xmalloc(klen); |
kout = DH_compute_key(kbuf, dh_server_pub, dh); |
if ((kout = DH_compute_key(kbuf, dh_server_pub, dh)) < 0) |
|
fatal("DH_compute_key: failed"); |
#ifdef DEBUG_KEXDH |
#ifdef DEBUG_KEXDH |
dump_digest("shared secret", kbuf, kout); |
dump_digest("shared secret", kbuf, kout); |
#endif |
#endif |
if ((shared_secret = BN_new()) == NULL) |
if ((shared_secret = BN_new()) == NULL) |
fatal("kexdh_client: BN_new failed"); |
fatal("kexdh_client: BN_new failed"); |
BN_bin2bn(kbuf, kout, shared_secret); |
if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) |
|
fatal("kexdh_client: BN_bin2bn failed"); |
memset(kbuf, 0, klen); |
memset(kbuf, 0, klen); |
xfree(kbuf); |
xfree(kbuf); |
|
|