Refine the server name compare logic
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
parent
a3b451f950
commit
d7adc374d3
1 changed files with 5 additions and 13 deletions
|
@ -876,19 +876,11 @@ static int ssl_prepare_client_hello( mbedtls_ssl_context *ssl )
|
|||
if( ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_3 &&
|
||||
ssl->handshake->resume )
|
||||
{
|
||||
int hostname_mismatch = 0;
|
||||
if( ssl->session_negotiate->hostname != NULL )
|
||||
{
|
||||
if( ssl->hostname != NULL )
|
||||
{
|
||||
if( strcmp( ssl->hostname, ssl->session_negotiate->hostname) )
|
||||
hostname_mismatch = 1;
|
||||
}
|
||||
else
|
||||
hostname_mismatch = 1;
|
||||
}
|
||||
else
|
||||
hostname_mismatch = ssl->hostname != NULL;
|
||||
int hostname_mismatch = ssl->hostname != NULL ||
|
||||
ssl->session_negotiate->hostname != NULL;
|
||||
if( ssl->hostname != NULL && ssl->session_negotiate->hostname != NULL )
|
||||
hostname_mismatch = strcmp(
|
||||
ssl->hostname, ssl->session_negotiate->hostname ) != 0;
|
||||
|
||||
if( hostname_mismatch )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue