mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Remove useless prepare_write_end_of_early_data
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
@ -2149,34 +2149,6 @@ static int ssl_tls13_write_end_of_early_data_coordinate(
|
|||||||
return SSL_END_OF_EARLY_DATA_SKIP;
|
return SSL_END_OF_EARLY_DATA_SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
MBEDTLS_CHECK_RETURN_CRITICAL
|
|
||||||
static int ssl_tls13_prepare_end_of_early_data(mbedtls_ssl_context *ssl)
|
|
||||||
{
|
|
||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
|
||||||
|
|
||||||
/* Start the TLS 1.3 key schedule: Set the PSK and derive early secret. */
|
|
||||||
ret = mbedtls_ssl_tls13_key_schedule_stage_early(ssl);
|
|
||||||
if (ret != 0) {
|
|
||||||
MBEDTLS_SSL_DEBUG_RET(1,
|
|
||||||
"mbedtls_ssl_tls13_key_schedule_stage_early", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Derive 0-RTT key material */
|
|
||||||
ret = mbedtls_ssl_tls13_compute_early_transform(ssl);
|
|
||||||
if (ret != 0) {
|
|
||||||
MBEDTLS_SSL_DEBUG_RET(1,
|
|
||||||
"mbedtls_ssl_tls13_compute_early_transform", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Activate transform */
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG(1, ("Switch to early data keys for outbound traffic"));
|
|
||||||
mbedtls_ssl_set_outbound_transform(ssl, ssl->handshake->transform_earlydata);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
MBEDTLS_CHECK_RETURN_CRITICAL
|
MBEDTLS_CHECK_RETURN_CRITICAL
|
||||||
static int ssl_tls13_finalize_write_end_of_early_data(
|
static int ssl_tls13_finalize_write_end_of_early_data(
|
||||||
mbedtls_ssl_context *ssl)
|
mbedtls_ssl_context *ssl)
|
||||||
@ -2203,7 +2175,6 @@ static int ssl_tls13_write_end_of_early_data(mbedtls_ssl_context *ssl)
|
|||||||
unsigned char *buf = NULL;
|
unsigned char *buf = NULL;
|
||||||
size_t buf_len;
|
size_t buf_len;
|
||||||
|
|
||||||
MBEDTLS_SSL_PROC_CHK(ssl_tls13_prepare_end_of_early_data(ssl));
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG(2, ("Client write EndOfEarlyData"));
|
MBEDTLS_SSL_DEBUG_MSG(2, ("Client write EndOfEarlyData"));
|
||||||
|
|
||||||
MBEDTLS_SSL_PROC_CHK(mbedtls_ssl_start_handshake_msg(
|
MBEDTLS_SSL_PROC_CHK(mbedtls_ssl_start_handshake_msg(
|
||||||
@ -2216,7 +2187,6 @@ static int ssl_tls13_write_end_of_early_data(mbedtls_ssl_context *ssl)
|
|||||||
mbedtls_ssl_finish_handshake_msg(ssl, buf_len, 0));
|
mbedtls_ssl_finish_handshake_msg(ssl, buf_len, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update state */
|
|
||||||
MBEDTLS_SSL_PROC_CHK(
|
MBEDTLS_SSL_PROC_CHK(
|
||||||
ssl_tls13_finalize_write_end_of_early_data(ssl));
|
ssl_tls13_finalize_write_end_of_early_data(ssl));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user