mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-11 09:40:38 +00:00
tls13: cli: Rename STATE_UNKNOWN to STATE_IDLE
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
d2884662c1
commit
05d7cfbd9c
@ -750,10 +750,10 @@ typedef enum {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/*
|
/*
|
||||||
* The client has not sent the first ClientHello yet, it is unknown if the
|
* The client has not sent the first ClientHello yet, the negotiation of early
|
||||||
* client will send an early data indication extension or not.
|
* data has not started yet.
|
||||||
*/
|
*/
|
||||||
MBEDTLS_SSL_EARLY_DATA_STATE_UNKNOWN,
|
MBEDTLS_SSL_EARLY_DATA_STATE_IDLE,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The client has not indicated the use of early data to the server.
|
* The client has not indicated the use of early data to the server.
|
||||||
@ -1756,7 +1756,7 @@ struct mbedtls_ssl_context {
|
|||||||
#if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_CLI_C)
|
#if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_CLI_C)
|
||||||
/**
|
/**
|
||||||
* State of the negotiation and transfer of early data. Reset to
|
* State of the negotiation and transfer of early data. Reset to
|
||||||
* MBEDTLS_SSL_EARLY_DATA_STATE_UNKNOWN when the context is reset.
|
* MBEDTLS_SSL_EARLY_DATA_STATE_IDLE when the context is reset.
|
||||||
*/
|
*/
|
||||||
mbedtls_ssl_early_data_state MBEDTLS_PRIVATE(early_data_state);
|
mbedtls_ssl_early_data_state MBEDTLS_PRIVATE(early_data_state);
|
||||||
#endif
|
#endif
|
||||||
|
@ -6098,7 +6098,7 @@ int mbedtls_ssl_write_early_data(mbedtls_ssl_context *ssl,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If we are at the beginning of the handshake, the early data state being
|
* If we are at the beginning of the handshake, the early data state being
|
||||||
* equal to MBEDTLS_SSL_EARLY_DATA_STATE_UNKNOWN or
|
* equal to MBEDTLS_SSL_EARLY_DATA_STATE_IDLE or
|
||||||
* MBEDTLS_SSL_EARLY_DATA_STATE_SENT advance the handshake just
|
* MBEDTLS_SSL_EARLY_DATA_STATE_SENT advance the handshake just
|
||||||
* enough to be able to send early data if possible. That way, we can
|
* enough to be able to send early data if possible. That way, we can
|
||||||
* guarantee that when starting the handshake with this function we will
|
* guarantee that when starting the handshake with this function we will
|
||||||
@ -6108,9 +6108,9 @@ int mbedtls_ssl_write_early_data(mbedtls_ssl_context *ssl,
|
|||||||
* as the early data outbound transform has not been set as we may have to
|
* as the early data outbound transform has not been set as we may have to
|
||||||
* first send a dummy CCS in clear.
|
* first send a dummy CCS in clear.
|
||||||
*/
|
*/
|
||||||
if ((ssl->early_data_state == MBEDTLS_SSL_EARLY_DATA_STATE_UNKNOWN) ||
|
if ((ssl->early_data_state == MBEDTLS_SSL_EARLY_DATA_STATE_IDLE) ||
|
||||||
(ssl->early_data_state == MBEDTLS_SSL_EARLY_DATA_STATE_SENT)) {
|
(ssl->early_data_state == MBEDTLS_SSL_EARLY_DATA_STATE_SENT)) {
|
||||||
while ((ssl->early_data_state == MBEDTLS_SSL_EARLY_DATA_STATE_UNKNOWN) ||
|
while ((ssl->early_data_state == MBEDTLS_SSL_EARLY_DATA_STATE_IDLE) ||
|
||||||
(ssl->early_data_state == MBEDTLS_SSL_EARLY_DATA_STATE_SENT)) {
|
(ssl->early_data_state == MBEDTLS_SSL_EARLY_DATA_STATE_SENT)) {
|
||||||
ret = mbedtls_ssl_handshake_step(ssl);
|
ret = mbedtls_ssl_handshake_step(ssl);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
@ -1096,7 +1096,7 @@ static int ssl_handshake_init(mbedtls_ssl_context *ssl)
|
|||||||
|
|
||||||
#if defined(MBEDTLS_SSL_EARLY_DATA)
|
#if defined(MBEDTLS_SSL_EARLY_DATA)
|
||||||
#if defined(MBEDTLS_SSL_CLI_C)
|
#if defined(MBEDTLS_SSL_CLI_C)
|
||||||
ssl->early_data_state = MBEDTLS_SSL_EARLY_DATA_STATE_UNKNOWN;
|
ssl->early_data_state = MBEDTLS_SSL_EARLY_DATA_STATE_IDLE;
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_SSL_SRV_C)
|
#if defined(MBEDTLS_SSL_SRV_C)
|
||||||
ssl->discard_early_data_record = MBEDTLS_SSL_EARLY_DATA_NO_DISCARD;
|
ssl->discard_early_data_record = MBEDTLS_SSL_EARLY_DATA_NO_DISCARD;
|
||||||
|
@ -3904,13 +3904,13 @@ void tls13_cli_early_data_state(int scenario)
|
|||||||
case TEST_EARLY_DATA_NO_INDICATION_SENT: /* Intentional fallthrough */
|
case TEST_EARLY_DATA_NO_INDICATION_SENT: /* Intentional fallthrough */
|
||||||
case TEST_EARLY_DATA_SERVER_REJECTS:
|
case TEST_EARLY_DATA_SERVER_REJECTS:
|
||||||
TEST_EQUAL(client_ep.ssl.early_data_state,
|
TEST_EQUAL(client_ep.ssl.early_data_state,
|
||||||
MBEDTLS_SSL_EARLY_DATA_STATE_UNKNOWN);
|
MBEDTLS_SSL_EARLY_DATA_STATE_IDLE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TEST_EARLY_DATA_HRR:
|
case TEST_EARLY_DATA_HRR:
|
||||||
if (!client_ep.ssl.handshake->hello_retry_request_flag) {
|
if (!client_ep.ssl.handshake->hello_retry_request_flag) {
|
||||||
TEST_EQUAL(client_ep.ssl.early_data_state,
|
TEST_EQUAL(client_ep.ssl.early_data_state,
|
||||||
MBEDTLS_SSL_EARLY_DATA_STATE_UNKNOWN);
|
MBEDTLS_SSL_EARLY_DATA_STATE_IDLE);
|
||||||
} else {
|
} else {
|
||||||
TEST_EQUAL(client_ep.ssl.early_data_state,
|
TEST_EQUAL(client_ep.ssl.early_data_state,
|
||||||
MBEDTLS_SSL_EARLY_DATA_STATE_REJECTED);
|
MBEDTLS_SSL_EARLY_DATA_STATE_REJECTED);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user