Add support for Enhanced Open WiFi security

This commit is contained in:
David Bauer 2020-07-17 03:41:44 +00:00 committed by Robert Ancell
parent 5b573b7e25
commit 1d0b664f7c
3 changed files with 39 additions and 2 deletions

View file

@ -60,7 +60,8 @@ typedef enum
NM_AP_SEC_WEP, NM_AP_SEC_WEP,
NM_AP_SEC_WPA, NM_AP_SEC_WPA,
NM_AP_SEC_WPA2, NM_AP_SEC_WPA2,
NM_AP_SEC_SAE NM_AP_SEC_SAE,
NM_AP_SEC_OWE
} NMAccessPointSecurity; } NMAccessPointSecurity;
G_DEFINE_TYPE (CcWifiConnectionRow, cc_wifi_connection_row, GTK_TYPE_LIST_BOX_ROW) G_DEFINE_TYPE (CcWifiConnectionRow, cc_wifi_connection_row, GTK_TYPE_LIST_BOX_ROW)
@ -102,6 +103,12 @@ get_access_point_security (NMAccessPoint *ap)
{ {
type = NM_AP_SEC_SAE; type = NM_AP_SEC_SAE;
} }
#endif
#if NM_CHECK_VERSION(1,24,0)
else if (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_OWE)
{
type = NM_AP_SEC_OWE;
}
#endif #endif
else else
{ {
@ -137,6 +144,8 @@ get_connection_security (NMConnection *con)
return NM_AP_SEC_WPA; return NM_AP_SEC_WPA;
else if (g_str_equal (key_mgmt, "sae")) else if (g_str_equal (key_mgmt, "sae"))
return NM_AP_SEC_SAE; return NM_AP_SEC_SAE;
else if (g_str_equal (key_mgmt, "owe"))
return NM_AP_SEC_OWE;
else else
return NM_AP_SEC_UNKNOWN; return NM_AP_SEC_UNKNOWN;
} }
@ -247,7 +256,7 @@ update_ui (CcWifiConnectionRow *self)
gtk_widget_set_visible (GTK_WIDGET (self->active_icon), active); gtk_widget_set_visible (GTK_WIDGET (self->active_icon), active);
if (security != NM_AP_SEC_UNKNOWN && security != NM_AP_SEC_NONE) if (security != NM_AP_SEC_UNKNOWN && security != NM_AP_SEC_NONE && security != NM_AP_SEC_OWE)
{ {
gchar *icon_name; gchar *icon_name;

View file

@ -102,6 +102,12 @@ get_ap_security_string (NMAccessPoint *ap)
/* TRANSLATORS: this WPA3 WiFi security */ /* TRANSLATORS: this WPA3 WiFi security */
g_string_append_printf (str, "%s, ", _("WPA3")); g_string_append_printf (str, "%s, ", _("WPA3"));
} }
#if NM_CHECK_VERSION(1,24,0)
else if (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_OWE) {
/* TRANSLATORS: this Enhanced Open WiFi security */
g_string_append_printf (str, "%s, ", _("Enhanced Open"));
}
#endif
else else
#endif #endif
{ {

View file

@ -90,6 +90,13 @@ get_default_type_for_security (NMSettingWirelessSecurity *sec)
return NMU_SEC_LEAP; return NMU_SEC_LEAP;
return NMU_SEC_DYNAMIC_WEP; return NMU_SEC_DYNAMIC_WEP;
} }
#if NM_CHECK_VERSION(1,24,0)
if (!strcmp (key_mgmt, "owe")) {
return NMU_SEC_OWE;
}
#endif
#if NM_CHECK_VERSION(1,20,6) #if NM_CHECK_VERSION(1,20,6)
if (!strcmp (key_mgmt, "sae")) { if (!strcmp (key_mgmt, "sae")) {
return NMU_SEC_SAE; return NMU_SEC_SAE;
@ -265,6 +272,18 @@ finish_setup (CEPageSecurity *self)
item++; item++;
} }
#if NM_CHECK_VERSION(1,24,0)
if (nm_utils_security_valid (NMU_SEC_OWE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
gtk_list_store_insert_with_values (sec_model, &iter, -1,
S_NAME_COLUMN, _("Enhanced Open"),
S_ADHOC_VALID_COLUMN, FALSE,
-1);
if (active < 0 && default_type == NMU_SEC_OWE)
active = item;
item++;
}
#endif
if (nm_utils_security_valid (NMU_SEC_STATIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) { if (nm_utils_security_valid (NMU_SEC_STATIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
WirelessSecurityWEPKey *ws_wep; WirelessSecurityWEPKey *ws_wep;
NMWepKeyType wep_type = NM_WEP_KEY_TYPE_KEY; NMWepKeyType wep_type = NM_WEP_KEY_TYPE_KEY;
@ -503,6 +522,9 @@ ce_page_security_new (NMConnection *connection)
default_type == NMU_SEC_WPA_PSK || default_type == NMU_SEC_WPA_PSK ||
#if NM_CHECK_VERSION(1,20,6) #if NM_CHECK_VERSION(1,20,6)
default_type == NMU_SEC_SAE || default_type == NMU_SEC_SAE ||
#endif
#if NM_CHECK_VERSION(1,24,0)
default_type == NMU_SEC_OWE ||
#endif #endif
default_type == NMU_SEC_WPA2_PSK) { default_type == NMU_SEC_WPA2_PSK) {
self->security_setting = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME; self->security_setting = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;