mirror of
https://github.com/clearml/dropbear
synced 2025-01-31 10:57:01 +00:00
add printmpint() for debugging
--HG-- branch : ecc
This commit is contained in:
parent
48c83aa9d0
commit
a7d1a9cfcb
8
dbutil.c
8
dbutil.c
@ -651,6 +651,14 @@ void printhex(const char * label, const unsigned char * buf, int len) {
|
|||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
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
|
#endif
|
||||||
|
|
||||||
/* Strip all control characters from text (a null-terminated string), except
|
/* Strip all control characters from text (a null-terminated string), except
|
||||||
|
1
dbutil.h
1
dbutil.h
@ -58,6 +58,7 @@ void fail_assert(const char* expr, const char* file, int line) ATTRIB_NORETURN;
|
|||||||
#ifdef DEBUG_TRACE
|
#ifdef DEBUG_TRACE
|
||||||
void dropbear_trace(const char* format, ...) ATTRIB_PRINTF(1,2);
|
void dropbear_trace(const char* format, ...) ATTRIB_PRINTF(1,2);
|
||||||
void printhex(const char * label, const unsigned char * buf, int len);
|
void printhex(const char * label, const unsigned char * buf, int len);
|
||||||
|
void printmpint(const char *label, mp_int *mp);
|
||||||
extern int debug_trace;
|
extern int debug_trace;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user