22#ifndef MBEDTLS_DEBUG_H
23#define MBEDTLS_DEBUG_H
25#if !defined(MBEDTLS_CONFIG_FILE)
28#include MBEDTLS_CONFIG_FILE
33#if defined(MBEDTLS_ECP_C)
45#if defined(MBEDTLS_DEBUG_C)
47#define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__
49#define MBEDTLS_SSL_DEBUG_MSG( level, args ) \
50 mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \
51 MBEDTLS_DEBUG_STRIP_PARENS args )
53#define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) \
54 mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret )
56#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) \
57 mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len )
59#if defined(MBEDTLS_BIGNUM_C)
60#define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) \
61 mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X )
64#if defined(MBEDTLS_ECP_C)
65#define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) \
66 mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X )
69#if defined(MBEDTLS_X509_CRT_PARSE_C)
70#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) \
71 mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt )
74#if defined(MBEDTLS_ECDH_C)
75#define MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr ) \
76 mbedtls_debug_printf_ecdh( ssl, level, __FILE__, __LINE__, ecdh, attr )
81#define MBEDTLS_SSL_DEBUG_MSG( level, args ) do { } while( 0 )
82#define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) do { } while( 0 )
83#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 )
84#define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) do { } while( 0 )
85#define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) do { } while( 0 )
86#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 )
87#define MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr ) do { } while( 0 )
128 const char *file,
int line,
129 const char *format, ... );
147 const char *file,
int line,
148 const char *text,
int ret );
168 const char *file,
int line,
const char *text,
169 const unsigned char *buf,
size_t len );
171#if defined(MBEDTLS_BIGNUM_C)
189 const char *file,
int line,
193#if defined(MBEDTLS_ECP_C)
211 const char *file,
int line,
215#if defined(MBEDTLS_X509_CRT_PARSE_C)
232 const char *file,
int line,
236#if defined(MBEDTLS_ECDH_C)
239 MBEDTLS_DEBUG_ECDH_Q,
240 MBEDTLS_DEBUG_ECDH_QP,
241 MBEDTLS_DEBUG_ECDH_Z,
242} mbedtls_debug_ecdh_attr;
261 const char *file,
int line,
263 mbedtls_debug_ecdh_attr attr );
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_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.
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.
This file provides an API for Elliptic Curves over GF(P) (ECP).
The ECDH context structure.
The ECP point structure, in Jacobian coordinates.
Container for an X.509 certificate.