3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

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.
This commit is contained in:
Laura Peeters 2024-05-31 12:36:51 +00:00 committed by Denis Kenzior
parent c1e2a6c44c
commit 03645acf4f

View File

@ -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;
}