aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-12-19 20:19:41 (GMT)
committerJouni Malinen <j@w1.fi>2008-12-19 20:19:41 (GMT)
commit469fc3a41f6ca46c7e46d6fd5762e9aa03369f1f (patch)
treed14174f74b6fa04760d6c5534f0461b1c8ab51ef /wpa_supplicant
parent4b68290e771a70f46452bd69f318e91acc9891b7 (diff)
downloadhostap-06-469fc3a41f6ca46c7e46d6fd5762e9aa03369f1f.zip
hostap-06-469fc3a41f6ca46c7e46d6fd5762e9aa03369f1f.tar.gz
hostap-06-469fc3a41f6ca46c7e46d6fd5762e9aa03369f1f.tar.bz2
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.
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wpa_gui-qt4/wpagui.cpp2
-rw-r--r--wpa_supplicant/wps_supplicant.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
index edf88ea..dc555ab 100644
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -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");
}
}
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 5f3b29d..1babe86 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -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;
}
}