From patchwork Thu Sep 28 05:53:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baird X-Patchwork-Id: 820290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n1DfpULo"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y4sbL0YM9z9s83 for ; Mon, 2 Oct 2017 04:23:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:To: 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=VFaeKWutt814xfuWl8BxAWdpFlxL8++LLY4kLWki1SA=; b=n1DfpULoNswjpO g4JVTujJhY7/u1lrewOXE0/1rxxHcg/wgD5pnJLUiYac6B/Y9z40j8vtLeYtAkzItqahDYMY61OvN sYs23+o3ffR6JvlqHeEcJ4WpVJOWAYzuNADVG3ZCUQ/x834RJj7OP3CymtqiVUlx6gKJcmBfKfD4w ORD6p8fuQ8k4DLqfsBFzGqLRBTChCKVs0xVh+STyvhxCCjUPuLyVwK6Wl2k/XH8hXr+7OlUZSas0J ob9UdDL0g/2M83rfLZQeilEOnPH76t0jKiZcor+ifMnemFvsej4C9YvbJKhGVpsCVT6Yp6a4lYH5X 7mHvuxpRh0dtFSAiCUyg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dyhxh-0005TH-Vj; Sun, 01 Oct 2017 17:23:29 +0000 Received: from kaukau.ecs.vuw.ac.nz ([130.195.5.20]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dxRll-0002gQ-J9 for hostap@lists.infradead.org; Thu, 28 Sep 2017 05:53:59 +0000 Received: from mail1.ecs.vuw.ac.nz (mail1.ecs.vuw.ac.nz [130.195.5.23]) by kaukau.ecs.vuw.ac.nz (8.15.2/8.13.3) with ESMTP id v8S5rZ48004351 for ; Thu, 28 Sep 2017 18:53:35 +1300 (NZDT) Received: from single-file.ecs.vuw.ac.nz (single-file.ecs.vuw.ac.nz [130.195.5.54]) (authenticated bits=0) by mail1.ecs.vuw.ac.nz (8.15.2/8.13.3) with ESMTPSA id v8S5rZGY001319 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Thu, 28 Sep 2017 18:53:35 +1300 (NZDT) To: hostap@lists.infradead.org From: Michael Baird Subject: [PATCH] Added event messages for more eap states. Message-ID: <057fd543-1a68-32f5-6814-4991d7d47e26@ecs.vuw.ac.nz> Date: Thu, 28 Sep 2017 18:53:35 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (kaukau.ecs.vuw.ac.nz [130.195.5.20]); Thu, 28 Sep 2017 18:53:35 +1300 (NZDT) X-Scanned-By: MIMEDefang 2.78 on 130.195.5.20 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170927_225357_975644_8840C874 X-CRM114-Status: UNSURE ( 9.32 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [130.195.5.20 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Mailman-Approved-At: Sun, 01 Oct 2017 10:23:07 -0700 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 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 While using an external RADIUS server SUCCESS messages were not being sent (internal was fine). Also added event messages for other states that others might find useful, and consistency between the two. Signed-off-by: Michael Baird --- src/common/wpa_ctrl.h | 11 +++++++++++ src/eap_server/eap_server.c | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) -- 2.7.4 diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index c59bc60..7577387 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -50,10 +50,21 @@ extern "C" { #define WPA_EVENT_EAP_TLS_CERT_ERROR "CTRL-EVENT-EAP-TLS-CERT-ERROR " /** EAP status */ #define WPA_EVENT_EAP_STATUS "CTRL-EVENT-EAP-STATUS " +/** EAP statemachine is waiting */ +#define WPA_EVENT_EAP_IDLE "CTRL-EVENT-EAP-IDLE " +#define WPA_EVENT_EAP_IDLE2 "CTRL-EVENT-EAP-IDLE2 " +/** Retransmits the previous request packet */ +#define WPA_EVENT_EAP_RETRANSMIT "CTRL-EVENT-EAP-RETRANSMIT " +#define WPA_EVENT_EAP_RETRANSMIT2 "CTRL-EVENT-EAP-RETRANSMIT2 " /** EAP authentication completed successfully */ #define WPA_EVENT_EAP_SUCCESS "CTRL-EVENT-EAP-SUCCESS " +#define WPA_EVENT_EAP_SUCCESS2 "CTRL-EVENT-EAP-SUCCESS2 " /** EAP authentication failed (EAP-Failure received) */ #define WPA_EVENT_EAP_FAILURE "CTRL-EVENT-EAP-FAILURE " +#define WPA_EVENT_EAP_FAILURE2 "CTRL-EVENT-EAP-FAILURE2 " +/** EAP authentication failed due to no response received */ +#define WPA_EVENT_EAP_TIMEOUT_FAILURE "CTRL-EVENT-EAP-TIMEOUT-FAILURE " +#define WPA_EVENT_EAP_TIMEOUT_FAILURE2 "CTRL-EVENT-EAP-TIMEOUT-FAILURE2 " /** Network block temporarily disabled (e.g., due to authentication failure) */ #define WPA_EVENT_TEMP_DISABLED "CTRL-EVENT-SSID-TEMP-DISABLED " /** Temporarily disabled network block re-enabled */ diff --git a/src/eap_server/eap_server.c b/src/eap_server/eap_server.c index 9706e25..53873d6 100644 --- a/src/eap_server/eap_server.c +++ b/src/eap_server/eap_server.c @@ -314,6 +314,8 @@ SM_STATE(EAP, IDLE) sm->eap_if.retransWhile = eap_sm_calculateTimeout( sm, sm->retransCount, sm->eap_if.eapSRTT, sm->eap_if.eapRTTVAR, sm->methodTimeout); + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_FAILURE + MACSTR, MAC2STR(sm->peer_addr)); } @@ -326,6 +328,9 @@ SM_STATE(EAP, RETRANSMIT) if (eap_copy_buf(&sm->eap_if.eapReqData, sm->lastReqData) == 0) sm->eap_if.eapReq = TRUE; } + + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_RETRANSMIT + MACSTR, MAC2STR(sm->peer_addr)); } @@ -634,6 +639,9 @@ SM_STATE(EAP, TIMEOUT_FAILURE) SM_ENTRY(EAP, TIMEOUT_FAILURE); sm->eap_if.eapTimeout = TRUE; + + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_TIMEOUT_FAILURE + MACSTR, MAC2STR(sm->peer_addr)); } @@ -999,6 +1007,9 @@ SM_STATE(EAP, IDLE2) sm->eap_if.retransWhile = eap_sm_calculateTimeout( sm, sm->retransCount, sm->eap_if.eapSRTT, sm->eap_if.eapRTTVAR, sm->methodTimeout); + + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_IDLE2 + MACSTR, MAC2STR(sm->peer_addr)); } @@ -1011,6 +1022,9 @@ SM_STATE(EAP, RETRANSMIT2) if (eap_copy_buf(&sm->eap_if.eapReqData, sm->lastReqData) == 0) sm->eap_if.eapReq = TRUE; } + + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_RETRANSMIT2 + MACSTR, MAC2STR(sm->peer_addr)); } @@ -1093,6 +1107,9 @@ SM_STATE(EAP, AAA_IDLE) sm->eap_if.aaaEapReq = FALSE; sm->eap_if.aaaEapNoReq = FALSE; sm->eap_if.aaaEapResp = TRUE; + + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_IDLE + MACSTR, MAC2STR(sm->peer_addr)); } @@ -1101,6 +1118,9 @@ SM_STATE(EAP, TIMEOUT_FAILURE2) SM_ENTRY(EAP, TIMEOUT_FAILURE2); sm->eap_if.eapTimeout = TRUE; + + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_TIMEOUT_FAILURE2 + MACSTR, MAC2STR(sm->peer_addr)); } @@ -1110,6 +1130,9 @@ SM_STATE(EAP, FAILURE2) eap_copy_buf(&sm->eap_if.eapReqData, sm->eap_if.aaaEapReqData); sm->eap_if.eapFail = TRUE; + + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_FAILURE2 + MACSTR, MAC2STR(sm->peer_addr)); } @@ -1136,6 +1159,10 @@ SM_STATE(EAP, SUCCESS2) * started properly. */ sm->start_reauth = TRUE; + + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_SUCCESS2 + MACSTR, MAC2STR(sm->peer_addr)); + }