mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-15 03:07:16 +08:00
Add a log message on every SSL state transition
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
f670ba5e52
commit
c67befee6a
@ -16,6 +16,9 @@
|
|||||||
#include "mbedtls/error.h"
|
#include "mbedtls/error.h"
|
||||||
|
|
||||||
#include "mbedtls/ssl.h"
|
#include "mbedtls/ssl.h"
|
||||||
|
#include "mbedtls/debug.h"
|
||||||
|
#include "debug_internal.h"
|
||||||
|
|
||||||
#include "mbedtls/cipher.h"
|
#include "mbedtls/cipher.h"
|
||||||
|
|
||||||
#include "psa/crypto.h"
|
#include "psa/crypto.h"
|
||||||
@ -1305,9 +1308,21 @@ MBEDTLS_CHECK_RETURN_CRITICAL
|
|||||||
int mbedtls_ssl_handshake_server_step(mbedtls_ssl_context *ssl);
|
int mbedtls_ssl_handshake_server_step(mbedtls_ssl_context *ssl);
|
||||||
void mbedtls_ssl_handshake_wrapup(mbedtls_ssl_context *ssl);
|
void mbedtls_ssl_handshake_wrapup(mbedtls_ssl_context *ssl);
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_DEBUG_C)
|
||||||
|
/* Declared in "ssl_debug_helpers.h". We can't include this file from
|
||||||
|
* "ssl_misc.h" because it includes "ssl_misc.h" because it needs some
|
||||||
|
* type definitions. TODO: split the type definitions and the helper
|
||||||
|
* functions into different headers.
|
||||||
|
*/
|
||||||
|
const char *mbedtls_ssl_states_str(mbedtls_ssl_states state);
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void mbedtls_ssl_handshake_set_state(mbedtls_ssl_context *ssl,
|
static inline void mbedtls_ssl_handshake_set_state(mbedtls_ssl_context *ssl,
|
||||||
mbedtls_ssl_states state)
|
mbedtls_ssl_states state)
|
||||||
{
|
{
|
||||||
|
MBEDTLS_SSL_DEBUG_MSG(3, ("handshake state: %d (%s) -> %d (%s)",
|
||||||
|
ssl->state, mbedtls_ssl_states_str(ssl->state),
|
||||||
|
state, mbedtls_ssl_states_str(state)));
|
||||||
ssl->state = (int) state;
|
ssl->state = (int) state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user