summaryrefslogtreecommitdiffhomepage
path: root/rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'rsa.c')
-rw-r--r--rsa.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/rsa.c b/rsa.c
index 936b2c8..2d63c02 100644
--- a/rsa.c
+++ b/rsa.c
@@ -205,6 +205,8 @@ int buf_rsa_verify(buffer * buf, rsa_key *key, const unsigned char* data,
mp_int *rsa_em = NULL;
int ret = DROPBEAR_FAILURE;
+ TRACE(("enter buf_rsa_verify"));
+
assert(key != NULL);
m_mp_init_multi(&rsa_mdash, &rsa_s, NULL);
@@ -217,6 +219,7 @@ int buf_rsa_verify(buffer * buf, rsa_key *key, const unsigned char* data,
if (mp_read_unsigned_bin(&rsa_s, buf_getptr(buf, buf->len - buf->pos),
buf->len - buf->pos) != MP_OKAY) {
+ TRACE(("failed reading rsa_s"));
goto out;
}
@@ -230,17 +233,20 @@ int buf_rsa_verify(buffer * buf, rsa_key *key, const unsigned char* data,
rsa_em = rsa_pad_em(key, data, len);
if (mp_exptmod(&rsa_s, key->e, key->n, &rsa_mdash) != MP_OKAY) {
+ TRACE(("failed exptmod rsa_s"));
goto out;
}
if (mp_cmp(rsa_em, &rsa_mdash) == MP_EQ) {
/* signature is valid */
+ TRACE(("success!"));
ret = DROPBEAR_SUCCESS;
}
out:
mp_clear_multi(rsa_em, &rsa_mdash, &rsa_s, NULL);
m_free(rsa_em);
+ TRACE(("leave buf_rsa_verify: ret %d", ret));
return ret;
}