mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 15:40:10 +01:00
supplicant: reorganize the routine that sets key_mgmt a bit
This is functionally equivalent, it only makes it easier to plug in the FT enablement logic at a later point.
This commit is contained in:
parent
f5cd641c05
commit
5480ec8537
1 changed files with 13 additions and 12 deletions
|
|
@ -754,7 +754,8 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
|||
GError **error)
|
||||
{
|
||||
NMSupplicantConfigPrivate *priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self);
|
||||
const char *key_mgmt, *key_mgmt_conf, *auth_alg;
|
||||
nm_auto_free_gstring GString *key_mgmt_conf = NULL;
|
||||
const char *key_mgmt, *auth_alg;
|
||||
const char *psk;
|
||||
gboolean set_pmf;
|
||||
|
||||
|
|
@ -773,28 +774,28 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
|||
fils = NM_SETTING_WIRELESS_SECURITY_FILS_DISABLE;
|
||||
}
|
||||
|
||||
key_mgmt = key_mgmt_conf = nm_setting_wireless_security_get_key_mgmt (setting);
|
||||
key_mgmt = nm_setting_wireless_security_get_key_mgmt (setting);
|
||||
key_mgmt_conf = g_string_new (key_mgmt);
|
||||
if (nm_streq (key_mgmt, "wpa-psk")) {
|
||||
if (priv->support_pmf)
|
||||
key_mgmt_conf = "wpa-psk wpa-psk-sha256";
|
||||
g_string_append (key_mgmt_conf, " wpa-psk-sha256");
|
||||
} else if (nm_streq (key_mgmt, "wpa-eap")) {
|
||||
if (priv->support_pmf)
|
||||
g_string_append (key_mgmt_conf, " wpa-eap-sha256");
|
||||
switch (fils) {
|
||||
case NM_SETTING_WIRELESS_SECURITY_FILS_OPTIONAL:
|
||||
key_mgmt_conf = priv->support_pmf
|
||||
? "wpa-eap wpa-eap-sha256 fils-sha256 fils-sha384"
|
||||
: "wpa-eap fils-sha256 fils-sha384";
|
||||
break;
|
||||
case NM_SETTING_WIRELESS_SECURITY_FILS_REQUIRED:
|
||||
key_mgmt_conf = "fils-sha256 fils-sha384";
|
||||
g_string_assign (key_mgmt_conf, "fils-sha256 fils-sha384");
|
||||
break;
|
||||
case NM_SETTING_WIRELESS_SECURITY_FILS_OPTIONAL:
|
||||
if (priv->support_pmf)
|
||||
g_string_append (key_mgmt_conf, " fils-sha256 fils-sha384");
|
||||
break;
|
||||
default:
|
||||
if (priv->support_pmf)
|
||||
key_mgmt_conf = "wpa-eap wpa-eap-sha256";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!add_string_val (self, key_mgmt_conf, "key_mgmt", TRUE, NULL, error))
|
||||
if (!add_string_val (self, key_mgmt_conf->str, "key_mgmt", TRUE, NULL, error))
|
||||
return FALSE;
|
||||
|
||||
auth_alg = nm_setting_wireless_security_get_auth_alg (setting);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue