mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-02 11:21:08 +00:00
Merge pull request #3805 from hanno-arm/check_dtls_timers_only_once
Check presence of DTLS retransmission timers only once
This commit is contained in:
commit
da9f92c2b2
|
@ -2018,14 +2018,6 @@ int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want )
|
||||||
{
|
{
|
||||||
uint32_t timeout;
|
uint32_t timeout;
|
||||||
|
|
||||||
/* Just to be sure */
|
|
||||||
if( ssl->f_set_timer == NULL || ssl->f_get_timer == NULL )
|
|
||||||
{
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "You must use "
|
|
||||||
"mbedtls_ssl_set_timer_cb() for DTLS" ) );
|
|
||||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The point is, we need to always read a full datagram at once, so we
|
* The point is, we need to always read a full datagram at once, so we
|
||||||
* sometimes read more then requested, and handle the additional data.
|
* sometimes read more then requested, and handle the additional data.
|
||||||
|
|
|
@ -5682,11 +5682,24 @@ int mbedtls_ssl_handshake( mbedtls_ssl_context *ssl )
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
/* Sanity checks */
|
||||||
|
|
||||||
if( ssl == NULL || ssl->conf == NULL )
|
if( ssl == NULL || ssl->conf == NULL )
|
||||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_SSL_PROTO_DTLS)
|
||||||
|
if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM &&
|
||||||
|
( ssl->f_set_timer == NULL || ssl->f_get_timer == NULL ) )
|
||||||
|
{
|
||||||
|
MBEDTLS_SSL_DEBUG_MSG( 1, ( "You must use "
|
||||||
|
"mbedtls_ssl_set_timer_cb() for DTLS" ) );
|
||||||
|
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||||
|
}
|
||||||
|
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> handshake" ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> handshake" ) );
|
||||||
|
|
||||||
|
/* Main handshake loop */
|
||||||
while( ssl->state != MBEDTLS_SSL_HANDSHAKE_OVER )
|
while( ssl->state != MBEDTLS_SSL_HANDSHAKE_OVER )
|
||||||
{
|
{
|
||||||
ret = mbedtls_ssl_handshake_step( ssl );
|
ret = mbedtls_ssl_handshake_step( ssl );
|
||||||
|
|
Loading…
Reference in a new issue