# HG changeset patch # User Matt Johnston # Date 1365433955 -28800 # Node ID 2202e854d1874702f57bca2f8c475f07082ca013 # Parent f744321ac048440320bd98d67bdcbd5ee46f41b7 add printmpint() for debugging diff -r f744321ac048 -r 2202e854d187 dbutil.c --- a/dbutil.c Mon Apr 08 23:12:20 2013 +0800 +++ b/dbutil.c Mon Apr 08 23:12:35 2013 +0800 @@ -651,6 +651,14 @@ } fprintf(stderr, "\n"); } + +void printmpint(const char *label, mp_int *mp) { + buffer *buf = buf_new(1000); + buf_putmpint(buf, mp); + printhex(label, buf->data, buf->len); + buf_free(buf); + +} #endif /* Strip all control characters from text (a null-terminated string), except diff -r f744321ac048 -r 2202e854d187 dbutil.h --- a/dbutil.h Mon Apr 08 23:12:20 2013 +0800 +++ b/dbutil.h Mon Apr 08 23:12:35 2013 +0800 @@ -58,6 +58,7 @@ #ifdef DEBUG_TRACE void dropbear_trace(const char* format, ...) ATTRIB_PRINTF(1,2); void printhex(const char * label, const unsigned char * buf, int len); +void printmpint(const char *label, mp_int *mp); extern int debug_trace; #endif