diff mbox series

eap-tls: Allow tls_msg_len to be zero

Message ID 1Nzi5TXKeegCbYp_JtW0ImxohaCclZWDu-VPAdUpguYP81MxtYr5g6PFwORmGDoOQ7fYErD-uJENgsCmZiHFVr-u0DwrHrFP1EvPGNgSkVg=@peeters.gent (mailing list archive)
State Accepted, archived
Headers show
Series eap-tls: Allow tls_msg_len to be zero | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-alpine-ci-setupell success Prep - Setup ELL
prestwoj/iwd-ci-setupell success Prep - Setup ELL
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

Laura Peeters May 31, 2024, 12:36 p.m. UTC
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(-)

Comments

Denis Kenzior May 31, 2024, 9:23 p.m. UTC | #1
Hi Laura,

On 5/31/24 7:36 AM, Laura Peeters wrote:
> 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(-)

Applied, thanks.

Regards,
-Denis
diff mbox series

Patch

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