]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Allow pbc_in_m1 workaround to be enabled in wpa_supplicant AP mode
authorWei-Jen Lin <jenlin@qca.qualcomm.com>
Thu, 3 May 2012 13:51:04 +0000 (16:51 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 3 May 2012 13:51:04 +0000 (16:51 +0300)
This workaround for Windows 7 WPS probing mechanism was previously
allowed only with hostapd, but the same interoperability issue can
happen with wpa_supplicant AP/GO mode. Allow the workaround to be
enabled in wpa_supplicant configuration for these uses.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/ap.c
wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/p2p_supplicant.c

index 386e2a45884ca0f17647388da3eb1e3f17c57a3d..21aa7f628e70bca142866fcadaf50e85ea929f1d 100644 (file)
@@ -278,6 +278,7 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
        else
                os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
        os_memcpy(bss->os_version, wpa_s->conf->os_version, 4);
+       bss->pbc_in_m1 = wpa_s->conf->pbc_in_m1;
 no_wps:
 #endif /* CONFIG_WPS */
 
index c423bc3beebb3a6622fba6641b801d0038a0a8fd..c87232e0fa670aa5d1cced3083d398dbd949b175 100644 (file)
@@ -2872,7 +2872,8 @@ static const struct global_parse_data global_fields[] = {
        { INT_RANGE(disassoc_low_ack, 0, 1), 0 },
        { INT_RANGE(interworking, 0, 1), 0 },
        { FUNC(hessid), 0 },
-       { INT_RANGE(access_network_type, 0, 15), 0 }
+       { INT_RANGE(access_network_type, 0, 15), 0 },
+       { INT_RANGE(pbc_in_m1, 0, 1), 0 }
 };
 
 #undef FUNC
index eca0d0ff369aa8f42764c55d44cdbb425135ab45..0ae6adf81a6834fe7814eac5786a00c9a8619695 100644 (file)
@@ -611,6 +611,22 @@ struct wpa_config {
         * Homogeneous ESS. This is used only if interworking is enabled.
         */
        u8 hessid[ETH_ALEN];
+
+       /**
+        * pbc_in_m1 - AP mode WPS probing workaround for PBC with Windows 7
+        *
+        * Windows 7 uses incorrect way of figuring out AP's WPS capabilities
+        * by acting as a Registrar and using M1 from the AP. The config
+        * methods attribute in that message is supposed to indicate only the
+        * configuration method supported by the AP in Enrollee role, i.e., to
+        * add an external Registrar. For that case, PBC shall not be used and
+        * as such, the PushButton config method is removed from M1 by default.
+        * If pbc_in_m1=1 is included in the configuration file, the PushButton
+        * config method is left in M1 (if included in config_methods
+        * parameter) to allow Windows 7 to use PBC instead of PIN (e.g., from
+        * a label in the AP).
+        */
+       int pbc_in_m1;
 };
 
 
index 3a4c35f4bcae2bddb6321f58cc4d2e8ec4ceeee8..8a73fa816f62e983f067ed1a3cbdbdb64da21ccd 100644 (file)
@@ -845,6 +845,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
                fprintf(f, "access_network_type=%d\n",
                        config->access_network_type);
 #endif /* CONFIG_INTERWORKING */
+       if (config->pbc_in_m1)
+               fprintf(f, "pbc_in_m1=%u\n", config->pbc_in_m1);
 }
 
 #endif /* CONFIG_NO_CONFIG_WRITE */
index faff935d22dbb48becbd556f0904f0d16ed20369..007d8a34459ec17bdacda32758fccc2a83f0754c 100644 (file)
@@ -837,6 +837,7 @@ static void wpas_p2p_clone_config(struct wpa_supplicant *dst,
        d->p2p_intra_bss = s->p2p_intra_bss;
        d->persistent_reconnect = s->persistent_reconnect;
        d->max_num_sta = s->max_num_sta;
+       d->pbc_in_m1 = s->pbc_in_m1;
 }