blob: ade98d4862e898c4c84e214e26044310d90c385a [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/*
2 * Debugging routines
3 *
Manuel Pégourié-Gonnarda658a402015-01-23 09:45:19 +00004 * Copyright (C) 2006-2014, ARM Limited, All Rights Reserved
Paul Bakkerb96f1542010-07-18 20:36:00 +00005 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +00006 * This file is part of mbed TLS (https://tls.mbed.org)
Paul Bakkerb96f1542010-07-18 20:36:00 +00007 *
Paul Bakker5121ce52009-01-03 21:22:43 +00008 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020023#if !defined(POLARSSL_CONFIG_FILE)
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000024#include "mbedtls/config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020025#else
26#include POLARSSL_CONFIG_FILE
27#endif
Paul Bakker5121ce52009-01-03 21:22:43 +000028
Paul Bakker40e46942009-01-03 21:51:57 +000029#if defined(POLARSSL_DEBUG_C)
Paul Bakker5121ce52009-01-03 21:22:43 +000030
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000031#include "mbedtls/debug.h"
Paul Bakker5121ce52009-01-03 21:22:43 +000032
33#include <stdarg.h>
Paul Bakkerfa6a6202013-10-28 18:48:30 +010034#include <stdio.h>
Rich Evans00ab4702015-02-06 13:43:58 +000035#include <string.h>
Paul Bakkerfa6a6202013-10-28 18:48:30 +010036
Paul Bakker6edcd412013-10-29 15:22:54 +010037#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
38#if !defined snprintf
Paul Bakker5121ce52009-01-03 21:22:43 +000039#define snprintf _snprintf
40#endif
41
Paul Bakker6edcd412013-10-29 15:22:54 +010042#if !defined vsnprintf
Paul Bakker5121ce52009-01-03 21:22:43 +000043#define vsnprintf _vsnprintf
44#endif
Paul Bakker6edcd412013-10-29 15:22:54 +010045#endif /* _MSC_VER */
Paul Bakker5121ce52009-01-03 21:22:43 +000046
Rich Evans2387c7d2015-01-30 11:10:20 +000047#if defined(POLARSSL_PLATFORM_C)
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000048#include "mbedtls/platform.h"
Rich Evans2387c7d2015-01-30 11:10:20 +000049#else
50#define polarssl_snprintf snprintf
51#endif
52
Paul Bakkereaebbd52014-04-25 15:04:14 +020053static int debug_log_mode = POLARSSL_DEBUG_DFL_MODE;
Paul Bakkerc73079a2014-04-25 16:34:30 +020054static int debug_threshold = 0;
Paul Bakkereaebbd52014-04-25 15:04:14 +020055
56void debug_set_log_mode( int log_mode )
57{
58 debug_log_mode = log_mode;
59}
60
Paul Bakkerc73079a2014-04-25 16:34:30 +020061void debug_set_threshold( int threshold )
62{
63 debug_threshold = threshold;
64}
65
Paul Bakker5121ce52009-01-03 21:22:43 +000066char *debug_fmt( const char *format, ... )
67{
68 va_list argp;
69 static char str[512];
70 int maxlen = sizeof( str ) - 1;
71
72 va_start( argp, format );
73 vsnprintf( str, maxlen, format, argp );
74 va_end( argp );
75
76 str[maxlen] = '\0';
77 return( str );
78}
79
Paul Bakkerff60ee62010-03-16 21:09:09 +000080void debug_print_msg( const ssl_context *ssl, int level,
81 const char *file, int line, const char *text )
Paul Bakker5121ce52009-01-03 21:22:43 +000082{
83 char str[512];
84 int maxlen = sizeof( str ) - 1;
85
Paul Bakkerc73079a2014-04-25 16:34:30 +020086 if( ssl->f_dbg == NULL || level > debug_threshold )
Paul Bakker5121ce52009-01-03 21:22:43 +000087 return;
88
Paul Bakkereaebbd52014-04-25 15:04:14 +020089 if( debug_log_mode == POLARSSL_DEBUG_LOG_RAW )
90 {
Paul Bakker5593f7c2014-05-06 10:29:28 +020091 ssl->f_dbg( ssl->p_dbg, level, text );
Paul Bakkereaebbd52014-04-25 15:04:14 +020092 return;
93 }
94
Rich Evans2387c7d2015-01-30 11:10:20 +000095 polarssl_snprintf( str, maxlen, "%s(%04d): %s\n", file, line, text );
Paul Bakker5121ce52009-01-03 21:22:43 +000096 str[maxlen] = '\0';
97 ssl->f_dbg( ssl->p_dbg, level, str );
98}
99
Paul Bakkerff60ee62010-03-16 21:09:09 +0000100void debug_print_ret( const ssl_context *ssl, int level,
101 const char *file, int line,
102 const char *text, int ret )
Paul Bakker5121ce52009-01-03 21:22:43 +0000103{
104 char str[512];
105 int maxlen = sizeof( str ) - 1;
Paul Bakkereaebbd52014-04-25 15:04:14 +0200106 size_t idx = 0;
Paul Bakker5121ce52009-01-03 21:22:43 +0000107
Paul Bakkerc73079a2014-04-25 16:34:30 +0200108 if( ssl->f_dbg == NULL || level > debug_threshold )
Paul Bakker5121ce52009-01-03 21:22:43 +0000109 return;
110
Paul Bakkereaebbd52014-04-25 15:04:14 +0200111 if( debug_log_mode == POLARSSL_DEBUG_LOG_FULL )
Rich Evans2387c7d2015-01-30 11:10:20 +0000112 idx = polarssl_snprintf( str, maxlen, "%s(%04d): ", file, line );
Paul Bakkereaebbd52014-04-25 15:04:14 +0200113
Rich Evans2387c7d2015-01-30 11:10:20 +0000114 polarssl_snprintf( str + idx, maxlen - idx, "%s() returned %d (-0x%04x)\n",
Paul Bakkereaebbd52014-04-25 15:04:14 +0200115 text, ret, -ret );
Paul Bakker5121ce52009-01-03 21:22:43 +0000116
117 str[maxlen] = '\0';
118 ssl->f_dbg( ssl->p_dbg, level, str );
119}
120
Paul Bakkerff60ee62010-03-16 21:09:09 +0000121void debug_print_buf( const ssl_context *ssl, int level,
122 const char *file, int line, const char *text,
Manuel Pégourié-Gonnarda78b2182015-03-19 17:16:11 +0000123 const unsigned char *buf, size_t len )
Paul Bakker5121ce52009-01-03 21:22:43 +0000124{
125 char str[512];
Manuel Pégourié-Gonnard8c9223d2014-11-19 10:17:21 +0100126 char txt[17];
Paul Bakkereaebbd52014-04-25 15:04:14 +0200127 size_t i, maxlen = sizeof( str ) - 1, idx = 0;
Paul Bakker5121ce52009-01-03 21:22:43 +0000128
Paul Bakkerc73079a2014-04-25 16:34:30 +0200129 if( ssl->f_dbg == NULL || level > debug_threshold )
Paul Bakker5121ce52009-01-03 21:22:43 +0000130 return;
131
Paul Bakkereaebbd52014-04-25 15:04:14 +0200132 if( debug_log_mode == POLARSSL_DEBUG_LOG_FULL )
Rich Evans2387c7d2015-01-30 11:10:20 +0000133 idx = polarssl_snprintf( str, maxlen, "%s(%04d): ", file, line );
Paul Bakkereaebbd52014-04-25 15:04:14 +0200134
Rich Evans2387c7d2015-01-30 11:10:20 +0000135 polarssl_snprintf( str + idx, maxlen - idx, "dumping '%s' (%u bytes)\n",
Paul Bakkereaebbd52014-04-25 15:04:14 +0200136 text, (unsigned int) len );
Paul Bakker5121ce52009-01-03 21:22:43 +0000137
138 str[maxlen] = '\0';
139 ssl->f_dbg( ssl->p_dbg, level, str );
140
Paul Bakker92478c32014-04-25 15:18:34 +0200141 idx = 0;
Manuel Pégourié-Gonnard8c9223d2014-11-19 10:17:21 +0100142 memset( txt, 0, sizeof( txt ) );
Paul Bakker5121ce52009-01-03 21:22:43 +0000143 for( i = 0; i < len; i++ )
144 {
145 if( i >= 4096 )
146 break;
147
148 if( i % 16 == 0 )
149 {
150 if( i > 0 )
Paul Bakker92478c32014-04-25 15:18:34 +0200151 {
Rich Evans2387c7d2015-01-30 11:10:20 +0000152 polarssl_snprintf( str + idx, maxlen - idx, " %s\n", txt );
Paul Bakker92478c32014-04-25 15:18:34 +0200153 ssl->f_dbg( ssl->p_dbg, level, str );
Manuel Pégourié-Gonnard8c9223d2014-11-19 10:17:21 +0100154
Paul Bakker92478c32014-04-25 15:18:34 +0200155 idx = 0;
Manuel Pégourié-Gonnard8c9223d2014-11-19 10:17:21 +0100156 memset( txt, 0, sizeof( txt ) );
Paul Bakker92478c32014-04-25 15:18:34 +0200157 }
Paul Bakker5121ce52009-01-03 21:22:43 +0000158
Paul Bakkereaebbd52014-04-25 15:04:14 +0200159 if( debug_log_mode == POLARSSL_DEBUG_LOG_FULL )
Rich Evans2387c7d2015-01-30 11:10:20 +0000160 idx = polarssl_snprintf( str, maxlen, "%s(%04d): ", file, line );
Paul Bakkereaebbd52014-04-25 15:04:14 +0200161
Rich Evans2387c7d2015-01-30 11:10:20 +0000162 idx += polarssl_snprintf( str + idx, maxlen - idx, "%04x: ",
Paul Bakker92478c32014-04-25 15:18:34 +0200163 (unsigned int) i );
Paul Bakker5121ce52009-01-03 21:22:43 +0000164
Paul Bakker5121ce52009-01-03 21:22:43 +0000165 }
166
Rich Evans2387c7d2015-01-30 11:10:20 +0000167 idx += polarssl_snprintf( str + idx, maxlen - idx, " %02x",
Paul Bakker92478c32014-04-25 15:18:34 +0200168 (unsigned int) buf[i] );
Manuel Pégourié-Gonnard8c9223d2014-11-19 10:17:21 +0100169 txt[i % 16] = ( buf[i] > 31 && buf[i] < 127 ) ? buf[i] : '.' ;
Paul Bakker5121ce52009-01-03 21:22:43 +0000170 }
171
172 if( len > 0 )
Paul Bakker92478c32014-04-25 15:18:34 +0200173 {
Manuel Pégourié-Gonnard8c9223d2014-11-19 10:17:21 +0100174 for( /* i = i */; i % 16 != 0; i++ )
Rich Evans2387c7d2015-01-30 11:10:20 +0000175 idx += polarssl_snprintf( str + idx, maxlen - idx, " " );
Manuel Pégourié-Gonnard8c9223d2014-11-19 10:17:21 +0100176
Rich Evans2387c7d2015-01-30 11:10:20 +0000177 polarssl_snprintf( str + idx, maxlen - idx, " %s\n", txt );
Paul Bakker92478c32014-04-25 15:18:34 +0200178 ssl->f_dbg( ssl->p_dbg, level, str );
179 }
Paul Bakker5121ce52009-01-03 21:22:43 +0000180}
181
Paul Bakker41c83d32013-03-20 14:39:14 +0100182#if defined(POLARSSL_ECP_C)
183void debug_print_ecp( const ssl_context *ssl, int level,
184 const char *file, int line,
185 const char *text, const ecp_point *X )
186{
187 char str[512];
188 int maxlen = sizeof( str ) - 1;
189
Paul Bakkerc73079a2014-04-25 16:34:30 +0200190 if( ssl->f_dbg == NULL || level > debug_threshold )
191 return;
192
Rich Evans2387c7d2015-01-30 11:10:20 +0000193 polarssl_snprintf( str, maxlen, "%s(X)", text );
Paul Bakker41c83d32013-03-20 14:39:14 +0100194 str[maxlen] = '\0';
195 debug_print_mpi( ssl, level, file, line, str, &X->X );
196
Rich Evans2387c7d2015-01-30 11:10:20 +0000197 polarssl_snprintf( str, maxlen, "%s(Y)", text );
Paul Bakker41c83d32013-03-20 14:39:14 +0100198 str[maxlen] = '\0';
199 debug_print_mpi( ssl, level, file, line, str, &X->Y );
Paul Bakker41c83d32013-03-20 14:39:14 +0100200}
201#endif /* POLARSSL_ECP_C */
202
Paul Bakkered27a042013-04-18 22:46:23 +0200203#if defined(POLARSSL_BIGNUM_C)
Paul Bakkerff60ee62010-03-16 21:09:09 +0000204void debug_print_mpi( const ssl_context *ssl, int level,
205 const char *file, int line,
206 const char *text, const mpi *X )
Paul Bakker5121ce52009-01-03 21:22:43 +0000207{
208 char str[512];
Paul Bakker23986e52011-04-24 08:57:21 +0000209 int j, k, maxlen = sizeof( str ) - 1, zeros = 1;
Paul Bakkereaebbd52014-04-25 15:04:14 +0200210 size_t i, n, idx = 0;
Paul Bakker5121ce52009-01-03 21:22:43 +0000211
Paul Bakkerc73079a2014-04-25 16:34:30 +0200212 if( ssl->f_dbg == NULL || X == NULL || level > debug_threshold )
Paul Bakker5121ce52009-01-03 21:22:43 +0000213 return;
214
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000215 for( n = X->n - 1; n > 0; n-- )
Paul Bakker5121ce52009-01-03 21:22:43 +0000216 if( X->p[n] != 0 )
217 break;
218
Paul Bakkera755ca12011-04-24 09:11:17 +0000219 for( j = ( sizeof(t_uint) << 3 ) - 1; j >= 0; j-- )
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000220 if( ( ( X->p[n] >> j ) & 1 ) != 0 )
221 break;
222
Paul Bakkereaebbd52014-04-25 15:04:14 +0200223 if( debug_log_mode == POLARSSL_DEBUG_LOG_FULL )
Rich Evans2387c7d2015-01-30 11:10:20 +0000224 idx = polarssl_snprintf( str, maxlen, "%s(%04d): ", file, line );
Paul Bakkereaebbd52014-04-25 15:04:14 +0200225
Rich Evans2387c7d2015-01-30 11:10:20 +0000226 polarssl_snprintf( str + idx, maxlen - idx, "value of '%s' (%d bits) is:\n",
Paul Bakkereaebbd52014-04-25 15:04:14 +0200227 text, (int) ( ( n * ( sizeof(t_uint) << 3 ) ) + j + 1 ) );
Paul Bakker5121ce52009-01-03 21:22:43 +0000228
229 str[maxlen] = '\0';
230 ssl->f_dbg( ssl->p_dbg, level, str );
231
Paul Bakker92478c32014-04-25 15:18:34 +0200232 idx = 0;
Paul Bakker23986e52011-04-24 08:57:21 +0000233 for( i = n + 1, j = 0; i > 0; i-- )
Paul Bakker5121ce52009-01-03 21:22:43 +0000234 {
Paul Bakker23986e52011-04-24 08:57:21 +0000235 if( zeros && X->p[i - 1] == 0 )
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000236 continue;
Paul Bakker5121ce52009-01-03 21:22:43 +0000237
Paul Bakkera755ca12011-04-24 09:11:17 +0000238 for( k = sizeof( t_uint ) - 1; k >= 0; k-- )
Paul Bakker5121ce52009-01-03 21:22:43 +0000239 {
Paul Bakker66d5d072014-06-17 16:39:18 +0200240 if( zeros && ( ( X->p[i - 1] >> ( k << 3 ) ) & 0xFF ) == 0 )
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000241 continue;
242 else
243 zeros = 0;
244
245 if( j % 16 == 0 )
246 {
247 if( j > 0 )
Paul Bakker92478c32014-04-25 15:18:34 +0200248 {
Rich Evans2387c7d2015-01-30 11:10:20 +0000249 polarssl_snprintf( str + idx, maxlen - idx, "\n" );
Paul Bakker92478c32014-04-25 15:18:34 +0200250 ssl->f_dbg( ssl->p_dbg, level, str );
251 idx = 0;
252 }
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000253
Paul Bakkereaebbd52014-04-25 15:04:14 +0200254 if( debug_log_mode == POLARSSL_DEBUG_LOG_FULL )
Rich Evans2387c7d2015-01-30 11:10:20 +0000255 idx = polarssl_snprintf( str, maxlen, "%s(%04d): ", file, line );
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000256 }
257
Rich Evans2387c7d2015-01-30 11:10:20 +0000258 idx += polarssl_snprintf( str + idx, maxlen - idx, " %02x", (unsigned int)
Paul Bakker66d5d072014-06-17 16:39:18 +0200259 ( X->p[i - 1] >> ( k << 3 ) ) & 0xFF );
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000260
261 j++;
Paul Bakker5121ce52009-01-03 21:22:43 +0000262 }
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000263
264 }
265
266 if( zeros == 1 )
267 {
Paul Bakkereaebbd52014-04-25 15:04:14 +0200268 if( debug_log_mode == POLARSSL_DEBUG_LOG_FULL )
269 {
Rich Evans2387c7d2015-01-30 11:10:20 +0000270 idx = polarssl_snprintf( str, maxlen, "%s(%04d): ", file, line );
Paul Bakkerbe4e7dc2011-03-14 20:41:31 +0000271
Paul Bakkereaebbd52014-04-25 15:04:14 +0200272 }
Rich Evans2387c7d2015-01-30 11:10:20 +0000273 idx += polarssl_snprintf( str + idx, maxlen - idx, " 00" );
Paul Bakker5121ce52009-01-03 21:22:43 +0000274 }
275
Rich Evans2387c7d2015-01-30 11:10:20 +0000276 polarssl_snprintf( str + idx, maxlen - idx, "\n" );
Paul Bakker92478c32014-04-25 15:18:34 +0200277 ssl->f_dbg( ssl->p_dbg, level, str );
Paul Bakker5121ce52009-01-03 21:22:43 +0000278}
Paul Bakkered27a042013-04-18 22:46:23 +0200279#endif /* POLARSSL_BIGNUM_C */
Paul Bakker5121ce52009-01-03 21:22:43 +0000280
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200281#if defined(POLARSSL_X509_CRT_PARSE_C)
Manuel Pégourié-Gonnardc6ac8872013-08-14 18:04:18 +0200282static void debug_print_pk( const ssl_context *ssl, int level,
283 const char *file, int line,
284 const char *text, const pk_context *pk )
285{
286 size_t i;
287 pk_debug_item items[POLARSSL_PK_DEBUG_MAX_ITEMS];
288 char name[16];
289
290 memset( items, 0, sizeof( items ) );
291
292 if( pk_debug( pk, items ) != 0 )
293 {
294 debug_print_msg( ssl, level, file, line, "invalid PK context" );
295 return;
296 }
297
Paul Bakker0e4f9112014-04-17 12:39:05 +0200298 for( i = 0; i < POLARSSL_PK_DEBUG_MAX_ITEMS; i++ )
Manuel Pégourié-Gonnardc6ac8872013-08-14 18:04:18 +0200299 {
300 if( items[i].type == POLARSSL_PK_DEBUG_NONE )
301 return;
302
Rich Evans2387c7d2015-01-30 11:10:20 +0000303 polarssl_snprintf( name, sizeof( name ), "%s%s", text, items[i].name );
Manuel Pégourié-Gonnardc6ac8872013-08-14 18:04:18 +0200304 name[sizeof( name ) - 1] = '\0';
305
306 if( items[i].type == POLARSSL_PK_DEBUG_MPI )
307 debug_print_mpi( ssl, level, file, line, name, items[i].value );
Manuel Pégourié-Gonnardbac0e3b2013-10-15 11:54:47 +0200308 else
309#if defined(POLARSSL_ECP_C)
310 if( items[i].type == POLARSSL_PK_DEBUG_ECP )
Manuel Pégourié-Gonnardc6ac8872013-08-14 18:04:18 +0200311 debug_print_ecp( ssl, level, file, line, name, items[i].value );
312 else
Manuel Pégourié-Gonnardbac0e3b2013-10-15 11:54:47 +0200313#endif
Manuel Pégourié-Gonnardc6ac8872013-08-14 18:04:18 +0200314 debug_print_msg( ssl, level, file, line, "should not happen" );
315 }
316}
317
Paul Bakkerff60ee62010-03-16 21:09:09 +0000318void debug_print_crt( const ssl_context *ssl, int level,
319 const char *file, int line,
Paul Bakkerc559c7a2013-09-18 14:13:26 +0200320 const char *text, const x509_crt *crt )
Paul Bakker5121ce52009-01-03 21:22:43 +0000321{
Paul Bakkerd98030e2009-05-02 15:13:40 +0000322 char str[1024], prefix[64];
Paul Bakkereaebbd52014-04-25 15:04:14 +0200323 int i = 0, maxlen = sizeof( prefix ) - 1, idx = 0;
Paul Bakker5121ce52009-01-03 21:22:43 +0000324
Paul Bakkerc73079a2014-04-25 16:34:30 +0200325 if( ssl->f_dbg == NULL || crt == NULL || level > debug_threshold )
Paul Bakker5121ce52009-01-03 21:22:43 +0000326 return;
327
Paul Bakkereaebbd52014-04-25 15:04:14 +0200328 if( debug_log_mode == POLARSSL_DEBUG_LOG_FULL )
329 {
Rich Evans2387c7d2015-01-30 11:10:20 +0000330 polarssl_snprintf( prefix, maxlen, "%s(%04d): ", file, line );
Paul Bakkereaebbd52014-04-25 15:04:14 +0200331 prefix[maxlen] = '\0';
332 }
333 else
334 prefix[0] = '\0';
335
Paul Bakker5121ce52009-01-03 21:22:43 +0000336 maxlen = sizeof( str ) - 1;
337
Paul Bakker29087132010-03-21 21:03:34 +0000338 while( crt != NULL )
Paul Bakker5121ce52009-01-03 21:22:43 +0000339 {
Paul Bakkerd98030e2009-05-02 15:13:40 +0000340 char buf[1024];
Paul Bakkerddf26b42013-09-18 13:46:23 +0200341 x509_crt_info( buf, sizeof( buf ) - 1, prefix, crt );
Paul Bakker5121ce52009-01-03 21:22:43 +0000342
Paul Bakkereaebbd52014-04-25 15:04:14 +0200343 if( debug_log_mode == POLARSSL_DEBUG_LOG_FULL )
Rich Evans2387c7d2015-01-30 11:10:20 +0000344 idx = polarssl_snprintf( str, maxlen, "%s(%04d): ", file, line );
Paul Bakkereaebbd52014-04-25 15:04:14 +0200345
Rich Evans2387c7d2015-01-30 11:10:20 +0000346 polarssl_snprintf( str + idx, maxlen - idx, "%s #%d:\n%s",
Paul Bakkereaebbd52014-04-25 15:04:14 +0200347 text, ++i, buf );
Paul Bakker5121ce52009-01-03 21:22:43 +0000348
349 str[maxlen] = '\0';
350 ssl->f_dbg( ssl->p_dbg, level, str );
351
Manuel Pégourié-Gonnardc6ac8872013-08-14 18:04:18 +0200352 debug_print_pk( ssl, level, file, line, "crt->", &crt->pk );
Paul Bakker5121ce52009-01-03 21:22:43 +0000353
354 crt = crt->next;
355 }
356}
Paul Bakker7c6b2c32013-09-16 13:49:26 +0200357#endif /* POLARSSL_X509_CRT_PARSE_C */
Paul Bakker5121ce52009-01-03 21:22:43 +0000358
Paul Bakker9af723c2014-05-01 13:03:14 +0200359#endif /* POLARSSL_DEBUG_C */