1 /**
2  * \file ssl_debug_helpers.h
3  *
4  * \brief Automatically generated helper functions for debugging
5  */
6 /*
7  *  Copyright The Mbed TLS Contributors
8  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9  */
10 
11 #ifndef MBEDTLS_SSL_DEBUG_HELPERS_H
12 #define MBEDTLS_SSL_DEBUG_HELPERS_H
13 
14 #include "common.h"
15 
16 #if defined(MBEDTLS_DEBUG_C)
17 
18 #include "mbedtls/ssl.h"
19 #include "ssl_misc.h"
20 
21 
22 const char *mbedtls_ssl_states_str(mbedtls_ssl_states in);
23 
24 const char *mbedtls_ssl_protocol_version_str(mbedtls_ssl_protocol_version in);
25 
26 const char *mbedtls_tls_prf_types_str(mbedtls_tls_prf_types in);
27 
28 const char *mbedtls_ssl_key_export_type_str(mbedtls_ssl_key_export_type in);
29 
30 const char *mbedtls_ssl_sig_alg_to_str(uint16_t in);
31 
32 const char *mbedtls_ssl_named_group_to_str(uint16_t in);
33 
34 const char *mbedtls_ssl_get_extension_name(unsigned int extension_type);
35 
36 void mbedtls_ssl_print_extensions(const mbedtls_ssl_context *ssl,
37                                   int level, const char *file, int line,
38                                   int hs_msg_type, uint32_t extensions_mask,
39                                   const char *extra);
40 
41 void mbedtls_ssl_print_extension(const mbedtls_ssl_context *ssl,
42                                  int level, const char *file, int line,
43                                  int hs_msg_type, unsigned int extension_type,
44                                  const char *extra_msg0, const char *extra_msg1);
45 
46 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
47 void mbedtls_ssl_print_ticket_flags(const mbedtls_ssl_context *ssl,
48                                     int level, const char *file, int line,
49                                     unsigned int flags);
50 #endif /* MBEDTLS_SSL_PROTO_TLS1_3 && MBEDTLS_SSL_SESSION_TICKETS */
51 
52 #define MBEDTLS_SSL_PRINT_EXTS(level, hs_msg_type, extensions_mask)            \
53     mbedtls_ssl_print_extensions(ssl, level, __FILE__, __LINE__,       \
54                                  hs_msg_type, extensions_mask, NULL)
55 
56 #define MBEDTLS_SSL_PRINT_EXT(level, hs_msg_type, extension_type, extra)      \
57     mbedtls_ssl_print_extension(ssl, level, __FILE__, __LINE__,        \
58                                 hs_msg_type, extension_type,           \
59                                 extra, NULL)
60 
61 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
62 #define MBEDTLS_SSL_PRINT_TICKET_FLAGS(level, flags)             \
63     mbedtls_ssl_print_ticket_flags(ssl, level, __FILE__, __LINE__, flags)
64 #endif
65 
66 #else
67 
68 #define MBEDTLS_SSL_PRINT_EXTS(level, hs_msg_type, extension_mask)
69 
70 #define MBEDTLS_SSL_PRINT_EXT(level, hs_msg_type, extension_type, extra)
71 
72 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
73 #define MBEDTLS_SSL_PRINT_TICKET_FLAGS(level, flags)
74 #endif
75 
76 #endif /* MBEDTLS_DEBUG_C */
77 
78 #endif /* MBEDTLS_SSL_DEBUG_HELPERS_H */
79