Skip to content

Commit bfec8af

Browse files
Fix issue with error check during handshake defragmentation
This check made sense without defragmentation but since now it's valid to have message less than the minimum size as part of the bigger fragmented message. Signed-off-by: Waleed Elmelegy <[email protected]>
1 parent e6fe525 commit bfec8af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/ssl_msg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3219,7 +3219,7 @@ 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+
if (ssl->in_msglen < mbedtls_ssl_hs_hdr_len(ssl) && ssl->in_hsfraglen == 0) {
32233223
MBEDTLS_SSL_DEBUG_MSG(1, ("handshake message too short: %" MBEDTLS_PRINTF_SIZET,
32243224
ssl->in_msglen));
32253225
return MBEDTLS_ERR_SSL_INVALID_RECORD;

0 commit comments

Comments
 (0)