diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-11-09 08:49:26 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-11-09 08:49:26 +0100 |
commit | e562008f319c3695937f989f342e98b65b7c7941 (patch) | |
tree | 0c1725730be18ef3c959c53c2ea8d7d9f69bf12d /lib/debug.c | |
parent | 8116cdc8f131edd586dad3128ae35dd744cfc32f (diff) | |
download | gnutls-e562008f319c3695937f989f342e98b65b7c7941.tar.gz |
Revert "Remove dead code."
This reverts commit e5d8a79fcc429902e8fb9b7cec91d66b965df5bb.
Diffstat (limited to 'lib/debug.c')
-rw-r--r-- | lib/debug.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/debug.c b/lib/debug.c index 6aa2a09a4d..27dda9a645 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -1,5 +1,6 @@ /* - * Copyright (C) 2001-2011 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 + * Free Software Foundation, Inc. * * Author: Nikos Mavrogiannopoulos * @@ -25,6 +26,22 @@ #include <stdio.h> #include <stdlib.h> #include "debug.h" +#include <gnutls_mpi.h> + +void +_gnutls_dump_mpi (const char *prefix, bigint_t a) +{ + char buf[400]; + char buf_hex[2 * sizeof (buf)]; + size_t n = sizeof buf; + + if (_gnutls_mpi_print (a, buf, &n)) + strcpy (buf, "[can't print value]"); /* Flawfinder: ignore */ + _gnutls_debug_log ("MPI: length: %d\n\t%s%s\n", (int) n, prefix, + _gnutls_bin2hex (buf, n, buf_hex, sizeof (buf_hex), + NULL)); +} + const char * _gnutls_packet2str (content_type_t packet) @@ -47,6 +64,7 @@ _gnutls_packet2str (content_type_t packet) const char * _gnutls_handshake2str (gnutls_handshake_description_t handshake) { + switch (handshake) { case GNUTLS_HANDSHAKE_HELLO_REQUEST: @@ -96,5 +114,6 @@ _gnutls_handshake2str (gnutls_handshake_description_t handshake) break; default: return "Unknown Handshake packet"; + } } |