tls13: Fix/Improve comments

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2024-02-14 11:28:05 +01:00
parent 84dfbf488a
commit b9a9b1f5a5
3 changed files with 30 additions and 32 deletions

View file

@ -1657,31 +1657,31 @@ struct mbedtls_ssl_context {
#endif /* MBEDTLS_SSL_RENEGOTIATION */ #endif /* MBEDTLS_SSL_RENEGOTIATION */
/** /**
* Maximum TLS version to be negotiated, then negotiated TLS version. * Maximum TLS version to be negotiated, then negotiated TLS version.
* *
* It is initialized as the configured maximum TLS version to be * It is initialized as the configured maximum TLS version to be
* negotiated by mbedtls_ssl_setup(). * negotiated by mbedtls_ssl_setup().
* *
* When renegotiating or resuming a session, it is overwritten in the * When renegotiating or resuming a session, it is overwritten in the
* ClientHello writing preparation stage with the previously negotiated * ClientHello writing preparation stage with the previously negotiated
* TLS version. * TLS version.
* *
* On client side, it is updated to the TLS version selected by the server * On client side, it is updated to the TLS version selected by the server
* for the handshake when the ServerHello is received. * for the handshake when the ServerHello is received.
* *
* On server side, it is updated to the TLS version the server selects for * On server side, it is updated to the TLS version the server selects for
* the handshake when the ClientHello is received. * the handshake when the ClientHello is received.
*/ */
mbedtls_ssl_protocol_version MBEDTLS_PRIVATE(tls_version); mbedtls_ssl_protocol_version MBEDTLS_PRIVATE(tls_version);
#if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_CLI_C) #if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_CLI_C)
/** /**
* Status of the negotiation of the use of early data. * Status of the negotiation of the use of early data.
* See the documentation of mbedtls_ssl_get_early_data_status() for more * See the documentation of mbedtls_ssl_get_early_data_status() for more
* information. * information.
* *
* Reset to #MBEDTLS_SSL_EARLY_DATA_STATUS_NOT_SENT when the context is * Reset to #MBEDTLS_SSL_EARLY_DATA_STATUS_UNKNOWN when the context is
* reset. * reset.
*/ */
int MBEDTLS_PRIVATE(early_data_status); int MBEDTLS_PRIVATE(early_data_status);
#endif #endif

View file

@ -665,21 +665,21 @@ struct mbedtls_ssl_handshake_params {
#if defined(MBEDTLS_SSL_CLI_C) #if defined(MBEDTLS_SSL_CLI_C)
/** Minimum TLS version to be negotiated. /** Minimum TLS version to be negotiated.
* *
* It is set up in the ClientHello writing preparation stage and used * It is set up in the ClientHello writing preparation stage and used
* throughout the ClientHello writing. Not relevant anymore as soon as * throughout the ClientHello writing. Not relevant anymore as soon as
* the protocol version has been negotiated thus as soon as the * the protocol version has been negotiated thus as soon as the
* ServerHello is received. * ServerHello is received.
* For a fresh handshake not linked to any previous handshake, it is * For a fresh handshake not linked to any previous handshake, it is
* equal to the configured minimum minor version to be negotiated. When * equal to the configured minimum minor version to be negotiated. When
* renegotiating or resuming a session, it is equal to the previously * renegotiating or resuming a session, it is equal to the previously
* negotiated minor version. * negotiated minor version.
* *
* There is no maximum TLS version field in this handshake context. * There is no maximum TLS version field in this handshake context.
* From the start of the handshake, we need to define a current protocol * From the start of the handshake, we need to define a current protocol
* version for the record layer which we define as the maximum TLS * version for the record layer which we define as the maximum TLS
* version to be negotiated. The `tls_version` field of the SSL context is * version to be negotiated. The `tls_version` field of the SSL context is
* used to store this maximum value until it contains the actual * used to store this maximum value until it contains the actual
* negotiated value. * negotiated value.
*/ */
mbedtls_ssl_protocol_version min_tls_version; mbedtls_ssl_protocol_version min_tls_version;
#endif #endif

View file

@ -607,9 +607,7 @@ int mbedtls_test_get_tls13_ticket(
mbedtls_test_handshake_test_options *client_options, mbedtls_test_handshake_test_options *client_options,
mbedtls_test_handshake_test_options *server_options, mbedtls_test_handshake_test_options *server_options,
mbedtls_ssl_session *session); mbedtls_ssl_session *session);
#endif /* MBEDTLS_SSL_CLI_C && MBEDTLS_SSL_SRV_C && #endif
MBEDTLS_SSL_PROTO_TLS1_3 && MBEDTLS_SSL_SESSION_TICKETS &&
MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED */
#define ECJPAKE_TEST_PWD "bla" #define ECJPAKE_TEST_PWD "bla"