From 16bf0e234663936ff533292ef64fba7001f694dc Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 4 Jun 2020 13:27:34 +0100 Subject: [PATCH] Fix debug print of explicit IV The previous version attempted to write the explicit IV from the destination buffer before it has been written there. Signed-off-by: Hanno Becker --- library/ssl_msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ssl_msg.c b/library/ssl_msg.c index 33e9a4ef7..26f30b5d1 100644 --- a/library/ssl_msg.c +++ b/library/ssl_msg.c @@ -853,8 +853,8 @@ int mbedtls_ssl_encrypt_buf( mbedtls_ssl_context *ssl, MBEDTLS_SSL_DEBUG_BUF( 4, "IV used (internal)", iv, transform->ivlen ); MBEDTLS_SSL_DEBUG_BUF( 4, "IV used (transmitted)", - data - dynamic_iv_len * dynamic_iv_is_explicit, - dynamic_iv_len * dynamic_iv_is_explicit ); + dynamic_iv, + dynamic_iv_is_explicit ? dynamic_iv_len : 0 ); MBEDTLS_SSL_DEBUG_BUF( 4, "additional data used for AEAD", add_data, add_data_len ); MBEDTLS_SSL_DEBUG_MSG( 3, ( "before encrypt: msglen = %d, "