25 #ifndef MBEDTLS_DEBUG_H
26 #define MBEDTLS_DEBUG_H
28 #if !defined(MBEDTLS_CONFIG_FILE)
31 #include MBEDTLS_CONFIG_FILE
36 #if defined(MBEDTLS_ECP_C)
40 #if defined(MBEDTLS_DEBUG_C)
42 #define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__
44 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) \
45 mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \
46 MBEDTLS_DEBUG_STRIP_PARENS args )
48 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) \
49 mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret )
51 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) \
52 mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len )
54 #if defined(MBEDTLS_BIGNUM_C)
55 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) \
56 mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X )
59 #if defined(MBEDTLS_ECP_C)
60 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) \
61 mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X )
64 #if defined(MBEDTLS_X509_CRT_PARSE_C)
65 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) \
66 mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt )
71 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) do { } while( 0 )
72 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) do { } while( 0 )
73 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 )
74 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) do { } while( 0 )
75 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) do { } while( 0 )
76 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 )
117 const char *file,
int line,
118 const char *format, ... );
136 const char *file,
int line,
137 const char *text,
int ret );
157 const char *file,
int line,
const char *text,
158 const unsigned char *buf,
size_t len );
160 #if defined(MBEDTLS_BIGNUM_C)
178 const char *file,
int line,
182 #if defined(MBEDTLS_ECP_C)
200 const char *file,
int line,
204 #if defined(MBEDTLS_X509_CRT_PARSE_C)
221 const char *file,
int line,
void mbedtls_debug_print_crt(const mbedtls_ssl_context *ssl, int level, const char *file, int line, const char *text, const mbedtls_x509_crt *crt)
Print a X.509 certificate structure to the debug output.
void mbedtls_debug_print_mpi(const mbedtls_ssl_context *ssl, int level, const char *file, int line, const char *text, const mbedtls_mpi *X)
Print a MPI variable to the debug output.
Elliptic curves over GF(p)
Configuration options (set of defines)
void mbedtls_debug_set_threshold(int threshold)
Set the threshold error level to handle globally all debug output.
void mbedtls_debug_print_ret(const mbedtls_ssl_context *ssl, int level, const char *file, int line, const char *text, int ret)
Print the return value of a function to the debug output.
void mbedtls_debug_print_msg(const mbedtls_ssl_context *ssl, int level, const char *file, int line, const char *format,...)
Print a message to the debug output.
Container for an X.509 certificate.
ECP point structure (jacobian coordinates)
void mbedtls_debug_print_ecp(const mbedtls_ssl_context *ssl, int level, const char *file, int line, const char *text, const mbedtls_ecp_point *X)
Print an ECP point to the debug output.
void mbedtls_debug_print_buf(const mbedtls_ssl_context *ssl, int level, const char *file, int line, const char *text, const unsigned char *buf, size_t len)
Output a buffer of size len bytes to the debug output.