From ce5f5fdcb4567a86644235062379730deeab0179 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 5 Feb 2020 10:47:44 +0000 Subject: [PATCH] Move ssl_handshake_wrapup_free_hs_transform() to public namespace --- include/mbedtls/ssl_internal.h | 2 ++ library/ssl_tls.c | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/mbedtls/ssl_internal.h b/include/mbedtls/ssl_internal.h index 025c3a9c6..288297eb3 100644 --- a/include/mbedtls/ssl_internal.h +++ b/include/mbedtls/ssl_internal.h @@ -1091,4 +1091,6 @@ int mbedtls_ssl_session_reset_int( mbedtls_ssl_context *ssl, int partial ); void mbedtls_ssl_dtls_replay_reset( mbedtls_ssl_context *ssl ); #endif +void mbedtls_ssl_handshake_wrapup_free_hs_transform( mbedtls_ssl_context *ssl ); + #endif /* ssl_internal.h */ diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 3fcf2b94b..206d07ee6 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -5567,8 +5567,6 @@ static int ssl_prepare_record_content( mbedtls_ssl_context *ssl, return( 0 ); } -static void ssl_handshake_wrapup_free_hs_transform( mbedtls_ssl_context *ssl ); - /* * Read a record. * @@ -6583,7 +6581,7 @@ int mbedtls_ssl_handle_message_type( mbedtls_ssl_context *ssl ) if( ssl->handshake != NULL && ssl->state == MBEDTLS_SSL_HANDSHAKE_OVER ) { - ssl_handshake_wrapup_free_hs_transform( ssl ); + mbedtls_ssl_handshake_wrapup_free_hs_transform( ssl ); } } #endif /* MBEDTLS_SSL_PROTO_DTLS */ @@ -7987,7 +7985,7 @@ static void ssl_calc_finished_tls_sha384( #endif /* MBEDTLS_SHA512_C */ #endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ -static void ssl_handshake_wrapup_free_hs_transform( mbedtls_ssl_context *ssl ) +void mbedtls_ssl_handshake_wrapup_free_hs_transform( mbedtls_ssl_context *ssl ) { MBEDTLS_SSL_DEBUG_MSG( 3, ( "=> handshake wrapup: final free" ) ); @@ -8067,7 +8065,7 @@ void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl ) } else #endif - ssl_handshake_wrapup_free_hs_transform( ssl ); + mbedtls_ssl_handshake_wrapup_free_hs_transform( ssl ); ssl->state++; @@ -11984,7 +11982,8 @@ static int ssl_context_load( mbedtls_ssl_context *ssl, /* mbedtls_ssl_reset() leaves the handshake sub-structure allocated, * which we don't want - otherwise we'd end up freeing the wrong transform - * by calling ssl_handshake_wrapup_free_hs_transform() inappropriately. */ + * by calling mbedtls_ssl_handshake_wrapup_free_hs_transform() + * inappropriately. */ if( ssl->handshake != NULL ) { mbedtls_ssl_handshake_free( ssl );