summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/debug.c21
-rw-r--r--lib/debug.h1
2 files changed, 21 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";
+
}
}
diff --git a/lib/debug.h b/lib/debug.h
index 4d3d2b03b7..d0ad69370e 100644
--- a/lib/debug.h
+++ b/lib/debug.h
@@ -22,3 +22,4 @@
const char *_gnutls_packet2str (content_type_t packet);
const char *_gnutls_handshake2str (gnutls_handshake_description_t handshake);
+void _gnutls_dump_mpi (const char *prefix, bigint_t a);