summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ecc.c5
-rw-r--r--ecdsa.c2
-rw-r--r--signkey.c5
3 files changed, 6 insertions, 6 deletions
diff --git a/ecc.c b/ecc.c
index c733c9e..e252884 100644
--- a/ecc.c
+++ b/ecc.c
@@ -86,11 +86,6 @@ static int ecc_is_point(ecc_key *key)
{
mp_int *prime, *b, *t1, *t2;
int err;
-
- prime = m_malloc(sizeof(mp_int));
- b = m_malloc(sizeof(mp_int));
- t1 = m_malloc(sizeof(mp_int));
- t2 = m_malloc(sizeof(mp_int));
m_mp_alloc_init_multi(&prime, &b, &t1, &t2, NULL);
diff --git a/ecdsa.c b/ecdsa.c
index 0396014..4fee796 100644
--- a/ecdsa.c
+++ b/ecdsa.c
@@ -409,7 +409,7 @@ int buf_ecdsa_verify(buffer *buf, ecc_key *key, buffer *data_buf) {
out:
ltc_ecc_del_point(mG);
ltc_ecc_del_point(mQ);
- mp_clear_multi(r, s, v, w, u1, u2, p, e, m, NULL);
+ ltc_deinit_multi(r, s, v, w, u1, u2, p, e, m, NULL);
if (mp != NULL) {
ltc_mp.montgomery_deinit(mp);
}
diff --git a/signkey.c b/signkey.c
index f033e86..10a63f2 100644
--- a/signkey.c
+++ b/signkey.c
@@ -187,6 +187,7 @@ int buf_get_pub_key(buffer *buf, sign_key *key, enum signkey_type *type) {
if (eck) {
if (*eck) {
ecc_free(*eck);
+ m_free(*eck);
*eck = NULL;
}
*eck = buf_get_ecdsa_pub_key(buf);
@@ -255,6 +256,7 @@ int buf_get_priv_key(buffer *buf, sign_key *key, enum signkey_type *type) {
if (eck) {
if (*eck) {
ecc_free(*eck);
+ m_free(*eck);
*eck = NULL;
}
*eck = buf_get_ecdsa_priv_key(buf);
@@ -355,18 +357,21 @@ void sign_key_free(sign_key *key) {
#ifdef DROPBEAR_ECC_256
if (key->ecckey256) {
ecc_free(key->ecckey256);
+ m_free(key->ecckey256);
key->ecckey256 = NULL;
}
#endif
#ifdef DROPBEAR_ECC_384
if (key->ecckey384) {
ecc_free(key->ecckey384);
+ m_free(key->ecckey384);
key->ecckey384 = NULL;
}
#endif
#ifdef DROPBEAR_ECC_521
if (key->ecckey521) {
ecc_free(key->ecckey521);
+ m_free(key->ecckey521);
key->ecckey521 = NULL;
}
#endif