From patchwork Mon Apr 22 18:24:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Stewart X-Patchwork-Id: 238665 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id C800D2C00BB for ; Tue, 23 Apr 2013 06:48:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E45669D268; Mon, 22 Apr 2013 16:48:13 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lMiraW4dJR-i; Mon, 22 Apr 2013 16:48:13 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7EF639D24F; Mon, 22 Apr 2013 16:48:09 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id EB5F99D24F for ; Mon, 22 Apr 2013 16:48:07 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qOJnK6jRJRRD for ; Mon, 22 Apr 2013 16:48:04 -0400 (EDT) Received: from mail-vb0-f74.google.com (mail-vb0-f74.google.com [209.85.212.74]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 0730B9D249 for ; Mon, 22 Apr 2013 16:48:03 -0400 (EDT) Received: by mail-vb0-f74.google.com with SMTP id w16so738432vbb.1 for ; Mon, 22 Apr 2013 13:48:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:date:subject:to:message-id:x-gm-message-state; bh=Vwmq5rM5VtwC1JJTF4wNFVNUSuiHRiZ+lOxK6tC3ihE=; b=phkwYloteV83LscZuHrst7C5MQ7mdf3VkHDXTB7iWEw6CcdKYk80jrrs34HrhOURfJ JDrx/ltJ8buB0GOmNp9m/+Ztfo8GAei2yt4XDx7ckioAm7HS4VX86k/8rn+d8yJF/+Ze iOR9WrR3lXCBUUYqjs04KAcNElDdM/MFkHsfcjPXRjJziQx46eZr9L8X/5E+zBSA6In7 GeUVR/2p+l5xfEYpYRbKnsgdgbM52CsZvEe0okpPpfT1O4ahQg7HdAeB6O3gYuYTy7Oy 8CqHf3Ce6yCYhruwNWRzdQboxAKSMBYSGbWmlq12yQ+cpszmpJ1AZuSuhbSJ9DOsnUzM 8FAw== X-Received: by 10.236.133.98 with SMTP id p62mr13310986yhi.10.1366663683464; Mon, 22 Apr 2013 13:48:03 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id a64si354938yhi.1.2013.04.22.13.48.03 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 22 Apr 2013 13:48:03 -0700 (PDT) Received: from clearcreek.mtv.corp.google.com (clearcreek.mtv.corp.google.com [172.22.73.104]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 3A78A31C11E for ; Mon, 22 Apr 2013 13:48:03 -0700 (PDT) Received: by clearcreek.mtv.corp.google.com (Postfix, from userid 110058) id DE2A320049C; Mon, 22 Apr 2013 13:48:02 -0700 (PDT) From: Paul Stewart Date: Mon, 22 Apr 2013 11:24:28 -0700 Subject: [PATCH] dbus_new: Add EAP logon/logoff To: hostap@lists.shmoo.com Message-Id: <20130422204802.DE2A320049C@clearcreek.mtv.corp.google.com> X-Gm-Message-State: ALoCoQkjfqMWKyWQEd72VbvnQAPrERvF3bKOHQhfnDUBlL187YhwKTljxGYplgKVyTm9aCip46/uyAF21xM+dlrY8c4eytXZCPpbonUKW8c6t/kDhLYZl2zUNW5jq74z749fPeonKm0MLrpk6e26bmTPMEEcZrqrtMzrI20c6L+Ra15f6VBbqGoEoYHE0YFOnVUN6i0tYYTaBtcAxmBMU5BV4I6YryD+MA== X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Add "EAPLogoff" and "EAPLogon" interface DBus commands which parallel the "logoff" and "logon" wpa_ctrl commands which terminate and restart EAP authentication. Slightly enhance the "logon" case by expiring any running "startWhile" timer. Signed-hostap: Paul Stewart --- doc/dbus.doxygen | 10 +++++++++- src/eapol_supp/eapol_supp_sm.c | 4 ++++ wpa_supplicant/dbus/dbus_new.c | 12 ++++++++++++ wpa_supplicant/dbus/dbus_new_handlers.c | 32 ++++++++++++++++++++++++++++++++ wpa_supplicant/dbus/dbus_new_handlers.h | 6 ++++++ 5 files changed, 63 insertions(+), 1 deletion(-) diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen index a737ed7..988f769 100644 --- a/doc/dbus.doxygen +++ b/doc/dbus.doxygen @@ -331,7 +331,15 @@ fi.w1.wpa_supplicant1.CreateInterface.
fi.w1.wpa_supplicant1.InvalidArgs
Invalid entries were found in the passed argument.
- + +
  • +

    EAPLogoff ( ) --> nothing

    +

    IEEE 802.1X EAPOL state machine logoff.

    +
  • +
  • +

    EAPLogon ( ) --> nothing

    +

    IEEE 802.1X EAPOL state machine logon.

    +
  • \subsection dbus_interface_properties Properties diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c index 2e56086..9b054fc 100644 --- a/src/eapol_supp/eapol_supp_sm.c +++ b/src/eapol_supp/eapol_supp_sm.c @@ -1533,6 +1533,10 @@ void eapol_sm_notify_logoff(struct eapol_sm *sm, Boolean logoff) { if (sm) { sm->userLogoff = logoff; + if (!logoff) { + /* If there is a delayed txStart queued, start now. */ + sm->startWhen = 0; + } eapol_sm_step(sm); } } diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c index 136dd1a..e9bd51f 100644 --- a/wpa_supplicant/dbus/dbus_new.c +++ b/wpa_supplicant/dbus/dbus_new.c @@ -2654,6 +2654,18 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = { } }, #endif /* CONFIG_AP */ + { "EAPLogoff", WPAS_DBUS_NEW_IFACE_INTERFACE, + (WPADBusMethodHandler) &wpas_dbus_handler_eap_logoff, + { + END_ARGS + } + }, + { "EAPLogon", WPAS_DBUS_NEW_IFACE_INTERFACE, + (WPADBusMethodHandler) &wpas_dbus_handler_eap_logon, + { + END_ARGS + } + }, { NULL, NULL, NULL, { END_ARGS } } }; diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index 335c25f..478d02f 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -1938,6 +1938,38 @@ DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message, #endif /* CONFIG_AUTOSCAN */ +/* + * wpas_dbus_handler_eap_logoff - IEEE 802.1X EAPOL state machine logoff + * @message: Pointer to incoming dbus message + * @wpa_s: wpa_supplicant structure for a network interface + * Returns: NULL + * + * Handler function for "EAPLogoff" method call of network interface. + */ +DBusMessage * wpas_dbus_handler_eap_logoff(DBusMessage *message, + struct wpa_supplicant *wpa_s) +{ + eapol_sm_notify_logoff(wpa_s->eapol, TRUE); + return NULL; +} + + +/* + * wpas_dbus_handler_eap_logon - IEEE 802.1X EAPOL state machine logon + * @message: Pointer to incoming dbus message + * @wpa_s: wpa_supplicant structure for a network interface + * Returns: NULL + * + * Handler function for "EAPLogin" method call of network interface. + */ +DBusMessage * wpas_dbus_handler_eap_logon(DBusMessage *message, + struct wpa_supplicant *wpa_s) +{ + eapol_sm_notify_logoff(wpa_s->eapol, FALSE); + return NULL; +} + + /** * wpas_dbus_getter_capabilities - Return interface capabilities * @iter: Pointer to incoming dbus message iter diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h index aa56550..fbc8358 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.h +++ b/wpa_supplicant/dbus/dbus_new_handlers.h @@ -128,6 +128,12 @@ DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message, DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message, struct wpa_supplicant *wpa_s); +DBusMessage * wpas_dbus_handler_eap_logoff(DBusMessage *message, + struct wpa_supplicant *wpa_s); + +DBusMessage * wpas_dbus_handler_eap_logon(DBusMessage *message, + struct wpa_supplicant *wpa_s); + dbus_bool_t wpas_dbus_getter_capabilities(DBusMessageIter *iter, DBusError *error, void *user_data);