[gnome-control-center] Add support for Enhanced Open WiFi security



commit 1d0b664f7c5e38e9d8933956c1cc4661244edb7d
Author: David Bauer <mail david-bauer net>
Date:   Fri Jul 17 03:41:44 2020 +0000

    Add support for Enhanced Open WiFi security

 panels/network/cc-wifi-connection-row.c            | 13 +++++++++++--
 panels/network/connection-editor/ce-page-details.c |  6 ++++++
 .../network/connection-editor/ce-page-security.c   | 22 ++++++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)
---
diff --git a/panels/network/cc-wifi-connection-row.c b/panels/network/cc-wifi-connection-row.c
index d119e6ed54..4886d70b69 100644
--- a/panels/network/cc-wifi-connection-row.c
+++ b/panels/network/cc-wifi-connection-row.c
@@ -60,7 +60,8 @@ typedef enum
   NM_AP_SEC_WEP,
   NM_AP_SEC_WPA,
   NM_AP_SEC_WPA2,
-  NM_AP_SEC_SAE
+  NM_AP_SEC_SAE,
+  NM_AP_SEC_OWE
 } NMAccessPointSecurity;
 
 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;
     }
+#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
   else
     {
@@ -137,6 +144,8 @@ get_connection_security (NMConnection *con)
     return NM_AP_SEC_WPA;
   else if (g_str_equal (key_mgmt, "sae"))
     return NM_AP_SEC_SAE;
+  else if (g_str_equal (key_mgmt, "owe"))
+    return NM_AP_SEC_OWE;
   else
     return NM_AP_SEC_UNKNOWN;
 }
@@ -247,7 +256,7 @@ update_ui (CcWifiConnectionRow *self)
 
   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;
 
diff --git a/panels/network/connection-editor/ce-page-details.c 
b/panels/network/connection-editor/ce-page-details.c
index 6a7ca250d4..cd5d36cbb8 100644
--- a/panels/network/connection-editor/ce-page-details.c
+++ b/panels/network/connection-editor/ce-page-details.c
@@ -102,6 +102,12 @@ get_ap_security_string (NMAccessPoint *ap)
                         /* TRANSLATORS: this WPA3 WiFi security */
                         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
 #endif
                {
diff --git a/panels/network/connection-editor/ce-page-security.c 
b/panels/network/connection-editor/ce-page-security.c
index 717796b776..7d7f305752 100644
--- a/panels/network/connection-editor/ce-page-security.c
+++ b/panels/network/connection-editor/ce-page-security.c
@@ -90,6 +90,13 @@ get_default_type_for_security (NMSettingWirelessSecurity *sec)
                         return NMU_SEC_LEAP;
                 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 (!strcmp (key_mgmt, "sae")) {
                 return NMU_SEC_SAE;
@@ -265,6 +272,18 @@ finish_setup (CEPageSecurity *self)
                 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)) {
                 WirelessSecurityWEPKey *ws_wep;
                 NMWepKeyType wep_type = NM_WEP_KEY_TYPE_KEY;
@@ -503,6 +522,9 @@ ce_page_security_new (NMConnection *connection)
             default_type == NMU_SEC_WPA_PSK ||
 #if NM_CHECK_VERSION(1,20,6)
            default_type == NMU_SEC_SAE ||
+#endif
+#if NM_CHECK_VERSION(1,24,0)
+           default_type == NMU_SEC_OWE ||
 #endif
             default_type == NMU_SEC_WPA2_PSK) {
                 self->security_setting = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]