comparison common-kex.c @ 1128:a9e074b78cd5

check ecc key return, fix null pointer crash
author Matt Johnston <matt@ucc.asn.au>
date Tue, 23 Jun 2015 21:48:13 +0800
parents 6aeadee3f16b
children 1b8afc698e39
comparison
equal deleted inserted replaced
1127:b803ad2b9f4c 1128:a9e074b78cd5
701 const struct dropbear_kex *algo_kex = ses.newkeys->algo_kex; 701 const struct dropbear_kex *algo_kex = ses.newkeys->algo_kex;
702 /* public keys from client and server */ 702 /* public keys from client and server */
703 ecc_key *Q_C, *Q_S, *Q_them; 703 ecc_key *Q_C, *Q_S, *Q_them;
704 704
705 Q_them = buf_get_ecc_raw_pubkey(pub_them, algo_kex->ecc_curve); 705 Q_them = buf_get_ecc_raw_pubkey(pub_them, algo_kex->ecc_curve);
706 if (Q_them == NULL) {
707 dropbear_exit("ECC error");
708 }
706 709
707 ses.dh_K = dropbear_ecc_shared_secret(Q_them, &param->key); 710 ses.dh_K = dropbear_ecc_shared_secret(Q_them, &param->key);
708 711
709 /* Create the remainder of the hash buffer, to generate the exchange hash 712 /* Create the remainder of the hash buffer, to generate the exchange hash
710 See RFC5656 section 4 page 7 */ 713 See RFC5656 section 4 page 7 */