diff rsa.c @ 34:e2a1eaa19f22

Client mostly works up to password auth Need to rework algo-choosing etc, since server is now broken.
author Matt Johnston <matt@ucc.asn.au>
date Wed, 28 Jul 2004 16:44:16 +0000
parents fe6bca95afa7
children b0316ce64e4b
line wrap: on
line diff
--- a/rsa.c	Tue Jul 27 16:30:46 2004 +0000
+++ b/rsa.c	Wed Jul 28 16:44:16 2004 +0000
@@ -205,6 +205,8 @@
 	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 @@
 
 	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 @@
 	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;
 
 }