From 56d5eaa96c94725df8dc94702e48b4e3eff74911 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Fri, 17 Aug 2018 09:06:31 +0100 Subject: [PATCH] Mark SSL ctx unused in ssl_prepare_reassembly_buffer() if !DEBUG The SSL context is passed to the reassembly preparation function ssl_prepare_reassembly_buffer() solely for the purpose of allowing debugging output. This commit marks the context as unused if debugging is disabled (through !MBEDTLS_DEBUG_C). --- library/ssl_tls.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 85ed1e51c7..c00c974962 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -3531,6 +3531,11 @@ static int ssl_prepare_reassembly_buffer( mbedtls_ssl_context *ssl, /* debug */ size_t alloc_len; unsigned char *buf; +#if !defined(MBEDTLS_DEBUG_C) + /* The SSL context is used for debugging only. */ + ((void) ssl); +#endif + MBEDTLS_SSL_DEBUG_MSG( 2, ( "initialize reassembly, total length = %d", msg_len ) );