summaryrefslogtreecommitdiffhomepage
path: root/common-kex.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-05-23 22:18:16 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-05-23 22:18:16 +0800
commitd9e790e7dc7737158c9affb7087035dd2c31c003 (patch)
tree0e610eace4bd5b3f25812e30b85b0c22063c28ef /common-kex.c
parent51b5cdd4308f4236d4d1453d482d0086d11a851e (diff)
Add m_mp_alloc_init_multi() helper
--HG-- branch : ecc
Diffstat (limited to 'common-kex.c')
-rw-r--r--common-kex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common-kex.c b/common-kex.c
index 0cd3db3..a32ca6d 100644
--- a/common-kex.c
+++ b/common-kex.c
@@ -633,8 +633,7 @@ void kexdh_comb_key(struct kex_dh_param *param, mp_int *dh_pub_them,
}
/* K = e^y mod p = f^x mod p */
- ses.dh_K = (mp_int*)m_malloc(sizeof(mp_int));
- m_mp_init(ses.dh_K);
+ m_mp_alloc_init_multi(&ses.dh_K, NULL);
if (mp_exptmod(dh_pub_them, &param->priv, &dh_p, ses.dh_K) != MP_OKAY) {
dropbear_exit("Diffie-Hellman error");
}