mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Add hello retry request count for server
Signed-off-by: XiaokangQian <xiaokang.qian@arm.com>
This commit is contained in:
@ -585,6 +585,10 @@ struct mbedtls_ssl_handshake_params
|
|||||||
/*!< Number of Hello Retry Request messages received from the server. */
|
/*!< Number of Hello Retry Request messages received from the server. */
|
||||||
int hello_retry_request_count;
|
int hello_retry_request_count;
|
||||||
#endif /* MBEDTLS_SSL_CLI_C */
|
#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) && \
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
|
||||||
defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
|
defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
|
||||||
|
@ -886,7 +886,7 @@ static int ssl_client_hello_postprocess( mbedtls_ssl_context* ssl,
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
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 )
|
ssl->conf->rr_config == MBEDTLS_SSL_FORCE_RR_CHECK_ON )
|
||||||
{
|
{
|
||||||
hrr_required = SSL_CLIENT_HELLO_HRR_REQUIRED;
|
hrr_required = SSL_CLIENT_HELLO_HRR_REQUIRED;
|
||||||
@ -946,7 +946,7 @@ int mbedtls_ssl_tls13_handshake_server_step( mbedtls_ssl_context *ssl )
|
|||||||
{
|
{
|
||||||
/* start state */
|
/* start state */
|
||||||
case MBEDTLS_SSL_HELLO_REQUEST:
|
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 );
|
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CLIENT_HELLO );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user