Change the default value of status variables to an error


Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 146a8f1..b81df29 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -50,7 +50,6 @@
 #include "mbedtls/version.h"
 #include "mbedtls/platform.h"
 
-
 #include <string.h>
 
 #if defined(MBEDTLS_X509_CRT_PARSE_C)
@@ -175,7 +174,7 @@
                               unsigned char *buf,
                               size_t buflen )
 {
-    int ret = 0;
+    int ret = MBEDTLS_ERR_PLATFORM_FAULT_DETECTED;
     mbedtls_record rec;
     MBEDTLS_SSL_DEBUG_MSG( 1, ( "=> mbedtls_ssl_check_record" ) );
     MBEDTLS_SSL_DEBUG_BUF( 3, "record buffer", buf, buflen );
@@ -1892,7 +1891,7 @@
 
 int mbedtls_ssl_derive_keys( mbedtls_ssl_context *ssl )
 {
-    volatile int ret = MBEDTLS_ERR_SSL_INTERNAL_ERROR;
+    volatile int ret = MBEDTLS_ERR_PLATFORM_FAULT_DETECTED;
 
     MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> derive keys" ) );
     ssl->handshake->key_derivation_done = MBEDTLS_SSL_FI_FLAG_UNSET;
@@ -1981,7 +1980,7 @@
 
 int mbedtls_ssl_build_pms( mbedtls_ssl_context *ssl )
 {
-    volatile int ret = MBEDTLS_ERR_SSL_INTERNAL_ERROR;
+    volatile int ret = MBEDTLS_ERR_PLATFORM_FAULT_DETECTED;
 
     mbedtls_ssl_ciphersuite_handle_t ciphersuite_info =
         mbedtls_ssl_handshake_get_ciphersuite( ssl->handshake );
@@ -7319,7 +7318,7 @@
                                          void *rs_ctx )
 {
     volatile int verify_ret = MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE;
-    volatile int ret = MBEDTLS_ERR_SSL_INTERNAL_ERROR;
+    volatile int ret = MBEDTLS_ERR_PLATFORM_FAULT_DETECTED;
     volatile int flow_counter = 0;
     mbedtls_ssl_ciphersuite_handle_t ciphersuite_info =
         mbedtls_ssl_handshake_get_ciphersuite( ssl->handshake );
@@ -7945,7 +7944,7 @@
 
 int mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl )
 {
-    volatile int ret = MBEDTLS_ERR_SSL_INTERNAL_ERROR;
+    volatile int ret = MBEDTLS_ERR_PLATFORM_FAULT_DETECTED;
 
 #if defined(MBEDTLS_SSL_SRV_C) && defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
     volatile const int authmode = ssl->handshake->sni_authmode != MBEDTLS_SSL_VERIFY_UNSET