You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
mbedTLS: Update to version 2.18.5
(cherry picked from commit 5333365593)
This commit is contained in:
committed by
Rémi Verschelde
parent
fe79dc90fc
commit
b4240ea1a7
13
thirdparty/mbedtls/library/ssl_msg.c
vendored
13
thirdparty/mbedtls/library/ssl_msg.c
vendored
@@ -1149,6 +1149,14 @@ int mbedtls_ssl_decrypt_buf(mbedtls_ssl_context const *ssl,
|
||||
|
||||
#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER)
|
||||
if (mode == MBEDTLS_MODE_STREAM) {
|
||||
if (rec->data_len < transform->maclen) {
|
||||
MBEDTLS_SSL_DEBUG_MSG(1,
|
||||
("Record too short for MAC:"
|
||||
" %" MBEDTLS_PRINTF_SIZET " < %" MBEDTLS_PRINTF_SIZET,
|
||||
rec->data_len, transform->maclen));
|
||||
return MBEDTLS_ERR_SSL_INVALID_MAC;
|
||||
}
|
||||
|
||||
padlen = 0;
|
||||
if ((ret = mbedtls_cipher_crypt(&transform->cipher_ctx_dec,
|
||||
transform->iv_dec,
|
||||
@@ -1561,7 +1569,7 @@ hmac_failed_etm_enabled:
|
||||
unsigned char mac_expect[MBEDTLS_SSL_MAC_ADD] = { 0 };
|
||||
unsigned char mac_peer[MBEDTLS_SSL_MAC_ADD] = { 0 };
|
||||
|
||||
/* If the initial value of padlen was such that
|
||||
/* For CBC+MAC, If the initial value of padlen was such that
|
||||
* data_len < maclen + padlen + 1, then padlen
|
||||
* got reset to 1, and the initial check
|
||||
* data_len >= minlen + maclen + 1
|
||||
@@ -1573,6 +1581,9 @@ hmac_failed_etm_enabled:
|
||||
* subtracted either padlen + 1 (if the padding was correct)
|
||||
* or 0 (if the padding was incorrect) since then,
|
||||
* hence data_len >= maclen in any case.
|
||||
*
|
||||
* For stream ciphers, we checked above that
|
||||
* data_len >= maclen.
|
||||
*/
|
||||
rec->data_len -= transform->maclen;
|
||||
ssl_extract_add_data_from_record(add_data, &add_data_len, rec,
|
||||
|
||||
Reference in New Issue
Block a user