mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-29 22:20:30 +00:00
Add test for hostname getter
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
This commit is contained in:
parent
08daebb410
commit
30e0870937
@ -1148,13 +1148,19 @@ exit:
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED */
|
||||
void ssl_set_hostname_twice(char *hostname0, char *hostname1)
|
||||
{
|
||||
const char *hostname;
|
||||
mbedtls_ssl_context ssl;
|
||||
|
||||
mbedtls_ssl_init(&ssl);
|
||||
USE_PSA_INIT();
|
||||
|
||||
TEST_ASSERT(mbedtls_ssl_set_hostname(&ssl, hostname0) == 0);
|
||||
hostname = mbedtls_ssl_get_hostname(&ssl);
|
||||
TEST_ASSERT(strcmp(hostname0, hostname) == 0);
|
||||
|
||||
TEST_ASSERT(mbedtls_ssl_set_hostname(&ssl, hostname1) == 0);
|
||||
hostname = mbedtls_ssl_get_hostname(&ssl);
|
||||
TEST_ASSERT(strcmp(hostname1, hostname) == 0);
|
||||
|
||||
exit:
|
||||
mbedtls_ssl_free(&ssl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user