mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-03 10:51:04 +00:00
Move messaging layer functionality to ssl_msg.c
Broadly, the file `ssl_tls.c` functionality from two categories: 1) An implementation of the TLS and DTLS messaging layer, that is, the record layer as well as the DTLS retransmission state machine. 2) Handshake parsing and writing functions shared between client and server (functions specific to either client or server are implemented in ssl_cli.c and ssl_srv.c, respectively). This commit is a first step towards separating those functionalities by moving a number of messaging layer related functions from ssl_tls.c to the newly created ssl_msg.c. Because of implementation-specific dependencies between handshake logic and messaging layer, a number of internal SSL functions are currently used from both the handshake and the messaging layer. Those functions will need to made public internal (i.e. declared in the mbedtls_ name- space in ssl_internal.h), but this is left for the next commit in order to ease review through `git diff --color-moved`. Also, the analysis of whether their use can/should be restricted to either ssl_tls.c or ssl_msg.c is left for future commits.
This commit is contained in:
parent
827e3ba439
commit
2259887543
|
@ -1063,4 +1063,16 @@ int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context const *ssl,
|
||||||
mbedtls_ssl_transform *transform,
|
mbedtls_ssl_transform *transform,
|
||||||
mbedtls_record *rec );
|
mbedtls_record *rec );
|
||||||
|
|
||||||
|
/* Length of the "epoch" field in the record header */
|
||||||
|
static inline size_t ssl_ep_len( const mbedtls_ssl_context *ssl )
|
||||||
|
{
|
||||||
|
#if defined(MBEDTLS_SSL_PROTO_DTLS)
|
||||||
|
if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM )
|
||||||
|
return( 2 );
|
||||||
|
#else
|
||||||
|
((void) ssl);
|
||||||
|
#endif
|
||||||
|
return( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* ssl_internal.h */
|
#endif /* ssl_internal.h */
|
||||||
|
|
7623
library/ssl_msg.c
7623
library/ssl_msg.c
File diff suppressed because it is too large
Load diff
5573
library/ssl_tls.c
5573
library/ssl_tls.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue