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

Add basic first tests for MTU setting

For now, just check that it causes us to fragment. More tests are coming in
follow-up commits to ensure we respect the exact value set, including when
renegotiating.
This commit is contained in:
Manuel Pégourié-Gonnard
2018-08-12 13:28:53 +02:00
parent 637e234d9f
commit b747c6cf9b
4 changed files with 103 additions and 6 deletions

View File

@@ -2905,6 +2905,9 @@ int mbedtls_ssl_flight_transmit( mbedtls_ssl_context *ssl )
const size_t frag_len = rem_len > max_hs_fragment_len
? max_hs_fragment_len : rem_len;
if( frag_off == 0 && frag_len != hs_len )
MBEDTLS_SSL_DEBUG_MSG( 2, ( "fragmenting handshake message" ) );
/* Messages are stored with handshake headers as if not fragmented,
* copy beginning of headers then fill fragmentation fields.
* Handshake headers: type(1) len(3) seq(2) f_off(3) f_len(3) */