Add REAUTHENTICATE ctrl_iface command

This can be used to trigger EAPOL reauthentication which can be useful
for testing purposes.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2011-11-13 19:47:51 +02:00
parent 9d77a392c7
commit 9482426ede
2 changed files with 11 additions and 0 deletions

View 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;

View 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 }
};