mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 10:35:35 +00:00
Address review comments
This commit is contained in:
parent
46afd5d8fa
commit
6122b59042
|
@ -258,7 +258,8 @@ int mbedtls_entropy_update_manual( mbedtls_entropy_context *ctx,
|
|||
*/
|
||||
static int entropy_gather_internal( mbedtls_entropy_context *ctx )
|
||||
{
|
||||
int ret, i;
|
||||
int i;
|
||||
volatile int ret = MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE;
|
||||
volatile int have_one_strong_fi = 0;
|
||||
unsigned char buf[MBEDTLS_ENTROPY_MAX_GATHER];
|
||||
size_t olen;
|
||||
|
@ -299,19 +300,19 @@ static int entropy_gather_internal( mbedtls_entropy_context *ctx )
|
|||
}
|
||||
}
|
||||
|
||||
if( have_one_strong_fi == 0 )
|
||||
{
|
||||
mbedtls_platform_enforce_volatile_reads();
|
||||
if( have_one_strong_fi == 0)
|
||||
{
|
||||
ret = MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE;
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
mbedtls_platform_zeroize( buf, sizeof( buf ) );
|
||||
|
||||
return( ret );
|
||||
if( have_one_strong_fi == 1 )
|
||||
{
|
||||
mbedtls_platform_enforce_volatile_reads();
|
||||
if( have_one_strong_fi == 1 )
|
||||
{
|
||||
return( ret );
|
||||
}
|
||||
}
|
||||
|
||||
return( MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -3051,6 +3051,10 @@ static int ssl_in_server_key_exchange_parse( mbedtls_ssl_context *ssl,
|
|||
#endif /* MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */
|
||||
return( ret );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
||||
}
|
||||
}
|
||||
#if defined(MBEDTLS_SSL__ECP_RESTARTABLE)
|
||||
if( ret != MBEDTLS_ERR_ECP_IN_PROGRESS )
|
||||
|
|
Loading…
Reference in a new issue