aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBilal Hatipoglu <bilal.hatipoglu@airties.com>2019-09-05 09:33:44 (GMT)
committerJouni Malinen <j@w1.fi>2019-12-25 18:58:52 (GMT)
commitb1b62a13648e8cd7efd994c4f07e2b261ea4356b (patch)
treebf12a41f07440479124a63e3c0dd3c9c8b3a0013
parent0b1839405e20d9c7a21bd392fe711069affcf62b (diff)
downloadhostap-b1b62a13648e8cd7efd994c4f07e2b261ea4356b.zip
hostap-b1b62a13648e8cd7efd994c4f07e2b261ea4356b.tar.gz
hostap-b1b62a13648e8cd7efd994c4f07e2b261ea4356b.tar.bz2
WPS: Add WPS-PIN-ACTIVE and WPS-CANCEL events
WPS_EVENT_CANCEL is added to indicate cancellation of a WPS operation for any reason in hostapd/wpa_supplicant. WPS_EVENT_PIN_ACTIVE is added to indicate when a PIN operation is triggered in wpa_supplicant. Signed-off-by: Veli Demirel <veli.demirel@airties.com> Signed-off-by: Bilal Hatipoglu <bilal.hatipoglu@airties.com>
-rw-r--r--src/ap/wps_hostapd.c1
-rw-r--r--src/common/wpa_ctrl.h2
-rw-r--r--wpa_supplicant/wps_supplicant.c5
3 files changed, 8 insertions, 0 deletions
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c
index 33caeaf..175b9fc 100644
--- a/src/ap/wps_hostapd.c
+++ b/src/ap/wps_hostapd.c
@@ -1417,6 +1417,7 @@ static int wps_cancel(struct hostapd_data *hapd, void *ctx)
data->count++;
wps_registrar_wps_cancel(hapd->wps->registrar);
ap_for_each_sta(hapd, ap_sta_wps_cancel, NULL);
+ wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_CANCEL);
}
return 0;
diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index 5258189..f03c698 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -301,6 +301,8 @@ extern "C" {
#define WPS_EVENT_AP_SETUP_UNLOCKED "WPS-AP-SETUP-UNLOCKED "
#define WPS_EVENT_AP_PIN_ENABLED "WPS-AP-PIN-ENABLED "
#define WPS_EVENT_AP_PIN_DISABLED "WPS-AP-PIN-DISABLED "
+#define WPS_EVENT_PIN_ACTIVE "WPS-PIN-ACTIVE "
+#define WPS_EVENT_CANCEL "WPS-CANCEL "
#define AP_STA_CONNECTED "AP-STA-CONNECTED "
#define AP_STA_DISCONNECTED "AP-STA-DISCONNECTED "
#define AP_STA_POSSIBLE_PSK_MISMATCH "AP-STA-POSSIBLE-PSK-MISMATCH "
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 0599632..99ddd26 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1294,6 +1294,10 @@ static int wpas_wps_start_dev_pw(struct wpa_supplicant *wpa_s,
wpa_printf(MSG_DEBUG, "WPS: Failed to set phase1 '%s'", val);
return -1;
}
+
+ if (dev_pw_id != DEV_PW_NFC_CONNECTION_HANDOVER)
+ wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_PIN_ACTIVE);
+
if (wpa_s->wps_fragment_size)
ssid->eap.fragment_size = wpa_s->wps_fragment_size;
eloop_register_timeout(WPS_PBC_WALK_TIME, 0, wpas_wps_timeout,
@@ -1359,6 +1363,7 @@ int wpas_wps_cancel(struct wpa_supplicant *wpa_s)
wpas_clear_wps(wpa_s);
}
+ wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_CANCEL);
wpa_s->after_wps = 0;
return 0;