Use PSA status to Mbed TLS error code conversion function

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 5932bc8..72493cf 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -7509,7 +7509,7 @@
         goto exit;
 
 exit:
-    return( ( status == PSA_SUCCESS ) ? 0 : MBEDTLS_ERR_ERROR_GENERIC_ERROR );
+    return( psa_ssl_status_to_mbedtls( status ) );
 }
 #else /* MBEDTLS_USE_PSA_CRYPTO */