RetroArch
debug.h
Go to the documentation of this file.
1 
23 #ifndef MBEDTLS_DEBUG_H
24 #define MBEDTLS_DEBUG_H
25 
26 #if !defined(MBEDTLS_CONFIG_FILE)
27 #include "config.h"
28 #else
29 #include MBEDTLS_CONFIG_FILE
30 #endif
31 
32 #include "ssl.h"
33 
34 #if defined(MBEDTLS_ECP_C)
35 #include "ecp.h"
36 #endif
37 
38 #if defined(MBEDTLS_DEBUG_C)
39 
40 #define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__
41 
42 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) \
43  mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \
44  MBEDTLS_DEBUG_STRIP_PARENS args )
45 
46 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) \
47  mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret )
48 
49 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) \
50  mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len )
51 
52 #if defined(MBEDTLS_BIGNUM_C)
53 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) \
54  mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X )
55 #endif
56 
57 #if defined(MBEDTLS_ECP_C)
58 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) \
59  mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X )
60 #endif
61 
62 #if defined(MBEDTLS_X509_CRT_PARSE_C)
63 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) \
64  mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt )
65 #endif
66 
67 #else /* MBEDTLS_DEBUG_C */
68 
69 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) do { } while( 0 )
70 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) do { } while( 0 )
71 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 )
72 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) do { } while( 0 )
73 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) do { } while( 0 )
74 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 )
75 
76 #endif /* MBEDTLS_DEBUG_C */
77 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 
97 void mbedtls_debug_set_threshold( int threshold );
98 
115  const char *file, int line,
116  const char *format, ... );
117 
134  const char *file, int line,
135  const char *text, int ret );
136 
155  const char *file, int line, const char *text,
156  const unsigned char *buf, size_t len );
157 
158 #if defined(MBEDTLS_BIGNUM_C)
159 
176  const char *file, int line,
177  const char *text, const mbedtls_mpi *X );
178 #endif
179 
180 #if defined(MBEDTLS_ECP_C)
181 
198  const char *file, int line,
199  const char *text, const mbedtls_ecp_point *X );
200 #endif
201 
202 #if defined(MBEDTLS_X509_CRT_PARSE_C)
203 
219  const char *file, int line,
220  const char *text, const mbedtls_x509_crt *crt );
221 #endif
222 
223 #ifdef __cplusplus
224 }
225 #endif
226 
227 #endif /* debug.h */
228 
Elliptic curves over GF(p)
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...
Definition: debug.c:147
Definition: x509_crt.h:52
Configuration options (set of defines)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
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...
Definition: debug.c:202
GLenum GLsizei len
Definition: glext.h:7389
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_...
Definition: debug.c:220
SSL/TLS functions.
GLint level
Definition: glext.h:6293
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...
Definition: debug.c:55
ECP point structure (jacobian coordinates)
Definition: ecp.h:106
MPI structure.
Definition: bignum.h:179
Definition: ssl.h:763
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glext.h:6293
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...
Definition: debug.c:347
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()...
Definition: debug.c:81
#define X(a, b)
Definition: bba.c:185
Definition: civetweb.c:1024
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...
Definition: debug.c:124