mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
tls13: Simplify switch to the inbound handshake keys on server side
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
@ -1636,19 +1636,18 @@ static int ssl_tls13_write_server_finished( mbedtls_ssl_context *ssl )
|
|||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ssl->handshake->certificate_request_sent )
|
MBEDTLS_SSL_DEBUG_MSG( 1, ( "Switch to handshake keys for inbound traffic" ) );
|
||||||
{
|
mbedtls_ssl_set_inbound_transform( ssl, ssl->handshake->transform_handshake );
|
||||||
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CLIENT_CERTIFICATE );
|
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "Switch to handshake keys for inbound traffic" ) );
|
if( ssl->handshake->certificate_request_sent )
|
||||||
mbedtls_ssl_set_inbound_transform( ssl, ssl->handshake->transform_handshake );
|
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CLIENT_CERTIFICATE );
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "skip parse certificate" ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "skip parse certificate" ) );
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "skip parse certificate verify" ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "skip parse certificate verify" ) );
|
||||||
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CLIENT_FINISHED );
|
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CLIENT_FINISHED );
|
||||||
}
|
}
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1659,12 +1658,6 @@ static int ssl_tls13_process_client_finished( mbedtls_ssl_context *ssl )
|
|||||||
{
|
{
|
||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
if( ! ssl->handshake->certificate_request_sent )
|
|
||||||
{
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 1,
|
|
||||||
( "Switch to handshake traffic keys for inbound traffic" ) );
|
|
||||||
mbedtls_ssl_set_inbound_transform( ssl, ssl->handshake->transform_handshake );
|
|
||||||
}
|
|
||||||
ret = mbedtls_ssl_tls13_process_finished_message( ssl );
|
ret = mbedtls_ssl_tls13_process_finished_message( ssl );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
Reference in New Issue
Block a user