diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index 485d1cd92..56b567708 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -3977,15 +3977,12 @@ int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl, * (unless they were already set before calling * mbedtls_ssl_session_reset() and the values are suitable for * the present connection). Specifically, you want to call - * at least mbedtls_ssl_set_bio(). If you're using a read - * timeout (that is, you called - * mbedtls_ssl_conf_read_timeout() with a non-zero timeout) - * and non-blocking I/O, you also need to set timer callbacks - * by calling mbedtls_ssl_set_timer_cb(). All other SSL setter - * functions are not necessary to call, either because they're - * only used in handshakes, or because the setting is already - * saved. You might choose to call them anyway, for example in - * order to share code between the cases of establishing a new + * at least mbedtls_ssl_set_bio() and + * mbedtls_ssl_set_timer_cb(). All other SSL setter functions + * are not necessary to call, either because they're only used + * in handshakes, or because the setting is already saved. You + * might choose to call them anyway, for example in order to + * share code between the cases of establishing a new * connection and the case of loading an already-established * connection. * diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index 55277b12d..77bab8d54 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -2563,17 +2563,14 @@ send_request: opt.nbio == 0 ? mbedtls_net_recv_timeout : NULL ); #if defined(MBEDTLS_TIMING_C) - if( opt.nbio != 0 && opt.read_timeout != 0 ) - { #if !defined(MBEDTLS_SSL_CONF_SET_TIMER) && \ !defined(MBEDTLS_SSL_CONF_GET_TIMER) - mbedtls_ssl_set_timer_cb( &ssl, &timer, - mbedtls_timing_set_delay, - mbedtls_timing_get_delay ); + mbedtls_ssl_set_timer_cb( &ssl, &timer, + mbedtls_timing_set_delay, + mbedtls_timing_get_delay ); #else - mbedtls_ssl_set_timer_cb_ctx( &ssl, &timer ); + mbedtls_ssl_set_timer_cb_ctx( &ssl, &timer ); #endif - } #endif /* MBEDTLS_TIMING_C */ mbedtls_printf( " ok\n" ); diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index bf209e8b1..b2c140fd1 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -3600,17 +3600,14 @@ data_exchange: opt.nbio == 0 ? mbedtls_net_recv_timeout : NULL ); #if defined(MBEDTLS_TIMING_C) - if( opt.nbio != 0 && opt.read_timeout != 0 ) - { #if !defined(MBEDTLS_SSL_CONF_SET_TIMER) && \ !defined(MBEDTLS_SSL_CONF_GET_TIMER) - mbedtls_ssl_set_timer_cb( &ssl, &timer, - mbedtls_timing_set_delay, - mbedtls_timing_get_delay ); + mbedtls_ssl_set_timer_cb( &ssl, &timer, + mbedtls_timing_set_delay, + mbedtls_timing_get_delay ); #else - mbedtls_ssl_set_timer_cb_ctx( &ssl, &timer ); + mbedtls_ssl_set_timer_cb_ctx( &ssl, &timer ); #endif - } #endif /* MBEDTLS_TIMING_C */ mbedtls_printf( " ok\n" );