supplicant: disable wps in wpa supplicant if disabled in config

Before this commit, in AP mode, WPS is started by default and there is no
possibility to disable it. The methods provided as WPS sources seem to
differ from device to device. With some Wifi USB sticks running in AP mode,
the WPS config methods contain "Keypad". Then, I get a pin entry dialog on
Windows machines, even if no pin is configured.

This merge request wires the existing 802-11-wireless-security.wps-method
with wpa_supplicant's configuration to allow disabling WPS.
This commit is contained in:
Georg Müller
2021-02-19 14:34:19 +01:00
parent 124e085376
commit ba8c61fe9a
2 changed files with 9 additions and 1 deletions

View File

@@ -815,7 +815,7 @@ nm_supplicant_config_add_setting_wireless_security(NMSupplicantConfig *
nm_auto_free_gstring GString *key_mgmt_conf = NULL;
const char * key_mgmt, *auth_alg;
const char * psk;
gboolean set_pmf;
gboolean set_pmf, wps_disabled;
g_return_val_if_fail(NM_IS_SUPPLICANT_CONFIG(self), FALSE);
g_return_val_if_fail(setting != NULL, FALSE);
@@ -1102,6 +1102,13 @@ nm_supplicant_config_add_setting_wireless_security(NMSupplicantConfig *
}
}
wps_disabled = (nm_setting_wireless_security_get_wps_method(setting)
== NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_DISABLED);
if (wps_disabled) {
if (!nm_supplicant_config_add_option(self, "wps_disabled", "1", 1, NULL, error))
return FALSE;
}
return TRUE;
}

View File

@@ -144,6 +144,7 @@ static const struct Opt opt_table[] = {
OPT_BYTES("wep_key2", 0),
OPT_BYTES("wep_key3", 0),
OPT_INT("wep_tx_keyidx", 0, 3),
OPT_INT("wps_disabled", 0, 1),
};
static gboolean