mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-04 14:08:39 +00:00
Change requirements for setting timer callback
The code wants timer callbacks to be set (checked in fetch_input()), and can't easily check whether we're using nbio, so it seems easier to require the callbacks to be always set rather than only with nbio as was previously done.
This commit is contained in:
parent
138079d7d6
commit
86dfa0cfc9
3 changed files with 14 additions and 23 deletions
|
|
@ -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" );
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue