diff common-kex.c @ 805:724c3e0c8734 ecc

Add m_mp_alloc_init_multi() helper
author Matt Johnston <matt@ucc.asn.au>
date Thu, 23 May 2013 22:18:16 +0800
parents 7dcb46da72d9
children 6c69e7df3621
line wrap: on
line diff
--- a/common-kex.c	Tue May 21 13:44:48 2013 +0800
+++ b/common-kex.c	Thu May 23 22:18:16 2013 +0800
@@ -633,8 +633,7 @@
 	}
 	
 	/* 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");
 	}