1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Add dummy stages for client_hello_process

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu
2021-08-18 16:38:40 +08:00
parent a13c7e739c
commit 65dd2ccfe6
5 changed files with 160 additions and 0 deletions

View File

@@ -26,6 +26,7 @@
#include "mbedtls/ssl.h"
#include "mbedtls/cipher.h"
#include "mbedtls/debug.h"
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#include "psa/crypto.h"
@@ -102,6 +103,30 @@
#define MBEDTLS_SSL_RENEGOTIATION_DONE 2 /* Done or aborted */
#define MBEDTLS_SSL_RENEGOTIATION_PENDING 3 /* Requested (server only) */
#define MBEDTLS_SSL_PROC_STRIP_PARENS( ... ) __VA_ARGS__
#define MBEDTLS_SSL_PROC_CHK( fn, args ) \
do { \
ret = fn(MBEDTLS_SSL_PROC_STRIP_PARENS args); \
if( ret != 0 ) \
{ \
if( ret > 0 ) \
ret = MBEDTLS_ERR_SSL_INTERNAL_ERROR; \
MBEDTLS_SSL_DEBUG_RET( 1, #fn, ret ); \
goto cleanup; \
} \
} while( 0 )
#define MBEDTLS_SSL_PROC_CHK_NEG( fn, args ) \
do { \
ret = fn(MBEDTLS_SSL_PROC_STRIP_PARENS args); \
if( ret < 0 ) \
{ \
MBEDTLS_SSL_DEBUG_RET( 1, #fn, ret ); \
goto cleanup; \
} \
} while( 0 )
/*
* DTLS retransmission states, see RFC 6347 4.2.4
*
@@ -1331,6 +1356,18 @@ static inline void mbedtls_ssl_handshake_set_state( mbedtls_ssl_context* ssl,
ssl->state = state;
}
int mbedtls_ssl_start_handshake_msg( mbedtls_ssl_context *ssl,
unsigned hs_type,
unsigned char **buf,
size_t *buflen );
int mbedtls_ssl_finish_handshake_msg( mbedtls_ssl_context *ssl,
size_t buf_len,
size_t msg_len );
void mbedtls_ssl_add_hs_hdr_to_checksum( mbedtls_ssl_context *ssl,
unsigned hs_type,
size_t total_hs_len );
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
#endif /* ssl_misc.h */