set init value for max_early_data_size in session

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2023-11-15 14:51:18 +08:00
parent db6fda71e5
commit 525990fb62
2 changed files with 6 additions and 0 deletions

View file

@ -1100,6 +1100,9 @@ static int ssl_handshake_init(mbedtls_ssl_context *ssl)
/* Initialize structures */
mbedtls_ssl_session_init(ssl->session_negotiate);
ssl_handshake_params_init(ssl->handshake);
#if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_SRV_C)
ssl->session_negotiate->max_early_data_size = ssl->conf->max_early_data_size;
#endif
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
mbedtls_ssl_transform_init(ssl->transform_negotiate);

View file

@ -564,6 +564,9 @@ static int ssl_tls13_parse_pre_shared_key_ext(
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
mbedtls_ssl_session session;
mbedtls_ssl_session_init(&session);
#if defined(MBEDTLS_SSL_EARLY_DATA)
session.max_early_data_size = ssl->conf->max_early_data_size;
#endif
#endif
MBEDTLS_SSL_CHK_BUF_READ_PTR(p_identity_len, identities_end, 2 + 1 + 4);