SSL test programs: allow for test hooks init and error reports

Create utility functions to set up test hooks and report errors that
the test hooks might detect. Call them in ssl_client2 and ssl_server2.

Test hooks are potentially enabled by compiling with
MBEDTLS_TEST_HOOKS.

This commit only sets up the functions. It doesn't make them do
anything yet.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2021-02-02 22:55:06 +01:00
parent 4337a9cb18
commit 53dea743d5
4 changed files with 68 additions and 0 deletions

View file

@ -321,4 +321,21 @@ int idle( mbedtls_net_context *fd,
return( 0 );
}
#if defined(MBEDTLS_TEST_HOOKS)
void test_hooks_init( void )
{
}
int test_hooks_failure_detected( void )
{
return( 0 );
}
void test_hooks_free( void )
{
}
#endif /* MBEDTLS_TEST_HOOKS */
#endif /* !defined(MBEDTLS_SSL_TEST_IMPOSSIBLE) */