summaryrefslogtreecommitdiffhomepage
path: root/cli-kex.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli-kex.c')
-rw-r--r--cli-kex.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli-kex.c b/cli-kex.c
index 8090756..d6ebaf9 100644
--- a/cli-kex.c
+++ b/cli-kex.c
@@ -96,12 +96,15 @@ void recv_msg_kexdh_reply() {
kexdh_comb_key(cli_ses.dh_param, &dh_f, hostkey);
mp_clear(&dh_f);
- free_kexdh_param(cli_ses.dh_param);
- cli_ses.dh_param = NULL;
} else {
#ifdef DROPBEAR_ECDH
+ buffer *ecdh_qs = buf_getstringbuf(ses.payload);
+ kexecdh_comb_key(cli_ses.dh_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)
!= DROPBEAR_SUCCESS) {