WPS: Added callback for failure-after-M2/M2D
This callback is now used to stop wpa_supplicant from trying to continue using parameters (most likely, device password) that do not work in a loop. In addition, wpa_gui can now notify user of failed registration.
This commit is contained in:
parent
4b68290e77
commit
469fc3a41f
8 changed files with 91 additions and 2 deletions
|
@ -804,6 +804,8 @@ void WpaGui::processMsg(char *msg)
|
|||
wpsStatusText->setText("Registration started");
|
||||
} else if (str_match(pos, WPS_EVENT_M2D)) {
|
||||
wpsStatusText->setText("Registrar does not yet know PIN");
|
||||
} else if (str_match(pos, WPS_EVENT_FAIL)) {
|
||||
wpsStatusText->setText("Registration failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
|
||||
static void wpas_wps_timeout(void *eloop_ctx, void *timeout_ctx);
|
||||
static void wpas_clear_wps(struct wpa_supplicant *wpa_s);
|
||||
|
||||
|
||||
int wpas_wps_eapol_cb(struct wpa_supplicant *wpa_s)
|
||||
|
@ -189,6 +190,14 @@ static void wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
|
|||
}
|
||||
|
||||
|
||||
static void wpa_supplicant_wps_event_fail(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_fail *fail)
|
||||
{
|
||||
wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_FAIL "msg=%d", fail->msg);
|
||||
wpas_clear_wps(wpa_s);
|
||||
}
|
||||
|
||||
|
||||
static void wpa_supplicant_wps_event(void *ctx, enum wps_event event,
|
||||
union wps_event_data *data)
|
||||
{
|
||||
|
@ -197,6 +206,9 @@ static void wpa_supplicant_wps_event(void *ctx, enum wps_event event,
|
|||
case WPS_EV_M2D:
|
||||
wpa_supplicant_wps_event_m2d(wpa_s, &data->m2d);
|
||||
break;
|
||||
case WPS_EV_FAIL:
|
||||
wpa_supplicant_wps_event_fail(wpa_s, &data->fail);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue