dbus_new: Add EAP logon/logoff

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 <pstew@chromium.org>
This commit is contained in:
Paul Stewart 2013-04-23 17:57:55 +03:00 committed by Jouni Malinen
parent c2aff6b1d1
commit 754632c965
5 changed files with 63 additions and 1 deletions

View file

@ -332,6 +332,14 @@ fi.w1.wpa_supplicant1.CreateInterface.
<dd>Invalid entries were found in the passed argument.</dd> <dd>Invalid entries were found in the passed argument.</dd>
</dl> </dl>
</li> </li>
<li>
<h3>EAPLogoff ( ) --> nothing</h3>
<p>IEEE 802.1X EAPOL state machine logoff.</p>
</li>
<li>
<h3>EAPLogon ( ) --> nothing</h3>
<p>IEEE 802.1X EAPOL state machine logon.</p>
</li>
</ul> </ul>
\subsection dbus_interface_properties Properties \subsection dbus_interface_properties Properties

View file

@ -1533,6 +1533,10 @@ void eapol_sm_notify_logoff(struct eapol_sm *sm, Boolean logoff)
{ {
if (sm) { if (sm) {
sm->userLogoff = logoff; sm->userLogoff = logoff;
if (!logoff) {
/* If there is a delayed txStart queued, start now. */
sm->startWhen = 0;
}
eapol_sm_step(sm); eapol_sm_step(sm);
} }
} }

View file

@ -2654,6 +2654,18 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
} }
}, },
#endif /* CONFIG_AP */ #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 } } { NULL, NULL, NULL, { END_ARGS } }
}; };

View file

@ -1938,6 +1938,38 @@ DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message,
#endif /* CONFIG_AUTOSCAN */ #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 * wpas_dbus_getter_capabilities - Return interface capabilities
* @iter: Pointer to incoming dbus message iter * @iter: Pointer to incoming dbus message iter

View file

@ -128,6 +128,12 @@ DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message,
DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message, DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message,
struct wpa_supplicant *wpa_s); 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, dbus_bool_t wpas_dbus_getter_capabilities(DBusMessageIter *iter,
DBusError *error, void *user_data); DBusError *error, void *user_data);