diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 386e2a458..21aa7f628 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -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 */ diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index c423bc3be..c87232e0f 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -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 diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index eca0d0ff3..0ae6adf81 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -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; }; diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 3a4c35f4b..8a73fa816 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -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 */ diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index faff935d2..007d8a344 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -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; }