From e1801399a9a3513ed9189ba9399daca26338aac3 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 21 Aug 2018 16:51:05 +0100 Subject: [PATCH] Add another debug message to ssl_buffer_message() Report if there's not enough buffering space available to reassemble the next expected incoming message. --- library/ssl_tls.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index d0d5d72c5..bb4c0000c 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -4533,6 +4533,12 @@ static int ssl_buffer_message( mbedtls_ssl_context *ssl ) (unsigned) hs->buffering.total_bytes_buffered ) ); goto exit; } + else + { + MBEDTLS_SSL_DEBUG_MSG( 2, ( "Buffering of future message of size %u would exceed the compile-time limit %u (already %u bytes buffered) -- attempt to make space by freeing buffered future messages\n", + (unsigned) msg_len, MBEDTLS_SSL_DTLS_MAX_BUFFERING, + (unsigned) hs->buffering.total_bytes_buffered ) ); + } /* We don't have enough space to buffer the next expected * handshake message. Remove buffers used for future msgs