Rebase and replace session_negotiate

Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
Xiaokang Qian 2022-10-12 11:14:32 +00:00
parent baa4764d77
commit 307a7303fd

View File

@ -878,11 +878,11 @@ static int ssl_prepare_client_hello( mbedtls_ssl_context *ssl )
ssl->handshake->resume ) ssl->handshake->resume )
{ {
int hostname_mismatch = ssl->hostname != NULL || int hostname_mismatch = ssl->hostname != NULL ||
ssl->session_negotiate->hostname != NULL; session_negotiate->hostname != NULL;
if( ssl->hostname != NULL && ssl->session_negotiate->hostname != NULL ) if( ssl->hostname != NULL && session_negotiate->hostname != NULL )
{ {
hostname_mismatch = strcmp( hostname_mismatch = strcmp(
ssl->hostname, ssl->session_negotiate->hostname ) != 0; ssl->hostname, session_negotiate->hostname ) != 0;
} }
if( hostname_mismatch ) if( hostname_mismatch )
@ -895,7 +895,7 @@ static int ssl_prepare_client_hello( mbedtls_ssl_context *ssl )
} }
else else
{ {
return mbedtls_ssl_session_set_hostname( ssl->session_negotiate, return mbedtls_ssl_session_set_hostname( session_negotiate,
ssl->hostname ); ssl->hostname );
} }
#endif /* MBEDTLS_SSL_PROTO_TLS1_3 && #endif /* MBEDTLS_SSL_PROTO_TLS1_3 &&