mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-05 06:26:52 +00:00
Allow compile-time configuration of timer callbacks
Introduces - MBEDTLS_SSL_CONF_SET_TIMER - MBEDTLS_SSL_CONF_GET_TIMER which allows to configure timer callbacks at compile-time. Impact on code-size: | | GCC 8.2.1 | ARMC5 5.06 | ARMC6 6.12 | | --- | --- | --- | --- | | `libmbedtls.a` before | 23379 | 23981 | 26941 | | `libmbedtls.a` after | 23351 | 23953 | 26869 | | gain in Bytes | 28 | 28 | 72 |
This commit is contained in:
parent
a58a896172
commit
0ae6b244c8
11 changed files with 159 additions and 10 deletions
|
|
@ -1915,8 +1915,13 @@ int main( int argc, char *argv[] )
|
|||
#endif
|
||||
|
||||
#if defined(MBEDTLS_TIMING_C)
|
||||
#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 );
|
||||
#else
|
||||
mbedtls_ssl_set_timer_cb_ctx( &ssl, &timer );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
|
|
@ -2507,9 +2512,16 @@ send_request:
|
|||
|
||||
#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 );
|
||||
#else
|
||||
mbedtls_ssl_set_timer_cb_ctx( &ssl, &timer );
|
||||
#endif
|
||||
}
|
||||
#endif /* MBEDTLS_TIMING_C */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue