mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Fix key_len check in TLS-Exporter
The length of the generated key must fit into a uint16_t, so it must not be larger than 0xffff. Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
This commit is contained in:
@ -10111,7 +10111,7 @@ static int mbedtls_ssl_tls13_export_keying_material(mbedtls_ssl_context *ssl,
|
|||||||
const size_t hash_len = PSA_HASH_LENGTH(hash_alg);
|
const size_t hash_len = PSA_HASH_LENGTH(hash_alg);
|
||||||
const unsigned char *secret = ssl->session->app_secrets.exporter_master_secret;
|
const unsigned char *secret = ssl->session->app_secrets.exporter_master_secret;
|
||||||
|
|
||||||
if (key_len > 0xff || label_len > 250) {
|
if (key_len > 0xffff || label_len > 250) {
|
||||||
return MBEDTLS_ERR_SSL_BAD_INPUT_DATA;
|
return MBEDTLS_ERR_SSL_BAD_INPUT_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user