Go to the documentation of this file.
49 #ifndef MBEDTLS_DEBUG_H
50 #define MBEDTLS_DEBUG_H
52 #if !defined(MBEDTLS_CONFIG_FILE)
55 #include MBEDTLS_CONFIG_FILE
60 #if defined(MBEDTLS_ECP_C)
64 #if defined(MBEDTLS_DEBUG_C)
66 #define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__
68 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) \
69 mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \
70 MBEDTLS_DEBUG_STRIP_PARENS args )
72 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) \
73 mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret )
75 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) \
76 mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len )
78 #if defined(MBEDTLS_BIGNUM_C)
79 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) \
80 mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X )
83 #if defined(MBEDTLS_ECP_C)
84 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) \
85 mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X )
88 #if defined(MBEDTLS_X509_CRT_PARSE_C)
89 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) \
90 mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt )
93 #if defined(MBEDTLS_ECDH_C)
94 #define MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr ) \
95 mbedtls_debug_printf_ecdh( ssl, level, __FILE__, __LINE__, ecdh, attr )
100 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) do { } while( 0 )
101 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) do { } while( 0 )
102 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 )
103 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) do { } while( 0 )
104 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) do { } while( 0 )
105 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 )
106 #define MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr ) do { } while( 0 )
147 const char *file,
int line,
148 const char *format, ... );
166 const char *file,
int line,
167 const char *text,
int ret );
187 const char *file,
int line,
const char *text,
188 const unsigned char *buf,
size_t len );
190 #if defined(MBEDTLS_BIGNUM_C)
208 const char *file,
int line,
212 #if defined(MBEDTLS_ECP_C)
230 const char *file,
int line,
234 #if defined(MBEDTLS_X509_CRT_PARSE_C)
251 const char *file,
int line,
255 #if defined(MBEDTLS_ECDH_C)
280 const char *file,
int line,
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. This function is always used through the MBEDTLS_SSL_DEBUG_EC...
This file provides an API for Elliptic Curves over GF(P) (ECP).
The ECDH context structure.
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. This function is always used through the MB...
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. This function is always used through the MBE...
void mbedtls_debug_set_threshold(int threshold)
Set the threshold error level to handle globally all debug output. Debug messages that have a level o...
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. This function is always used through the MBEDTLS_SSL_DEBUG_MSG()...
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. This function is always used through the MBEDT...
Configuration options (set of defines)
void mbedtls_debug_printf_ecdh(const mbedtls_ssl_context *ssl, int level, const char *file, int line, const mbedtls_ecdh_context *ecdh, mbedtls_debug_ecdh_attr attr)
Print a field of the ECDH structure in the SSL context to the debug output. This function is always u...
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. This function is always used through the MBEDTLS_SSL_DEBUG_...
The ECP point structure, in Jacobian coordinates.