diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-05-23 22:18:16 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-05-23 22:18:16 +0800 |
commit | 3e02e807552eb48e2eb22fc0dc51af072a54717f (patch) | |
tree | 41d538ddf2314fb8ee2bb1295fcf9cdda50bfded /dss.c | |
parent | 215d321736ffc1f3782d2d006bf05768e05d4ef2 (diff) | |
download | dropbear-3e02e807552eb48e2eb22fc0dc51af072a54717f.tar.gz |
Add m_mp_alloc_init_multi() helper
Diffstat (limited to 'dss.c')
-rw-r--r-- | dss.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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); |