comparison 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
comparison
equal deleted inserted replaced
758:1c607a62d235 759:76fba0856749
94 dropbear_exit("Bad KEX packet"); 94 dropbear_exit("Bad KEX packet");
95 } 95 }
96 96
97 kexdh_comb_key(cli_ses.dh_param, &dh_f, hostkey); 97 kexdh_comb_key(cli_ses.dh_param, &dh_f, hostkey);
98 mp_clear(&dh_f); 98 mp_clear(&dh_f);
99 free_kexdh_param(cli_ses.dh_param);
100 cli_ses.dh_param = NULL;
101 } else { 99 } else {
102 #ifdef DROPBEAR_ECDH 100 #ifdef DROPBEAR_ECDH
101 buffer *ecdh_qs = buf_getstringbuf(ses.payload);
102 kexecdh_comb_key(cli_ses.dh_param, ecdh_qs, hostkey);
103 buf_free(ecdh_qs);
103 #endif 104 #endif
104 } 105 }
106 free_kexdh_param(cli_ses.dh_param);
107 cli_ses.dh_param = NULL;
105 108
106 if (buf_verify(ses.payload, hostkey, ses.hash, SHA1_HASH_SIZE) 109 if (buf_verify(ses.payload, hostkey, ses.hash, SHA1_HASH_SIZE)
107 != DROPBEAR_SUCCESS) { 110 != DROPBEAR_SUCCESS) {
108 dropbear_exit("Bad hostkey signature"); 111 dropbear_exit("Bad hostkey signature");
109 } 112 }