# HG changeset patch # User Matt Johnston # Date 1155051098 0 # Node ID e66eec4dcba7b44e7e629c93b1537a701bcc1878 # Parent cd14c94fe89cabb47e0ebf5b2140828b75e2a82f some more debugging output diff -r cd14c94fe89c -r e66eec4dcba7 common-kex.c --- a/common-kex.c Sun Aug 06 15:29:41 2006 +0000 +++ b/common-kex.c Tue Aug 08 15:31:38 2006 +0000 @@ -479,7 +479,7 @@ 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 @@ 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 @@ 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 @@ 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 diff -r cd14c94fe89c -r e66eec4dcba7 libtomcrypt/src/headers/tomcrypt.h --- a/libtomcrypt/src/headers/tomcrypt.h Sun Aug 06 15:29:41 2006 +0000 +++ b/libtomcrypt/src/headers/tomcrypt.h Tue Aug 08 15:31:38 2006 +0000 @@ -9,7 +9,7 @@ #include /* use configuration data */ -#include +#include "tomcrypt_custom.h" #ifdef __cplusplus extern "C" { @@ -63,16 +63,16 @@ CRYPT_INVALID_PRIME_SIZE/* Invalid size of prime requested */ }; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#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 } diff -r cd14c94fe89c -r e66eec4dcba7 libtommath/Makefile.in --- a/libtommath/Makefile.in Sun Aug 06 15:29:41 2006 +0000 +++ b/libtommath/Makefile.in Tue Aug 08 15:31:38 2006 +0000 @@ -9,7 +9,7 @@ srcdir=@srcdir@ # Dropbear takes flags from the toplevel makefile -CFLAGS += -I$(srcdir) +CFLAGS += -I$(srcdir) -I$(srcdir)/../ #CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare diff -r cd14c94fe89c -r e66eec4dcba7 libtommath/bn_mp_exptmod_fast.c --- a/libtommath/bn_mp_exptmod_fast.c Sun Aug 06 15:29:41 2006 +0000 +++ b/libtommath/bn_mp_exptmod_fast.c Tue Aug 08 15:31:38 2006 +0000 @@ -42,6 +42,10 @@ */ 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) { diff -r cd14c94fe89c -r e66eec4dcba7 random.c --- a/random.c Sun Aug 06 15:29:41 2006 +0000 +++ b/random.c Tue Aug 08 15:31:38 2006 +0000 @@ -71,6 +71,8 @@ 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 @@ buf += copylen; } m_burn(hash, sizeof(hash)); + printhex("genrandom", start_buf, total_len); } /* Generates a random mp_int.