diff cli-kex.c @ 759:76fba0856749 ecc

More changes for KEX and ECDH. Set up hash descriptors, make ECC code work, ses.hash and ses.session_id are now buffers (doesn't compile)
author Matt Johnston <matt@ucc.asn.au>
date Fri, 29 Mar 2013 00:28:09 +0800
parents bf9dc2d9c2b1
children ac2158e3e403
line wrap: on
line diff
--- a/cli-kex.c	Fri Mar 29 00:26:46 2013 +0800
+++ b/cli-kex.c	Fri Mar 29 00:28:09 2013 +0800
@@ -96,12 +96,15 @@
 
 		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) {