comparison common-kex.c @ 757:230666086711 ecc

ecc key import function
author Matt Johnston <matt@ucc.asn.au>
date Wed, 27 Mar 2013 23:50:52 +0800
parents bf9dc2d9c2b1
children 76fba0856749
comparison
equal deleted inserted replaced
756:bf9dc2d9c2b1 757:230666086711
676 676
677 hash_state hs; 677 hash_state hs;
678 // public keys from client and server 678 // public keys from client and server
679 ecc_key *Q_C, *Q_S, *Q_them; 679 ecc_key *Q_C, *Q_S, *Q_them;
680 680
681 // XXX load Q_them 681 oj // XXX load Q_them
682 682 Q_them = buf_get_ecc_key_string()
683 ses.dh_K = dropbear_ecc_shared_secret() 683
684 684 ses.dh_K = dropbear_ecc_shared_secret();
685
685 /* Check that dh_pub_them (dh_e or dh_f) is in the range [1, p-1] */ 686 /* Check that dh_pub_them (dh_e or dh_f) is in the range [1, p-1] */
686 if (mp_cmp(dh_pub_them, &dh_p) != MP_LT 687 if (mp_cmp(dh_pub_them, &dh_p) != MP_LT
687 || mp_cmp_d(dh_pub_them, 0) != MP_GT) { 688 || mp_cmp_d(dh_pub_them, 0) != MP_GT) {
688 dropbear_exit("Diffie-Hellman error"); 689 dropbear_exit("Diffie-Hellman error");
689 } 690 }