mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Increase allowed output size of HKDF-Expand-Label
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
This commit is contained in:
@ -109,15 +109,13 @@ static void ssl_tls13_hkdf_encode_label(
|
||||
|
||||
unsigned char *p = dst;
|
||||
|
||||
/* Add the size of the expanded key material.
|
||||
* We're hardcoding the high byte to 0 here assuming that we never use
|
||||
* TLS 1.3 HKDF key expansion to more than 255 Bytes. */
|
||||
#if MBEDTLS_SSL_TLS1_3_KEY_SCHEDULE_MAX_EXPANSION_LEN > 255
|
||||
#error "The implementation of ssl_tls13_hkdf_encode_label() is not fit for the \
|
||||
value of MBEDTLS_SSL_TLS1_3_KEY_SCHEDULE_MAX_EXPANSION_LEN"
|
||||
/* Add the size of the expanded key material. */
|
||||
#if MBEDTLS_SSL_TLS1_3_KEY_SCHEDULE_MAX_EXPANSION_LEN > UINT16_MAX
|
||||
#error "The desired key length must fit into an uint16 but \
|
||||
MBEDTLS_SSL_TLS1_3_KEY_SCHEDULE_MAX_EXPANSION_LEN is greater than UINT16_MAX"
|
||||
#endif
|
||||
|
||||
*p++ = 0;
|
||||
*p++ = MBEDTLS_BYTE_1(desired_length);
|
||||
*p++ = MBEDTLS_BYTE_0(desired_length);
|
||||
|
||||
/* Add label incl. prefix */
|
||||
|
Reference in New Issue
Block a user