Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]fix compile error for re-introducing exists options. #293

Draft
wants to merge 10 commits into
base: tls13-prototype
Choose a base branch
from
4 changes: 4 additions & 0 deletions include/mbedtls/check_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,10 @@
#error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites"
#endif

#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_SRV_C)
#error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites"
#endif

#if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \
!defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
#error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites"
Expand Down
2 changes: 1 addition & 1 deletion include/mbedtls/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@
*
* Comment this macro to disable support for key export
*/
#define MBEDTLS_SSL_EXPORT_KEYS
//#define MBEDTLS_SSL_EXPORT_KEYS

/**
* \def MBEDTLS_SSL_SERVER_NAME_INDICATION
Expand Down
9 changes: 4 additions & 5 deletions include/mbedtls/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1137,9 +1137,6 @@ struct mbedtls_ssl_session
mbedtls_time_t start; /*!< starting time */
#endif /* MBEDTLS_HAVE_TIME */
int ciphersuite; /*!< chosen ciphersuite */
#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
const mbedtls_ssl_ciphersuite_t* ciphersuite_info;
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
int compression; /*!< chosen compression */
size_t id_len; /*!< session id length */
unsigned char id[32]; /*!< session identifier */
Expand Down Expand Up @@ -2775,7 +2772,9 @@ void mbedtls_ssl_conf_cookies(mbedtls_ssl_config* conf,
mbedtls_ssl_cookie_check_t* f_cookie_check,
void* p_cookie,
unsigned int rr_conf);
#else
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */

#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
/**
* \brief Register callbacks for DTLS cookies
* (Server only. DTLS only.)
Expand Down Expand Up @@ -2808,7 +2807,7 @@ void mbedtls_ssl_conf_dtls_cookies( mbedtls_ssl_config *conf,
mbedtls_ssl_cookie_write_t *f_cookie_write,
mbedtls_ssl_cookie_check_t *f_cookie_check,
void *p_cookie );
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
#endif /* defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) */

/**
* \brief Set client's transport-level identification info.
Expand Down
32 changes: 12 additions & 20 deletions include/mbedtls/ssl_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,8 @@ void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl );

int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl );
int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl );
int mbedtls_ssl_handshake_client_step_tls1_3( mbedtls_ssl_context *ssl );
int mbedtls_ssl_handshake_server_step_tls1_3( mbedtls_ssl_context *ssl );
void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl );

#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
Expand Down Expand Up @@ -1273,25 +1275,22 @@ int mbedtls_ssl_write_record( mbedtls_ssl_context *ssl, uint8_t force_flush );
#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
int mbedtls_ssl_read_certificate_process(mbedtls_ssl_context* ssl);
int mbedtls_ssl_write_certificate_process(mbedtls_ssl_context* ssl);
#else
int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl );
int mbedtls_ssl_write_certificate( mbedtls_ssl_context *ssl );
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
int mbedtls_ssl_finished_in_process( mbedtls_ssl_context* ssl );
int mbedtls_ssl_finished_out_process( mbedtls_ssl_context* ssl );

#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL) && defined(MBEDTLS_SSL_TLS13_COMPATIBILITY_MODE)
#if defined(MBEDTLS_SSL_TLS13_COMPATIBILITY_MODE)
int mbedtls_ssl_write_change_cipher_spec_process( mbedtls_ssl_context* ssl );
#else
int mbedtls_ssl_parse_change_cipher_spec( mbedtls_ssl_context *ssl );
int mbedtls_ssl_write_change_cipher_spec( mbedtls_ssl_context *ssl );
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL && MBEDTLS_SSL_TLS13_COMPATIBILITY_MODE */
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */

#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
int mbedtls_ssl_finished_in_process( mbedtls_ssl_context* ssl );
int mbedtls_ssl_finished_out_process( mbedtls_ssl_context* ssl );
#else
#if defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER)
int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl );
int mbedtls_ssl_write_certificate( mbedtls_ssl_context *ssl );
int mbedtls_ssl_parse_change_cipher_spec( mbedtls_ssl_context *ssl );
int mbedtls_ssl_write_change_cipher_spec( mbedtls_ssl_context *ssl );
int mbedtls_ssl_parse_finished( mbedtls_ssl_context *ssl );
int mbedtls_ssl_write_finished( mbedtls_ssl_context *ssl );
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
#endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) */

#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL) && \
defined(MBEDTLS_ZERO_RTT) && defined(MBEDTLS_SSL_CLI_C)
Expand Down Expand Up @@ -1652,17 +1651,10 @@ static inline mbedtls_x509_crt *mbedtls_ssl_own_cert( mbedtls_ssl_context *ssl )
* Return 0 if everything is OK, -1 if not.
*/

