From 3ce4d51c11602db443ffccd798af3d92c32d6e79 Mon Sep 17 00:00:00 2001 From: XiaokangQian Date: Wed, 17 Nov 2021 02:11:36 +0000 Subject: [PATCH] Move set_outbound_transform to finalize server finished. Signed-off-by: XiaokangQian --- library/ssl_tls13_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c index 1516523e5..a2e5f33a0 100644 --- a/library/ssl_tls13_client.c +++ b/library/ssl_tls13_client.c @@ -1328,7 +1328,6 @@ static int ssl_tls13_finalize_server_hello( mbedtls_ssl_context *ssl ) handshake->transform_handshake = transform_handshake; mbedtls_ssl_set_inbound_transform( ssl, transform_handshake ); - mbedtls_ssl_set_outbound_transform( ssl, ssl->handshake->transform_handshake ); MBEDTLS_SSL_DEBUG_MSG( 1, ( "Switch to handshake keys for inbound traffic" ) ); ssl->session_in = ssl->session_negotiate; @@ -1612,6 +1611,7 @@ static int ssl_tls1_3_process_server_finished( mbedtls_ssl_context *ssl ) if( ret != 0 ) return( ret ); + mbedtls_ssl_set_outbound_transform( ssl, ssl->handshake->transform_handshake ); mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CLIENT_FINISHED ); return( 0 ); }