mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-02 05:21:08 +00:00
Detect and report mutex usage errors in SSL test programs
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
d0a46e5c7f
commit
e374b95fe1
|
@ -22,6 +22,10 @@
|
||||||
|
|
||||||
#include "ssl_test_lib.h"
|
#include "ssl_test_lib.h"
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_TEST_HOOKS)
|
||||||
|
#include "test/helpers.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(MBEDTLS_SSL_TEST_IMPOSSIBLE)
|
#if !defined(MBEDTLS_SSL_TEST_IMPOSSIBLE)
|
||||||
|
|
||||||
void my_debug( void *ctx, int level,
|
void my_debug( void *ctx, int level,
|
||||||
|
@ -325,10 +329,22 @@ int idle( mbedtls_net_context *fd,
|
||||||
|
|
||||||
void test_hooks_init( void )
|
void test_hooks_init( void )
|
||||||
{
|
{
|
||||||
|
mbedtls_test_info_reset( );
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_TEST_MUTEX_USAGE)
|
||||||
|
mbedtls_test_mutex_usage_init( );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_hooks_failure_detected( void )
|
int test_hooks_failure_detected( void )
|
||||||
{
|
{
|
||||||
|
#if defined(MBEDTLS_TEST_MUTEX_USAGE)
|
||||||
|
/* Errors are reported via mbedtls_test_info. */
|
||||||
|
mbedtls_test_mutex_usage_check( );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if( mbedtls_test_info.result != MBEDTLS_TEST_RESULT_SUCCESS )
|
||||||
|
return( 1 );
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue