mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-06-19 23:07:52 +00:00
Improve getter for renegotiation enabled
This commit is contained in:
parent
b3bb31bd90
commit
18332c5c6c
|
@ -1243,14 +1243,15 @@ static inline int mbedtls_ssl_get_renego_status(
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int mbedtls_ssl_conf_get_disable_renego(
|
static inline int mbedtls_ssl_conf_is_renegotiation_enabled(
|
||||||
const mbedtls_ssl_config *conf )
|
const mbedtls_ssl_config *conf )
|
||||||
{
|
{
|
||||||
#if defined(MBEDTLS_SSL_RENEGOTIATION)
|
#if defined(MBEDTLS_SSL_RENEGOTIATION)
|
||||||
return( conf->disable_renegotiation );
|
return( conf->disable_renegotiation ==
|
||||||
|
MBEDTLS_SSL_RENEGOTIATION_ENABLED );
|
||||||
#else
|
#else
|
||||||
(void) conf;
|
(void) conf;
|
||||||
return( MBEDTLS_SSL_RENEGOTIATION_DISABLED );
|
return( 0 );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10030,7 +10030,7 @@ static int ssl_check_ctr_renegotiate( mbedtls_ssl_context *ssl )
|
||||||
|
|
||||||
if( ssl->state != MBEDTLS_SSL_HANDSHAKE_OVER ||
|
if( ssl->state != MBEDTLS_SSL_HANDSHAKE_OVER ||
|
||||||
ssl->renego_status == MBEDTLS_SSL_RENEGOTIATION_PENDING ||
|
ssl->renego_status == MBEDTLS_SSL_RENEGOTIATION_PENDING ||
|
||||||
ssl->conf->disable_renegotiation == MBEDTLS_SSL_RENEGOTIATION_DISABLED )
|
! mbedtls_ssl_conf_is_renegotiation_enabled( ssl->conf ) )
|
||||||
{
|
{
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
@ -10855,8 +10855,7 @@ int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl,
|
||||||
/* ... with an AEAD ciphersuite. */
|
/* ... with an AEAD ciphersuite. */
|
||||||
mbedtls_ssl_transform_uses_aead( ssl->transform ) != 1 ||
|
mbedtls_ssl_transform_uses_aead( ssl->transform ) != 1 ||
|
||||||
/* Renegotation is disabled. */
|
/* Renegotation is disabled. */
|
||||||
mbedtls_ssl_conf_get_disable_renego( ssl->conf )
|
mbedtls_ssl_conf_is_renegotiation_enabled( ssl->conf ) )
|
||||||
!= MBEDTLS_SSL_RENEGOTIATION_DISABLED )
|
|
||||||
{
|
{
|
||||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||||
}
|
}
|
||||||
|
@ -11079,8 +11078,7 @@ static int ssl_context_load( mbedtls_ssl_context *ssl,
|
||||||
MBEDTLS_SSL_MINOR_VERSION_3 ||
|
MBEDTLS_SSL_MINOR_VERSION_3 ||
|
||||||
mbedtls_ssl_conf_get_min_minor_ver( ssl->conf ) >
|
mbedtls_ssl_conf_get_min_minor_ver( ssl->conf ) >
|
||||||
MBEDTLS_SSL_MINOR_VERSION_3 ||
|
MBEDTLS_SSL_MINOR_VERSION_3 ||
|
||||||
mbedtls_ssl_conf_get_disable_renego( ssl->conf )
|
mbedtls_ssl_conf_is_renegotiation_enabled( ssl->conf ) )
|
||||||
!= MBEDTLS_SSL_RENEGOTIATION_DISABLED )
|
|
||||||
{
|
{
|
||||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue