The unified diff between revisions [adf974cb..] and [630fe558..] is displayed below. It can also be downloaded as a raw diff.
#
#
# patch "common-kex.c"
# from [b0bdc3d46df34d1aeb79b8f1ca9eadd8bbbc326e]
# to [deacebe648318cacffbc7d8aaa0f62ff9de0a71e]
#
# patch "libtomcrypt/src/headers/tomcrypt.h"
# from [bceecf59bf6a6fd02640e37dc21590c4327c88f2]
# to [ac02fdb2ff1abfe37dee76699b4857946acecd83]
#
# patch "libtommath/Makefile.in"
# from [699792a85f9324d650e3ce0b66c89818912d07b5]
# to [1e3d2d0ff180852cb5e5afe06c5f8e629348cb84]
#
# patch "libtommath/bn_mp_exptmod_fast.c"
# from [6180b2ea74c26856dd590bbcdbf2ec47dbda7ca0]
# to [db78a4980931f85a34647ce6a982c85d1926970d]
#
# patch "random.c"
# from [3014f3c0398f6756e9580c0ff69db3a0acf74d51]
# to [b23574c087a5c115374062b1f9ff46e565550c22]
#
============================================================
--- common-kex.c b0bdc3d46df34d1aeb79b8f1ca9eadd8bbbc326e
+++ common-kex.c deacebe648318cacffbc7d8aaa0f62ff9de0a71e
@@ -479,7 +479,7 @@ void gen_kexdh_vals(mp_int *dh_pub, mp_i
DEF_MP_INT(dh_q);
DEF_MP_INT(dh_g);
- TRACE(("enter send_msg_kexdh_reply"))
+ TRACE(("enter gen_kexdh_vals"))
m_mp_init_multi(&dh_g, &dh_p, &dh_q, NULL);
@@ -507,6 +507,7 @@ void gen_kexdh_vals(mp_int *dh_pub, mp_i
dropbear_exit("Diffie-Hellman error");
}
mp_clear_multi(&dh_g, &dh_p, &dh_q, NULL);
+ TRACE(("leave gen_kexdh_vals"))
}
/* This function is fairly common between client/server, with some substitution
@@ -520,6 +521,8 @@ void kexdh_comb_key(mp_int *dh_pub_us, m
mp_int *dh_e = NULL, *dh_f = NULL;
hash_state hs;
+ TRACE(("enter kexdh_comb_key"))
+
/* read the prime and generator*/
m_mp_init(&dh_p);
bytes_to_mp(&dh_p, dh_p_val, DH_P_LEN);
@@ -577,6 +580,7 @@ void kexdh_comb_key(mp_int *dh_pub_us, m
ses.session_id = (unsigned char*)m_malloc(SHA1_HASH_SIZE);
memcpy(ses.session_id, ses.hash, SHA1_HASH_SIZE);
}
+ TRACE(("leave kexdh_comb_key"))
}
/* read the other side's algo list. buf_match_algo is a callback to match
============================================================
--- libtomcrypt/src/headers/tomcrypt.h bceecf59bf6a6fd02640e37dc21590c4327c88f2
+++ libtomcrypt/src/headers/tomcrypt.h ac02fdb2ff1abfe37dee76699b4857946acecd83
@@ -9,7 +9,7 @@
#include <limits.h>
/* use configuration data */
-#include <tomcrypt_custom.h>
+#include "tomcrypt_custom.h"
#ifdef __cplusplus
extern "C" {
@@ -63,16 +63,16 @@ enum {
CRYPT_INVALID_PRIME_SIZE/* Invalid size of prime requested */
};
-#include <tomcrypt_cfg.h>
-#include <tomcrypt_macros.h>
-#include <tomcrypt_cipher.h>
-#include <tomcrypt_hash.h>
-#include <tomcrypt_mac.h>
-#include <tomcrypt_prng.h>
-#include <tomcrypt_pk.h>
-#include <tomcrypt_misc.h>
-#include <tomcrypt_argchk.h>
-#include <tomcrypt_pkcs.h>
+#include "tomcrypt_cfg.h"
+#include "tomcrypt_macros.h"
+#include "tomcrypt_cipher.h"
+#include "tomcrypt_hash.h"
+#include "tomcrypt_mac.h"
+#include "tomcrypt_prng.h"
+#include "tomcrypt_pk.h"
+#include "tomcrypt_misc.h"
+#include "tomcrypt_argchk.h"
+#include "tomcrypt_pkcs.h"
#ifdef __cplusplus
}
============================================================
--- libtommath/Makefile.in 699792a85f9324d650e3ce0b66c89818912d07b5
+++ libtommath/Makefile.in 1e3d2d0ff180852cb5e5afe06c5f8e629348cb84
@@ -9,7 +9,7 @@ srcdir=@srcdir@
srcdir=@srcdir@
# Dropbear takes flags from the toplevel makefile
-CFLAGS += -I$(srcdir)
+CFLAGS += -I$(srcdir) -I$(srcdir)/../
#CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare
============================================================
--- libtommath/bn_mp_exptmod_fast.c 6180b2ea74c26856dd590bbcdbf2ec47dbda7ca0
+++ libtommath/bn_mp_exptmod_fast.c db78a4980931f85a34647ce6a982c85d1926970d
@@ -42,6 +42,10 @@ int mp_exptmod_fast (mp_int * G, mp_int
*/
int (*redux)(mp_int*,mp_int*,mp_digit);
+ print_mp_int("mp_exptmod_fast G", G);
+ print_mp_int("mp_exptmod_fast X", X);
+ print_mp_int("mp_exptmod_fast P", P);
+
/* find window size */
x = mp_count_bits (X);
if (x <= 7) {
============================================================
--- random.c 3014f3c0398f6756e9580c0ff69db3a0acf74d51
+++ random.c b23574c087a5c115374062b1f9ff46e565550c22
@@ -71,6 +71,8 @@ void genrandom(unsigned char* buf, unsig
hash_state hs;
unsigned char hash[SHA1_HASH_SIZE];
unsigned int copylen;
+ const unsigned int total_len = len;
+ unsigned char* start_buf = buf;
if (!donerandinit) {
dropbear_exit("seedrandom not done");
@@ -93,6 +95,7 @@ void genrandom(unsigned char* buf, unsig
buf += copylen;
}
m_burn(hash, sizeof(hash));
+ printhex("genrandom", start_buf, total_len);
}
/* Generates a random mp_int.