From 28e5f1ed579b41d189a00f4a765f6e5a170db542 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 26 May 2021 09:29:49 +0100 Subject: [PATCH] Avoid unused variable warning in TLS 1.3 PSK binder calculation Signed-off-by: Hanno Becker --- library/ssl_tls13_keys.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/ssl_tls13_keys.c b/library/ssl_tls13_keys.c index 950d32cb9..78a55812d 100644 --- a/library/ssl_tls13_keys.c +++ b/library/ssl_tls13_keys.c @@ -628,6 +628,11 @@ int mbedtls_ssl_tls1_3_create_psk_binder( mbedtls_ssl_context *ssl, mbedtls_md_info_t const *md_info = mbedtls_md_info_from_type( md_type ); size_t const md_size = mbedtls_md_get_size( md_info ); +#if !defined(MBEDTLS_DEBUG_C) + ssl = NULL; /* make sure we don't use it except for debug */ + ((void) ssl); +#endif + /* We should never call this function with an unknown hash, * but add an assertion anyway. */ if( md_info == 0 )