From 88db2ae9a0e3651c711e7a7b312d91ef8f9eddad Mon Sep 17 00:00:00 2001 From: Jarno Lamsa Date: Thu, 19 Dec 2019 14:51:34 +0200 Subject: [PATCH] Use Platform fault when double check fails --- library/ssl_tls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 20683366c..d9f1c4a2e 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -4617,10 +4617,10 @@ int mbedtls_ssl_write_record( mbedtls_ssl_context *ssl, uint8_t force_flush ) encrypted_fi = 1; } - //Double check to ensure the encryption has been done + /* Double check to ensure the encryption has been done */ if( ssl->transform_out != NULL && encrypted_fi == 0 ) { - return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); + return( MBEDTLS_ERR_PLATFORM_FAULT_DETECTED ); } protected_record_size = len + mbedtls_ssl_out_hdr_len( ssl );