From e04afdc44fd23c49af9f2a7a7786958ccdd045f1 Mon Sep 17 00:00:00 2001 From: Xiaokang Qian Date: Tue, 7 Feb 2023 02:19:42 +0000 Subject: [PATCH] Refine the condition of whether re-generate early keys Signed-off-by: Xiaokang Qian --- library/ssl_tls13_client.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c index 24da11206..1ff8a2fda 100644 --- a/library/ssl_tls13_client.c +++ b/library/ssl_tls13_client.c @@ -1943,10 +1943,9 @@ static int ssl_tls13_postprocess_server_hello(mbedtls_ssl_context *ssl) * cases we compute it here. */ #if defined(MBEDTLS_SSL_EARLY_DATA) - if ((ssl->early_data_status == MBEDTLS_SSL_EARLY_DATA_STATUS_NOT_SENT) || - (ssl->early_data_status == MBEDTLS_SSL_EARLY_DATA_STATUS_REJECTED && - handshake->key_exchange_mode == - MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL)) + if (ssl->early_data_status == MBEDTLS_SSL_EARLY_DATA_STATUS_NOT_SENT || + handshake->key_exchange_mode == + MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL) #endif { ret = mbedtls_ssl_tls13_key_schedule_stage_early(ssl);