]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add REAUTHENTICATE ctrl_iface command
authorJouni Malinen <j@w1.fi>
Sun, 13 Nov 2011 17:47:51 +0000 (19:47 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 13 Nov 2011 17:47:51 +0000 (19:47 +0200)
This can be used to trigger EAPOL reauthentication which can be useful
for testing purposes.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_cli.c

index f29da0c18d0a0751fb64ee509c313a5784ed21d9..06061090b0ecfca2331c2ab1760920ff7e468ac5 100644 (file)
@@ -3610,6 +3610,8 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
        } else if (os_strncmp(buf, "SIGNAL_POLL", 11) == 0) {
                reply_len = wpa_supplicant_signal_poll(wpa_s, reply,
                                                       reply_size);
+       } else if (os_strcmp(buf, "REAUTHENTICATE") == 0) {
+               eapol_sm_request_reauth(wpa_s->eapol);
        } else {
                os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
                reply_len = 16;
index f14906cbef6f3c4bb230c5a0b39f036046c5c8fd..fd386647275e6531fa9ba9bc7a23d4d5a5c52997 100644 (file)
@@ -2663,6 +2663,13 @@ static int wpa_cli_cmd_signal_poll(struct wpa_ctrl *ctrl, int argc,
 }
 
 
+static int wpa_cli_cmd_reauthenticate(struct wpa_ctrl *ctrl, int argc,
+                                     char *argv[])
+{
+       return wpa_ctrl_command(ctrl, "REAUTHENTICATE");
+}
+
+
 enum wpa_cli_cmd_flags {
        cli_cmd_flag_none               = 0x00,
        cli_cmd_flag_sensitive          = 0x01
@@ -3005,6 +3012,8 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
        { "signal_poll", wpa_cli_cmd_signal_poll,
          cli_cmd_flag_none,
          "= get signal parameters" },
+       { "reauthenticate", wpa_cli_cmd_reauthenticate, cli_cmd_flag_none,
+         "= trigger IEEE 802.1X/EAPOL reauthentication" },
        { NULL, NULL, cli_cmd_flag_none, NULL }
 };