tls13: Upstream various fix in prototype
- Adjust max input_max_frag_len - Guard transform_negotiate - Adjust function position - update comments - fix wrong requirements Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
2e19981e17
commit
ddda050604
4 changed files with 24 additions and 11 deletions
|
@ -3198,12 +3198,14 @@ size_t mbedtls_ssl_get_input_max_frag_len( const mbedtls_ssl_context *ssl )
|
|||
size_t max_len = MBEDTLS_SSL_IN_CONTENT_LEN;
|
||||
size_t read_mfl;
|
||||
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||
/* Use the configured MFL for the client if we're past SERVER_HELLO_DONE */
|
||||
if( ssl->conf->endpoint == MBEDTLS_SSL_IS_CLIENT &&
|
||||
ssl->state >= MBEDTLS_SSL_SERVER_HELLO_DONE )
|
||||
{
|
||||
return ssl_mfl_code_to_length( ssl->conf->mfl_code );
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check if a smaller max length was negotiated */
|
||||
if( ssl->session_out != NULL )
|
||||
|
@ -3215,7 +3217,7 @@ size_t mbedtls_ssl_get_input_max_frag_len( const mbedtls_ssl_context *ssl )
|
|||
}
|
||||
}
|
||||
|
||||
// During a handshake, use the value being negotiated
|
||||
/* During a handshake, use the value being negotiated */
|
||||
if( ssl->session_negotiate != NULL )
|
||||
{
|
||||
read_mfl = ssl_mfl_code_to_length( ssl->session_negotiate->mfl_code );
|
||||
|
@ -3486,6 +3488,8 @@ static unsigned char ssl_serialized_session_header[] = {
|
|||
*
|
||||
* case MBEDTLS_SSL_VERSION_TLS1_2:
|
||||
* serialized_session_tls12 data;
|
||||
* case MBEDTLS_SSL_MINOR_VERSION_4:
|
||||
* serialized_session_tls13 data;
|
||||
*
|
||||
* };
|
||||
*
|
||||
|
@ -4525,7 +4529,7 @@ static int ssl_context_load( mbedtls_ssl_context *ssl,
|
|||
/* This has been allocated by ssl_handshake_init(), called by
|
||||
* by either mbedtls_ssl_session_reset_int() or mbedtls_ssl_setup(). */
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||
ssl->transform = ssl->transform_negotiate;
|
||||
ssl->transform = ssl->transform_negotiate;
|
||||
ssl->transform_in = ssl->transform;
|
||||
ssl->transform_out = ssl->transform;
|
||||
ssl->transform_negotiate = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue