check ecc key return, fix null pointer crash

This commit is contained in:
Matt Johnston 2015-06-23 21:48:13 +08:00
parent 2e05a2b8c4
commit 839e023ed8

View File

@ -703,6 +703,9 @@ void kexecdh_comb_key(struct kex_ecdh_param *param, buffer *pub_them,
ecc_key *Q_C, *Q_S, *Q_them;
Q_them = buf_get_ecc_raw_pubkey(pub_them, algo_kex->ecc_curve);
if (Q_them == NULL) {
dropbear_exit("ECC error");
}
ses.dh_K = dropbear_ecc_shared_secret(Q_them, &param->key);