ssl_debug_helpers.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  11. * not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  18. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. */
  22. #ifndef MBEDTLS_SSL_DEBUG_HELPERS_H
  23. #define MBEDTLS_SSL_DEBUG_HELPERS_H
  24. #include "common.h"
  25. #if defined(MBEDTLS_DEBUG_C)
  26. #include "mbedtls/ssl.h"
  27. #include "ssl_misc.h"
  28. const char *mbedtls_ssl_states_str(mbedtls_ssl_states in);
  29. const char *mbedtls_ssl_protocol_version_str(mbedtls_ssl_protocol_version in);
  30. const char *mbedtls_tls_prf_types_str(mbedtls_tls_prf_types in);
  31. const char *mbedtls_ssl_key_export_type_str(mbedtls_ssl_key_export_type in);
  32. const char *mbedtls_ssl_sig_alg_to_str(uint16_t in);
  33. const char *mbedtls_ssl_named_group_to_str(uint16_t in);
  34. const char *mbedtls_ssl_get_extension_name(unsigned int extension_type);
  35. void mbedtls_ssl_print_extensions(const mbedtls_ssl_context *ssl,
  36. int level, const char *file, int line,
  37. int hs_msg_type, uint32_t extensions_mask,
  38. const char *extra);
  39. void mbedtls_ssl_print_extension(const mbedtls_ssl_context *ssl,
  40. int level, const char *file, int line,
  41. int hs_msg_type, unsigned int extension_type,
  42. const char *extra_msg0, const char *extra_msg1);
  43. #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
  44. void mbedtls_ssl_print_ticket_flags(const mbedtls_ssl_context *ssl,
  45. int level, const char *file, int line,
  46. unsigned int flags);
  47. #endif /* MBEDTLS_SSL_PROTO_TLS1_3 && MBEDTLS_SSL_SESSION_TICKETS */
  48. #define MBEDTLS_SSL_PRINT_EXTS(level, hs_msg_type, extensions_mask) \
  49. mbedtls_ssl_print_extensions(ssl, level, __FILE__, __LINE__, \
  50. hs_msg_type, extensions_mask, NULL)
  51. #define MBEDTLS_SSL_PRINT_EXT(level, hs_msg_type, extension_type, extra) \
  52. mbedtls_ssl_print_extension(ssl, level, __FILE__, __LINE__, \
  53. hs_msg_type, extension_type, \
  54. extra, NULL)
  55. #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
  56. #define MBEDTLS_SSL_PRINT_TICKET_FLAGS(level, flags) \
  57. mbedtls_ssl_print_ticket_flags(ssl, level, __FILE__, __LINE__, flags)
  58. #endif
  59. #else
  60. #define MBEDTLS_SSL_PRINT_EXTS(level, hs_msg_type, extension_mask)
  61. #define MBEDTLS_SSL_PRINT_EXT(level, hs_msg_type, extension_type, extra)
  62. #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS)
  63. #define MBEDTLS_SSL_PRINT_TICKET_FLAGS(level, flags)
  64. #endif
  65. #endif /* MBEDTLS_DEBUG_C */
  66. #endif /* MBEDTLS_SSL_DEBUG_HELPERS_H */