From 199a15645dd6508123d60489a2a47ddfaa08a6a7 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Tue, 27 May 2025 09:56:27 +0200 Subject: [PATCH] library: debug: make mbedtls_debug_print_ecp() internal Remove the public definition of mbedtls_debug_print_ecp(). The function is only used internally in debug.c, so we can then make the function static. Signed-off-by: Valerio Setti --- include/mbedtls/debug.h | 5 ----- library/debug.c | 6 +++--- library/debug_internal.h | 22 ---------------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/include/mbedtls/debug.h b/include/mbedtls/debug.h index b6c4e0ecb5..b6d4e27052 100644 --- a/include/mbedtls/debug.h +++ b/include/mbedtls/debug.h @@ -37,11 +37,6 @@ mbedtls_debug_print_mpi(ssl, level, __FILE__, __LINE__, text, X) #endif -#if defined(MBEDTLS_ECP_C) -#define MBEDTLS_SSL_DEBUG_ECP(level, text, X) \ - mbedtls_debug_print_ecp(ssl, level, __FILE__, __LINE__, text, X) -#endif - #if defined(MBEDTLS_X509_CRT_PARSE_C) #if !defined(MBEDTLS_X509_REMOVE_INFO) #define MBEDTLS_SSL_DEBUG_CRT(level, text, crt) \ diff --git a/library/debug.c b/library/debug.c index 71e0642590..d36b041d56 100644 --- a/library/debug.c +++ b/library/debug.c @@ -168,9 +168,9 @@ void mbedtls_debug_print_buf(const mbedtls_ssl_context *ssl, int level, } #if defined(MBEDTLS_ECP_LIGHT) -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) +static 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) { char str[DEBUG_BUF_SIZE]; diff --git a/library/debug_internal.h b/library/debug_internal.h index 31dd08ded6..3ffcee12bc 100644 --- a/library/debug_internal.h +++ b/library/debug_internal.h @@ -93,28 +93,6 @@ void mbedtls_debug_print_mpi(const mbedtls_ssl_context *ssl, int level, const char *text, const mbedtls_mpi *X); #endif -#if defined(MBEDTLS_ECP_LIGHT) -/** - * \brief Print an ECP point to the debug output. This function is always - * used through the MBEDTLS_SSL_DEBUG_ECP() macro, which supplies the - * ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the ECP point being output. Normally the - * variable name - * \param X the ECP point - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -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); -#endif - #if defined(MBEDTLS_X509_CRT_PARSE_C) && !defined(MBEDTLS_X509_REMOVE_INFO) /** * \brief Print a X.509 certificate structure to the debug output. This