Reduce stack usage for additional data buffers in record dec/enc

This commit is contained in:
Hanno Becker 2019-05-20 14:54:26 +01:00
parent c4a190bb0f
commit 92fb4fa802

View file

@ -2097,7 +2097,7 @@ int mbedtls_ssl_encrypt_buf( mbedtls_ssl_context *ssl,
mbedtls_cipher_mode_t mode; mbedtls_cipher_mode_t mode;
int auth_done = 0; int auth_done = 0;
unsigned char * data; 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 add_data_len;
size_t post_avail; size_t post_avail;
@ -2537,7 +2537,7 @@ int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context *ssl,
size_t padlen = 0, correct = 1; size_t padlen = 0, correct = 1;
#endif #endif
unsigned char* data; 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; size_t add_data_len;
#if !defined(MBEDTLS_DEBUG_C) #if !defined(MBEDTLS_DEBUG_C)