#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
int mbedtls_ssl_check_cert_usage(const mbedtls_x509_crt* cert,
const mbedtls_key_exchange_type_t key_exchange,
int cert_endpoint,
uint32_t* flags);
#else
int mbedtls_ssl_check_cert_usage( const mbedtls_x509_crt *cert,
const mbedtls_ssl_ciphersuite_t *ciphersuite,
int cert_endpoint,
uint32_t *flags );
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */

#endif /* MBEDTLS_X509_CRT_PARSE_C */

Expand Down
6 changes: 6 additions & 0 deletions library/ssl_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -5858,6 +5858,12 @@ static int ssl_handle_hs_message_post_handshake_tls12( mbedtls_ssl_context *ssl
* - For server-side, expect CLIENT_HELLO.
* - Fail (TLS) or silently drop record (DTLS) in other cases.
*/
#if defined(MBEDTLS_SSL_RENEGOTIATION) \
|| defined(MBEDTLS_SSL_PROTO_TLS1) \
|| defined(MBEDTLS_SSL_PROTO_TLS1_1) \
|| defined(MBEDTLS_SSL_PROTO_TLS1_2)
int ret;
#endif /* defined(MBEDTLS_SSL_RENEGOTIATION) */

#if defined(MBEDTLS_SSL_CLI_C)
if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT &&
Expand Down
2 changes: 1 addition & 1 deletion library/ssl_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ static int ssl_pick_cert( mbedtls_ssl_context *ssl,
* different uses based on keyUsage, eg if they want to avoid signing
* and decrypting with the same RSA key.
*/
if( mbedtls_ssl_check_cert_usage( cur->cert, ciphersuite_info,
if( mbedtls_ssl_check_cert_usage( cur->cert, ciphersuite_info->key_exchange,
MBEDTLS_SSL_IS_SERVER, &flags ) != 0 )
{
MBEDTLS_SSL_DEBUG_MSG( 3, ( "certificate mismatch: "
Expand Down
96 changes: 72 additions & 24 deletions library/ssl_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -2795,7 +2795,7 @@ static int ssl_parse_certificate_verify( mbedtls_ssl_context *ssl,
#endif /* MBEDTLS_ECP_C */

if( mbedtls_ssl_check_cert_usage( chain,
ciphersuite_info,
ciphersuite_info->key_exchange,
! ssl->conf->endpoint,
&ssl->session_negotiate->verify_result ) != 0 )
{
Expand Down Expand Up @@ -4380,7 +4380,18 @@ static void ssl_mps_free( mbedtls_ssl_context *ssl )
mps_alloc_free( &ssl->mps.alloc );
}
#endif /* MEDTLS_SSL_USE_MPS */

#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
static inline int check_version_config(const mbedtls_ssl_config *conf)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as in #290 - style adherence and more descriptive name needed.

{
if(conf->max_minor_ver==MBEDTLS_SSL_MINOR_VERSION_4
&& conf->min_minor_ver == MBEDTLS_SSL_MINOR_VERSION_4)
return 0;
if(conf->max_minor_ver!=MBEDTLS_SSL_MINOR_VERSION_4
&& conf->min_minor_ver != MBEDTLS_SSL_MINOR_VERSION_4)
return 0;
return 1;
}
#endif
/*
* Setup an SSL context
*/
Expand All @@ -4390,6 +4401,11 @@ int mbedtls_ssl_setup( mbedtls_ssl_context *ssl,
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;

#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
if(check_version_config(conf))
return( MBEDTLS_ERR_SSL_BAD_CONFIG );
#endif

#if !defined(MBEDTLS_SSL_USE_MPS)
size_t in_buf_len = MBEDTLS_SSL_IN_BUFFER_LEN;
size_t out_buf_len = MBEDTLS_SSL_OUT_BUFFER_LEN;
Expand Down Expand Up @@ -6407,7 +6423,8 @@ static int ssl_session_load( mbedtls_ssl_session *session,
const unsigned char *p = buf;
const unsigned char * const end = buf + len;
int minor_ver = 0;
#if defined(MBEDTLS_HAVE_TIME) && defined(MBEDTLS_SSL_SESSION_TICKETS)
#if defined(MBEDTLS_HAVE_TIME) \
&& defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER)
uint64_t start;
#endif /* MBEDTLS_HAVE_TIME && MBEDTLS_SSL_SESSION_TICKETS */

Expand Down Expand Up @@ -6795,12 +6812,37 @@ int mbedtls_ssl_handshake_step( mbedtls_ssl_context *ssl )

#if defined(MBEDTLS_SSL_CLI_C)
if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT )
{
#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style


if(ssl->conf->max_major_ver==MBEDTLS_SSL_MAJOR_VERSION_3
&& ssl->conf->min_major_ver==MBEDTLS_SSL_MAJOR_VERSION_3
&& ssl->conf->max_minor_ver==MBEDTLS_SSL_MINOR_VERSION_4
&& ssl->conf->min_minor_ver==MBEDTLS_SSL_MINOR_VERSION_4)
ret = mbedtls_ssl_handshake_client_step_tls1_3( ssl );
else
ret = mbedtls_ssl_handshake_client_step( ssl );
#else
ret = mbedtls_ssl_handshake_client_step( ssl );
#endif
}
#endif
#if defined(MBEDTLS_SSL_SRV_C)
if( ssl->conf->endpoint == MBEDTLS_SSL_IS_SERVER )
{
#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
if(ssl->conf->max_major_ver==MBEDTLS_SSL_MAJOR_VERSION_3
&& ssl->conf->min_major_ver==MBEDTLS_SSL_MAJOR_VERSION_3
&& ssl->conf->max_minor_ver==MBEDTLS_SSL_MINOR_VERSION_4
&& ssl->conf->min_minor_ver==MBEDTLS_SSL_MINOR_VERSION_4)
ret = mbedtls_ssl_handshake_server_step_tls1_3( ssl );
else
ret = mbedtls_ssl_handshake_server_step( ssl );
#else
ret = mbedtls_ssl_handshake_server_step( ssl );
#endif
}
#endif

if( ret != 0 )
{
Expand Down Expand Up @@ -8217,14 +8259,23 @@ int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf,
#endif

#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
#if defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER)
/* TLS 1.3 re-interprets the signature algorithms
* and therefore we cannot include both.
*/

#if defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) && defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
if(conf->max_minor_ver==MBEDTLS_SSL_MINOR_VERSION_4
&& conf->min_minor_ver == MBEDTLS_SSL_MINOR_VERSION_4)
/* TLS 1.3 re-interprets the signature algorithms
* and therefore we cannot include both.
*/
conf->sig_hashes = ssl_preset_suiteb_signature_algorithms_tls13;
else
conf->sig_hashes = ssl_preset_suiteb_hashes;
#else /* defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) */
conf->sig_hashes = ssl_preset_suiteb_signature_algorithms_tls13;

#elif defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
conf->sig_hashes = ssl_preset_suiteb_signature_algorithms_tls13;
#elif defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER)
conf->sig_hashes = ssl_preset_suiteb_hashes;
#endif /* !defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) */

#endif /* MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED */

#if defined(MBEDTLS_ECP_C)
Expand Down Expand Up @@ -8274,13 +8325,21 @@ int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf,
#endif

#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
#if defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER)
conf->sig_hashes = ssl_preset_default_hashes;
#else /* defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) */

#if defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) && defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
if(conf->max_minor_ver==MBEDTLS_SSL_MINOR_VERSION_4
&& conf->min_minor_ver == MBEDTLS_SSL_MINOR_VERSION_4)
conf->sig_hashes = ssl_preset_suiteb_signature_algorithms_tls13;
else
conf->sig_hashes = ssl_preset_default_hashes;
#elif defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
conf->sig_hashes = ssl_preset_suiteb_signature_algorithms_tls13;
#endif /* !defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) */
#elif defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER)
conf->sig_hashes = ssl_preset_default_hashes;
#endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) */

#endif

#if defined(MBEDTLS_ECP_C)
conf->curve_list = mbedtls_ecp_grp_id_list();
#endif
Expand Down Expand Up @@ -8538,17 +8597,10 @@ int mbedtls_ssl_check_sig_hash( const mbedtls_ssl_context *ssl,
#endif /* MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED */

#if defined(MBEDTLS_X509_CRT_PARSE_C)
#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
int mbedtls_ssl_check_cert_usage( const mbedtls_x509_crt* cert,
const mbedtls_key_exchange_type_t key_exchange,
int cert_endpoint,
uint32_t* flags )
#else
int mbedtls_ssl_check_cert_usage( const mbedtls_x509_crt* cert,
const mbedtls_ssl_ciphersuite_t* ciphersuite,
int cert_endpoint,
uint32_t* flags )
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
{
int ret = 0;
#if defined(MBEDTLS_X509_CHECK_KEY_USAGE)
Expand All @@ -8570,11 +8622,7 @@ int mbedtls_ssl_check_cert_usage( const mbedtls_x509_crt* cert,
if( cert_endpoint == MBEDTLS_SSL_IS_SERVER )
{
/* Server part of the key exchange */
#if defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER)
switch( ciphersuite->key_exchange )
#else /* defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) */
switch( key_exchange )
#endif /* !defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER) */
{
case MBEDTLS_KEY_EXCHANGE_RSA:
case MBEDTLS_KEY_EXCHANGE_RSA_PSK:
Expand Down
2 changes: 1 addition & 1 deletion library/ssl_tls13_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -4181,7 +4181,7 @@ static int ssl_new_session_ticket_process( mbedtls_ssl_context* ssl )
/*
* TLS and DTLS 1.3 State Maschine -- client side
*/
int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl )
int mbedtls_ssl_handshake_client_step_tls1_3( mbedtls_ssl_context *ssl )
{
int ret = 0;

Expand Down
2 changes: 1 addition & 1 deletion library/ssl_tls13_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -4271,7 +4271,7 @@ static int ssl_certificate_request_postprocess( mbedtls_ssl_context* ssl )
/*
* TLS and DTLS 1.3 State Maschine -- server side
*/
int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl )
int mbedtls_ssl_handshake_server_step_tls1_3( mbedtls_ssl_context *ssl )
{
int ret = 0;

Expand Down
3 changes: 2 additions & 1 deletion programs/fuzz/fuzz_dtlsserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {

if( mbedtls_ssl_cookie_setup( &cookie_ctx, dummy_random, &ctr_drbg ) != 0 )
goto exit;

#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
mbedtls_ssl_conf_dtls_cookies( &conf, mbedtls_ssl_cookie_write, mbedtls_ssl_cookie_check, &cookie_ctx );
#endif /* defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) */

if( mbedtls_ssl_setup( &ssl, &conf ) != 0 )
goto exit;
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/dtls_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ int main( void )
goto exit;
}

#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
mbedtls_ssl_conf_dtls_cookies( &conf, mbedtls_ssl_cookie_write, mbedtls_ssl_cookie_check,
&cookie_ctx );
#endif

if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 )
{
Expand Down
7 changes: 6 additions & 1 deletion programs/ssl/ssl_client2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2151,7 +2151,10 @@ int main( int argc, char *argv[] )
mbedtls_printf( "Warning: event-driven IO mandates nbio=1 - overwrite\n" );
opt.nbio = 1;
}

#if defined(MBEDTLS_DISABLE_NONBLOCK_IO)
// TODO: if #238 is fixed , This should be removed
opt.nbio = 0;
#endif
#if defined(MBEDTLS_DEBUG_C)
mbedtls_debug_set_threshold( opt.debug_level );
#endif
Expand Down Expand Up @@ -3017,10 +3020,12 @@ int main( int argc, char *argv[] )
#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED */

if( opt.min_version != DFL_MIN_VERSION )
// TAG for Jerry Yu, This is important for TLS1.3 now
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this comment be removed?

mbedtls_ssl_conf_min_version( &conf, MBEDTLS_SSL_MAJOR_VERSION_3,
opt.min_version );

if( opt.max_version != DFL_MAX_VERSION )
// TAG for Jerry Yu, This is important for TLS1.3 now
mbedtls_ssl_conf_max_version( &conf, MBEDTLS_SSL_MAJOR_VERSION_3,
opt.max_version );

Expand Down
8 changes: 6 additions & 2 deletions programs/ssl/ssl_server2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,10 @@ int main( int argc, char *argv[] )
mbedtls_printf( "Warning: event-driven IO mandates nbio=1 - overwrite\n" );
opt.nbio = 1;
}

#if defined(MBEDTLS_DISABLE_NONBLOCK_IO)
// TODO: if #238 is fixed , This should be removed
opt.nbio = 0;
#endif
#if defined(MBEDTLS_DEBUG_C)
mbedtls_debug_set_threshold( opt.debug_level );
#endif
Expand Down Expand Up @@ -3781,9 +3784,10 @@ int main( int argc, char *argv[] )
mbedtls_printf( " failed\n ! mbedtls_ssl_cookie_setup returned %d\n\n", ret );
goto exit;
}

#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
mbedtls_ssl_conf_dtls_cookies( &conf, mbedtls_ssl_cookie_write, mbedtls_ssl_cookie_check,
&cookie_ctx );
#endif /* defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) */
}
else
#endif /* MBEDTLS_SSL_COOKIE_C */
Expand Down
Loading