From 03645acf4f988509f556e54ba9619c0be499af22 Mon Sep 17 00:00:00 2001 From: Laura Peeters Date: Fri, 31 May 2024 12:36:51 +0000 Subject: [PATCH] eap-tls: Allow tls_msg_len to be zero EAP-TTLS Start packets are empty by default, but can still be sent with the L flag set. When attempting to reassemble a message we should not fail if the length of the message is 0, and just treat it as any other unfragmented message with the L flag set. --- src/eap-tls-common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/eap-tls-common.c b/src/eap-tls-common.c index 9c9f68a0..0374845e 100644 --- a/src/eap-tls-common.c +++ b/src/eap-tls-common.c @@ -500,10 +500,9 @@ static int eap_tls_init_request_assembly(struct eap_state *eap, tls_msg_len = l_get_be32(pkt); len -= 4; - if (!tls_msg_len || tls_msg_len > EAP_TLS_PDU_MAX_LEN) { - l_warn("%s: Fragmented pkt size is outside of allowed" - " boundaries [1, %u]", eap_get_method_name(eap), - EAP_TLS_PDU_MAX_LEN); + if (tls_msg_len > EAP_TLS_PDU_MAX_LEN) { + l_warn("%s: Fragmented pkt size is larger than %u.", + eap_get_method_name(eap), EAP_TLS_PDU_MAX_LEN); return -EINVAL; }