From 28a0c4e149fdc8c9e4ad3d3226b7be7435e3675f Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 20 May 2019 14:54:26 +0100 Subject: [PATCH] Reduce stack usage for additional data buffers in record dec/enc --- library/ssl_tls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 6ad6f0876..ea8db8c92 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -1675,7 +1675,7 @@ int mbedtls_ssl_encrypt_buf( mbedtls_ssl_context *ssl, mbedtls_cipher_mode_t mode; int auth_done = 0; unsigned char * data; - unsigned char add_data[13 + 1 + MBEDTLS_SSL_CID_LEN_MAX ]; + unsigned char add_data[13 + 1 + MBEDTLS_SSL_CID_OUT_LEN_MAX ]; size_t add_data_len; size_t post_avail; @@ -2115,7 +2115,7 @@ int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context *ssl, size_t padlen = 0, correct = 1; #endif unsigned char* data; - unsigned char add_data[13 + 1 + MBEDTLS_SSL_CID_LEN_MAX ]; + unsigned char add_data[13 + 1 + MBEDTLS_SSL_CID_IN_LEN_MAX ]; size_t add_data_len; #if !defined(MBEDTLS_DEBUG_C)