ssl_tls.c: Unify TLS 1.2 and TLS 1.3 SSL state logs

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index b148485..4eb5a9c 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -38,6 +38,7 @@
 #endif /* !MBEDTLS_PLATFORM_C */
 
 #include "mbedtls/ssl.h"
+#include "ssl_debug_helpers.h"
 #include "ssl_misc.h"
 #include "mbedtls/debug.h"
 #include "mbedtls/error.h"
@@ -2819,6 +2820,9 @@
 #if defined(MBEDTLS_SSL_CLI_C)
     if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT )
     {
+        MBEDTLS_SSL_DEBUG_MSG( 2, ( "client state: %s",
+                                    mbedtls_ssl_states_str( ssl->state ) ) );
+
 #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
         if( mbedtls_ssl_conf_is_tls13_only( ssl->conf ) )
             ret = mbedtls_ssl_tls13_handshake_client_step( ssl );
diff --git a/library/ssl_tls12_client.c b/library/ssl_tls12_client.c
index a365a91..21eb408 100644
--- a/library/ssl_tls12_client.c
+++ b/library/ssl_tls12_client.c
@@ -3982,8 +3982,6 @@
 {
     int ret = 0;
 
-    MBEDTLS_SSL_DEBUG_MSG( 2, ( "client state: %d", ssl->state ) );
-
     /* Change state now, so that it is right in mbedtls_ssl_read_record(), used
      * by DTLS for dropping out-of-sequence ChangeCipherSpec records */
 #if defined(MBEDTLS_SSL_SESSION_TICKETS)
diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c
index f701215..fc8ffa7 100644
--- a/library/ssl_tls13_client.c
+++ b/library/ssl_tls13_client.c
@@ -33,7 +33,6 @@
 #include "ecdh_misc.h"
 #include "ssl_client.h"
 #include "ssl_tls13_keys.h"
-#include "ssl_debug_helpers.h"
 
 /* Write extensions */
 
@@ -1853,10 +1852,6 @@
 {
     int ret = 0;
 
-    MBEDTLS_SSL_DEBUG_MSG( 2, ( "tls13 client state: %s(%d)",
-                                mbedtls_ssl_states_str( ssl->state ),
-                                ssl->state ) );
-
     switch( ssl->state )
     {
         /*