Skip to content

Commit 6c28ca6

Browse files
rojerwaleed-elmelegy-arm
authored andcommitted
Allow fragments less HS msg header size (4 bytes)
Except the first Signed-off-by: Deomid rojer Ryabkov <[email protected]>
1 parent a7a8718 commit 6c28ca6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/ssl_msg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3219,7 +3219,8 @@ static uint32_t ssl_get_hs_total_len(mbedtls_ssl_context const *ssl)
32193219

32203220
int mbedtls_ssl_prepare_handshake_record(mbedtls_ssl_context *ssl)
32213221
{
3222-
if (ssl->in_msglen < mbedtls_ssl_hs_hdr_len(ssl)) {
3222+
/* First handshake fragment must at least include the header. */
3223+
if (ssl->in_msglen < mbedtls_ssl_hs_hdr_len(ssl) && ssl->in_hslen == 0) {
32233224
MBEDTLS_SSL_DEBUG_MSG(1, ("handshake message too short: %" MBEDTLS_PRINTF_SIZET,
32243225
ssl->in_msglen));
32253226
return MBEDTLS_ERR_SSL_INVALID_RECORD;

0 commit comments

Comments
 (0)