Allow pbc_in_m1 workaround to be enabled in wpa_supplicant AP mode

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>
This commit is contained in:
Wei-Jen Lin 2012-05-03 16:51:04 +03:00 committed by Jouni Malinen
parent f571b593ba
commit 1298c14594
5 changed files with 22 additions and 1 deletions

View file

@ -278,6 +278,7 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
else else
os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN); os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
os_memcpy(bss->os_version, wpa_s->conf->os_version, 4); os_memcpy(bss->os_version, wpa_s->conf->os_version, 4);
bss->pbc_in_m1 = wpa_s->conf->pbc_in_m1;
no_wps: no_wps:
#endif /* CONFIG_WPS */ #endif /* CONFIG_WPS */

View file

@ -2872,7 +2872,8 @@ static const struct global_parse_data global_fields[] = {
{ INT_RANGE(disassoc_low_ack, 0, 1), 0 }, { INT_RANGE(disassoc_low_ack, 0, 1), 0 },
{ INT_RANGE(interworking, 0, 1), 0 }, { INT_RANGE(interworking, 0, 1), 0 },
{ FUNC(hessid), 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 #undef FUNC

View file

@ -611,6 +611,22 @@ struct wpa_config {
* Homogeneous ESS. This is used only if interworking is enabled. * Homogeneous ESS. This is used only if interworking is enabled.
*/ */
u8 hessid[ETH_ALEN]; 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;
}; };

View file

@ -845,6 +845,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
fprintf(f, "access_network_type=%d\n", fprintf(f, "access_network_type=%d\n",
config->access_network_type); config->access_network_type);
#endif /* CONFIG_INTERWORKING */ #endif /* CONFIG_INTERWORKING */
if (config->pbc_in_m1)
fprintf(f, "pbc_in_m1=%u\n", config->pbc_in_m1);
} }
#endif /* CONFIG_NO_CONFIG_WRITE */ #endif /* CONFIG_NO_CONFIG_WRITE */

View file

@ -837,6 +837,7 @@ static void wpas_p2p_clone_config(struct wpa_supplicant *dst,
d->p2p_intra_bss = s->p2p_intra_bss; d->p2p_intra_bss = s->p2p_intra_bss;
d->persistent_reconnect = s->persistent_reconnect; d->persistent_reconnect = s->persistent_reconnect;
d->max_num_sta = s->max_num_sta; d->max_num_sta = s->max_num_sta;
d->pbc_in_m1 = s->pbc_in_m1;
} }