Add hello retry request count for server

Signed-off-by: XiaokangQian <xiaokang.qian@arm.com>
This commit is contained in:
XiaokangQian 2022-02-22 04:03:26 +00:00
parent a9c58419f2
commit 7ac3ab3404
2 changed files with 6 additions and 2 deletions

View file

@ -585,6 +585,10 @@ struct mbedtls_ssl_handshake_params
/*!< Number of Hello Retry Request messages received from the server. */
int hello_retry_request_count;
#endif /* MBEDTLS_SSL_CLI_C */
#if defined(MBEDTLS_SSL_SRV_C)
/*!< Number of Hello Retry Request messages sent by the server. */
int hello_retry_requests_sent;
#endif /* MBEDTLS_SSL_SRV_C */
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)

View file

@ -886,7 +886,7 @@ static int ssl_client_hello_postprocess( mbedtls_ssl_context* ssl,
{
int ret = 0;
if( ssl->handshake->hello_retry_request_count == 0 &&
if( ssl->handshake->hello_retry_requests_sent == 0 &&
ssl->conf->rr_config == MBEDTLS_SSL_FORCE_RR_CHECK_ON )
{
hrr_required = SSL_CLIENT_HELLO_HRR_REQUIRED;
@ -946,7 +946,7 @@ int mbedtls_ssl_tls13_handshake_server_step( mbedtls_ssl_context *ssl )
{
/* start state */
case MBEDTLS_SSL_HELLO_REQUEST:
ssl->handshake->hello_retry_request_count = 0;
ssl->handshake->hello_retry_requests_sent = 0;
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CLIENT_HELLO );
break;