summaryrefslogtreecommitdiffhomepage
path: root/cli-kex.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-04-07 01:36:42 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-04-07 01:36:42 +0800
commitc6bdc810abab5b58aba26a7618c49f3dac58ebd6 (patch)
tree2594798a88e46aff08f0b350925b4a77eb0a6341 /cli-kex.c
parenta8135dec1e8b9360274679c9ff89cb98cda87930 (diff)
ecc kind of works, needs fixing/testing
--HG-- branch : ecc
Diffstat (limited to 'cli-kex.c')
-rw-r--r--cli-kex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli-kex.c b/cli-kex.c
index d6ebaf9..23b7308 100644
--- a/cli-kex.c
+++ b/cli-kex.c
@@ -36,6 +36,7 @@
#include "random.h"
#include "runopts.h"
#include "signkey.h"
+#include "ecc.h"
static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen);
@@ -50,6 +51,7 @@ void send_msg_kexdh_init() {
} else {
#ifdef DROPBEAR_ECDH
cli_ses.ecdh_param = gen_kexecdh_param();
+ buf_put_ecc_pubkey_string(ses.writepayload, &cli_ses.ecdh_param->key);
#endif
}
encrypt_packet();
@@ -99,14 +101,14 @@ void recv_msg_kexdh_reply() {
} else {
#ifdef DROPBEAR_ECDH
buffer *ecdh_qs = buf_getstringbuf(ses.payload);
- kexecdh_comb_key(cli_ses.dh_param, ecdh_qs, hostkey);
+ kexecdh_comb_key(cli_ses.ecdh_param, ecdh_qs, hostkey);
buf_free(ecdh_qs);
#endif
}
free_kexdh_param(cli_ses.dh_param);
cli_ses.dh_param = NULL;
- if (buf_verify(ses.payload, hostkey, ses.hash, SHA1_HASH_SIZE)
+ if (buf_verify(ses.payload, hostkey, ses.hash)
!= DROPBEAR_SUCCESS) {
dropbear_exit("Bad hostkey signature");
}