Mercurial > dropbear
diff rsa.c @ 1250:2bb4c662d1c2
more hard tab
author | Francois Perrad <francois.perrad@gadz.org> |
---|---|
date | Fri, 01 Jan 2016 15:02:09 +0100 |
parents | c6346c63281b |
children | 750ec4ec4cbe |
line wrap: on
line diff
--- a/rsa.c Thu Dec 31 15:59:01 2015 +0100 +++ b/rsa.c Fri Jan 01 15:02:09 2016 +0100 @@ -47,7 +47,7 @@ * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ int buf_get_rsa_pub_key(buffer* buf, dropbear_rsa_key *key) { - int ret = DROPBEAR_FAILURE; + int ret = DROPBEAR_FAILURE; TRACE(("enter buf_get_rsa_pub_key")) dropbear_assert(key != NULL); m_mp_alloc_init_multi(&key->e, &key->n, NULL); @@ -60,12 +60,12 @@ if (buf_getmpint(buf, key->e) == DROPBEAR_FAILURE || buf_getmpint(buf, key->n) == DROPBEAR_FAILURE) { TRACE(("leave buf_get_rsa_pub_key: failure")) - goto out; + goto out; } if (mp_count_bits(key->n) < MIN_RSA_KEYLEN) { dropbear_log(LOG_WARNING, "RSA key too short"); - goto out; + goto out; } TRACE(("leave buf_get_rsa_pub_key: success")) @@ -82,7 +82,7 @@ * Loads a private rsa key from a buffer * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ int buf_get_rsa_priv_key(buffer* buf, dropbear_rsa_key *key) { - int ret = DROPBEAR_FAILURE; + int ret = DROPBEAR_FAILURE; TRACE(("enter buf_get_rsa_priv_key")) dropbear_assert(key != NULL); @@ -99,34 +99,34 @@ m_mp_alloc_init_multi(&key->d, NULL); if (buf_getmpint(buf, key->d) == DROPBEAR_FAILURE) { TRACE(("leave buf_get_rsa_priv_key: d: ret == DROPBEAR_FAILURE")) - goto out; + goto out; } if (buf->pos == buf->len) { - /* old Dropbear private keys didn't keep p and q, so we will ignore them*/ + /* old Dropbear private keys didn't keep p and q, so we will ignore them*/ } else { m_mp_alloc_init_multi(&key->p, &key->q, NULL); if (buf_getmpint(buf, key->p) == DROPBEAR_FAILURE) { TRACE(("leave buf_get_rsa_priv_key: p: ret == DROPBEAR_FAILURE")) - goto out; + goto out; } if (buf_getmpint(buf, key->q) == DROPBEAR_FAILURE) { TRACE(("leave buf_get_rsa_priv_key: q: ret == DROPBEAR_FAILURE")) - goto out; + goto out; } } - ret = DROPBEAR_SUCCESS; + ret = DROPBEAR_SUCCESS; out: - if (ret == DROPBEAR_FAILURE) { - m_free(key->d); - m_free(key->p); - m_free(key->q); - } + if (ret == DROPBEAR_FAILURE) { + m_free(key->d); + m_free(key->p); + m_free(key->q); + } TRACE(("leave buf_get_rsa_priv_key")) - return ret; + return ret; }