From 3e02e807552eb48e2eb22fc0dc51af072a54717f Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 23 May 2013 22:18:16 +0800 Subject: Add m_mp_alloc_init_multi() helper --- dss.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'dss.c') diff --git a/dss.c b/dss.c index 9817392..b3b2bb1 100644 --- a/dss.c +++ b/dss.c @@ -47,11 +47,7 @@ int buf_get_dss_pub_key(buffer* buf, dropbear_dss_key *key) { TRACE(("enter buf_get_dss_pub_key")) dropbear_assert(key != NULL); - key->p = m_malloc(sizeof(mp_int)); - key->q = m_malloc(sizeof(mp_int)); - key->g = m_malloc(sizeof(mp_int)); - key->y = m_malloc(sizeof(mp_int)); - m_mp_init_multi(key->p, key->q, key->g, key->y, NULL); + m_mp_alloc_init_multi(&key->p, &key->q, &key->g, &key->y, NULL); key->x = NULL; buf_incrpos(buf, 4+SSH_SIGNKEY_DSS_LEN); /* int + "ssh-dss" */ @@ -87,8 +83,7 @@ int buf_get_dss_priv_key(buffer* buf, dropbear_dss_key *key) { return DROPBEAR_FAILURE; } - key->x = m_malloc(sizeof(mp_int)); - m_mp_init(key->x); + m_mp_alloc_init_multi(&key->x, NULL); ret = buf_getmpint(buf, key->x); if (ret == DROPBEAR_FAILURE) { m_free(key->x); -- cgit v1.2.1