From patchwork Sat Oct 3 00:12:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karsten Sperling X-Patchwork-Id: 2315496 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=K5BSi3mG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=apple.com header.i=@apple.com header.a=rsa-sha256 header.s=20180706 header.b=auZjYsNb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hxhMF11tTz1y1j for ; Sat, 03 Oct 2026 20:14:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Date:Message-id:Subject:MIME-version :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UXxqqwGVqaW5quMGT07zJLw7i42BFtFNMi5wNeCs5R4=; b=K5BSi3mG778rOm YBb7iQmVLIJgYiCCnqbEAOD7Ci//fum0EuGSoUxfFSCNYKqLjjA418eNUUHOx2NuZQXkmBtHVlrqC 5HtTeeb4jRwqtP9N2K9ASMs4iR5W5hb9dsqSpFYPswyZtA7NFNwCmBc48wtdjdyaC36a4M4+OFAO6 YZ6TYOqbPDtXWfutIqJvwioRexsevkhIj5kePMrO3ym/ED5yIg/W3hMqhBUQ0LDnbc410pk92I5C2 lotmdv2n1pFuki2wdjAB8bcPq1nH2dZCSEnjYI92yyIDFlLz6MkVGFFeX8ZFihSIEHIGPpNQRkGdW AhmUxkWCtYF5pDosOhWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCwjN-0000000DLRL-3HUP; Sat, 03 Oct 2026 10:12:37 +0000 Received: from vib-mx01.apple.com ([17.132.96.0]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCwjL-0000000DLQw-2Rwc for hostap@lists.infradead.org; Sat, 03 Oct 2026 10:12:36 +0000 Received: from sg34p01nt-mtap05.apple.com (sg34p01nt-mtap05.ise.apple.com [100.85.116.67]) by vb11p01nt-mxp01.apple.com (Oracle Communications Messaging Server 8.1.0.28.20250821 64bit (built Aug 21 2025)) with ESMTPS id <0TMB1NURUTOLLN00@vb11p01nt-mxp01.apple.com> for hostap@lists.infradead.org; Sat, 03 Oct 2026 10:12:32 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-02_07,2026-10-02_02,2025-10-01_01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=20180706; bh=ohDWrrwjDEYe8yYi/ZLyDsS SzigGtQMWMoX47G6s68c=; b=auZjYsNbmevDsZ1Mkz/dMEslqh/FJ9ZcU2QdMnP HSEFLslTpvL0iLDoU2MYUyIU8ju9STEquW3neHSue1uy5Vf2N+lfxxY7iacQyUUZ 1HYZ9fFlDZHgFgZ8agyVzHpU+81mNnkk2aGSJ0gLHQs0j+rKT3jfJeXAx/2SmP30 Y9yDFE+H3rRDG1B6YYN/ihBdyygcal/10fewLmfYseEUVsFlt9+6JgvyihjJ0Bb1 FlHulchfATDxz1Z5uFI4ZXNckB85jYNVJ0t2MiHp5BoDXyhnqpRHQ5xB21lxgsVf XGZR4wobXZzgzjncxkljidqotYFss8tJUT0O/QUhmj0AzYw== Received: from sg34p01nt-mmpp07.apple.com (sg34p01nt-mmpp07.ise.apple.com [100.85.116.68]) by sg34p01nt-mtap05.apple.com (Oracle Communications Messaging Server 8.1.0.28.20250821 64bit (built Aug 21 2025)) with ESMTPS id <0TMB0MARWTOMYM00@sg34p01nt-mtap05.apple.com> for hostap@lists.infradead.org; Sat, 03 Oct 2026 10:12:22 +0000 (GMT) Received: from process_milters-daemon.sg34p01nt-mmpp07.apple.com by sg34p01nt-mmpp07.apple.com (Oracle Communications Messaging Server 8.1.0.28.20260513 64bit (built May 13 2026)) id <0TMB1JI00T74VC00@sg34p01nt-mmpp07.apple.com> for hostap@lists.infradead.org; Sat, 03 Oct 2026 10:12:22 +0000 (GMT) X-Va-A: X-Va-T-CD: cc71241c414513240b95897170558441 X-Va-E-CD: 8b38250f88f93aefb80558eb5e53b3be X-Va-R-CD: 0d1df9a0bfd4c0836e73f616f4ab3fea X-Va-ID: 81df466a-765a-4123-92bf-52e3c9bc4a03 X-Va-CD: 0 X-V-A: X-V-T-CD: cc71241c414513240b95897170558441 X-V-E-CD: 8b38250f88f93aefb80558eb5e53b3be X-V-R-CD: 0d1df9a0bfd4c0836e73f616f4ab3fea X-V-ID: fad82f91-aa1e-4363-a241-08ef5d9adc56 X-V-CD: 0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-02_07,2026-10-02_02,2025-10-01_01 Received: from smtpclient.apple (unknown [10.106.232.78]) by sg34p01nt-mmpp07.apple.com (Oracle Communications Messaging Server 8.1.0.28.20260513 64bit (built May 13 2026)) with ESMTPSA id <0TMB1JA17TOG4P00@sg34p01nt-mmpp07.apple.com> for hostap@lists.infradead.org; Sat, 03 Oct 2026 10:12:19 +0000 (GMT) From: Karsten Sperling MIME-version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: [PATCH] EAPOL auth: Populate eap_type_authsrv when eap_server=1 Message-id: <24634A94-B6DA-4424-A31B-3D1EB575CE2A@apple.com> Date: Sat, 03 Oct 2026 23:12:06 +1300 To: hostap@lists.infradead.org X-Mailer: Apple Mail (2.3864.600.51.1.1) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261003_031235_650344_78041E32 X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: -2.8 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This field was previously only populated in the RADIUS passthrough code path in ieee802_1x_decapsulate_radius(). Moving the logic into eapol_auth_tx_req() means it covers both the RADIUS and internal [...] Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [17.132.96.0 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 DMARC_PASS DMARC pass policy X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This field was previously only populated in the RADIUS passthrough code path in ieee802_1x_decapsulate_radius(). Moving the logic into eapol_auth_tx_req() means it covers both the RADIUS and internal EAP server paths. This fixes the EAP type captured in the PMKSA cache and displayed in log messages (e.g. "IEEE 802.1X: authenticated - EAP type: 13" instead of 0), and avoids bogus "Supplicant used different EAP type" logs on EAP failure. The call to eap_get_type() is now also guarded by a check for EAP_CODE_REQUEST, which avoids mis-counting an EAP_ERP_TYPE_REAUTH_START as an Identity Request in dot1xAuthEapolReqIdFramesTx. Signed-off-by: Karsten Sperling --- src/ap/ieee802_1x.c | 2 -- src/eapol_auth/eapol_auth_sm.c | 12 +++++++++++- src/eapol_auth/eapol_auth_sm_i.h | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index d2603a0a6..10ce94ae6 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -1581,8 +1581,6 @@ static void ieee802_1x_decapsulate_radius(struct hostapd_data *hapd, hdr = wpabuf_head(eap); switch (hdr->code) { case EAP_CODE_REQUEST: - if (eap_type >= 0) - sm->eap_type_authsrv = eap_type; os_snprintf(buf, sizeof(buf), "EAP-Request-%s (%d)", eap_server_get_name(0, eap_type), eap_type); break; diff --git a/src/eapol_auth/eapol_auth_sm.c b/src/eapol_auth/eapol_auth_sm.c index 5e702aeff..7d3acfda0 100644 --- a/src/eapol_auth/eapol_auth_sm.c +++ b/src/eapol_auth/eapol_auth_sm.c @@ -106,6 +106,9 @@ static void eapol_auth_tx_canned_eap(struct eapol_state_machine *sm, static void eapol_auth_tx_req(struct eapol_state_machine *sm) { + const struct eap_hdr *hdr; + enum eap_type type = EAP_TYPE_NONE; + if (sm->eap_if->eapReqData == NULL || wpabuf_len(sm->eap_if->eapReqData) < sizeof(struct eap_hdr)) { eapol_auth_logger(sm->eapol, sm->addr, @@ -122,6 +125,13 @@ static void eapol_auth_tx_req(struct eapol_state_machine *sm) return; } + hdr = wpabuf_head(sm->eap_if->eapReqData); + if (hdr->code == EAP_CODE_REQUEST) { + type = eap_get_type(sm->eap_if->eapReqData); + if (type != EAP_TYPE_NONE) + sm->eap_type_authsrv = type; + } + sm->last_eap_id = eap_get_id(sm->eap_if->eapReqData); eapol_auth_vlogger(sm->eapol, sm->addr, EAPOL_LOGGER_DEBUG, "Sending EAP Packet (identifier %d)", @@ -131,7 +141,7 @@ static void eapol_auth_tx_req(struct eapol_state_machine *sm) wpabuf_head(sm->eap_if->eapReqData), wpabuf_len(sm->eap_if->eapReqData)); sm->dot1xAuthEapolFramesTx++; - if (eap_get_type(sm->eap_if->eapReqData) == EAP_TYPE_IDENTITY) + if (type == EAP_TYPE_IDENTITY) sm->dot1xAuthEapolReqIdFramesTx++; else sm->dot1xAuthEapolReqFramesTx++; diff --git a/src/eapol_auth/eapol_auth_sm_i.h b/src/eapol_auth/eapol_auth_sm_i.h index c970e73dd..8913498dd 100644 --- a/src/eapol_auth/eapol_auth_sm_i.h +++ b/src/eapol_auth/eapol_auth_sm_i.h @@ -154,7 +154,7 @@ struct eapol_state_machine { u8 *identity; size_t identity_len; u8 eap_type_authsrv; /* EAP type of the last EAP packet from - * Authentication server */ + * Authentication server to Supplicant */ u8 eap_type_supp; /* EAP type of the last EAP packet from Supplicant */ struct radius_class_data radius_class; struct wpabuf *radius_cui; /* Chargeable-User-Identity */