aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-02 15:09:38 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-02 20:50:27 (GMT)
commitbd47d68035f9efbf272ad13fab22f786fd0746aa (patch)
treee4c9445216f613d0e4efdad6dc54217e22749bcd /wpa_supplicant/wps_supplicant.c
parentf47a562c73698221c4f78ebcb5efa667ea8dab0d (diff)
downloadhostap-bd47d68035f9efbf272ad13fab22f786fd0746aa.zip
hostap-bd47d68035f9efbf272ad13fab22f786fd0746aa.tar.gz
hostap-bd47d68035f9efbf272ad13fab22f786fd0746aa.tar.bz2
WPS: Reject station-mode WPS operations when AP mode is enabled
Start of station-mode WPS PBC/PIN/Registrar/NFC operation would result in the AP mode getting disabled. This can be particularly confusing for the P2P GO case where the group would need to be stopped cleanly. As such, it is better to reject these invalid operations rather than trying to handle all corner cases needed to allow this to work robustly. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 22083bd..b1266c6 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1091,6 +1091,14 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
int p2p_group)
{
struct wpa_ssid *ssid;
+
+#ifdef CONFIG_AP
+ if (wpa_s->ap_iface) {
+ wpa_printf(MSG_DEBUG,
+ "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
+ return -1;
+ }
+#endif /* CONFIG_AP */
wpas_clear_wps(wpa_s);
ssid = wpas_wps_add_network(wpa_s, 0, NULL, bssid);
if (ssid == NULL)
@@ -1131,6 +1139,13 @@ static int wpas_wps_start_dev_pw(struct wpa_supplicant *wpa_s,
unsigned int rpin = 0;
char hash[2 * WPS_OOB_PUBKEY_HASH_LEN + 10];
+#ifdef CONFIG_AP
+ if (wpa_s->ap_iface) {
+ wpa_printf(MSG_DEBUG,
+ "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
+ return -1;
+ }
+#endif /* CONFIG_AP */
wpas_clear_wps(wpa_s);
if (bssid && is_zero_ether_addr(bssid))
bssid = NULL;
@@ -1244,6 +1259,13 @@ int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid,
char *pos, *end;
int res;
+#ifdef CONFIG_AP
+ if (wpa_s->ap_iface) {
+ wpa_printf(MSG_DEBUG,
+ "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
+ return -1;
+ }
+#endif /* CONFIG_AP */
if (!pin)
return -1;
wpas_clear_wps(wpa_s);