mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-02 11:01:11 +00:00
Add test case calling ssl_set_hostname twice
Add a test case calling ssl_set_hostname twice to test_suite_ssl. When run in CMake build mode ASan, this catches the current leak, but will hopefully be fine with the new version.
This commit is contained in:
parent
cb8d54b22d
commit
b25c0c78cf
|
@ -54,3 +54,6 @@ ssl_dtls_replay:"abcd12340000,abcd12340100":"abcd12340101":0
|
||||||
|
|
||||||
SSL DTLS replay: big jump then just delayed
|
SSL DTLS replay: big jump then just delayed
|
||||||
ssl_dtls_replay:"abcd12340000,abcd12340100":"abcd123400ff":0
|
ssl_dtls_replay:"abcd12340000,abcd12340100":"abcd123400ff":0
|
||||||
|
|
||||||
|
SSL SET_HOSTNAME memory leak: call ssl_set_hostname twice
|
||||||
|
ssl_set_hostname_twice:"server0":"server1"
|
||||||
|
|
|
@ -40,3 +40,16 @@ void ssl_dtls_replay( char *prevs, char *new, int ret )
|
||||||
mbedtls_ssl_config_free( &conf );
|
mbedtls_ssl_config_free( &conf );
|
||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
|
/* BEGIN_CASE depends_on:MBEDTLS_X509_CRT_PARSE_C */
|
||||||
|
void ssl_set_hostname_twice( char *hostname0, char *hostname1 )
|
||||||
|
{
|
||||||
|
mbedtls_ssl_context ssl;
|
||||||
|
mbedtls_ssl_init( &ssl );
|
||||||
|
|
||||||
|
TEST_ASSERT( mbedtls_ssl_set_hostname( &ssl, hostname0 ) == 0 );
|
||||||
|
TEST_ASSERT( mbedtls_ssl_set_hostname( &ssl, hostname1 ) == 0 );
|
||||||
|
|
||||||
|
mbedtls_ssl_free( &ssl );
|
||||||
|
}
|
||||||
|
/* END_CASE */
|
Loading…
Reference in a new issue