[gnome-control-center] ce-page-security: add SAE support



commit 2e79c531942cf88051498c962116c010835ab7e1
Author: David Bauer <mail david-bauer net>
Date:   Fri Dec 20 19:54:01 2019 +0100

    ce-page-security: add SAE support

 .../network/connection-editor/ce-page-security.c   | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
---
diff --git a/panels/network/connection-editor/ce-page-security.c 
b/panels/network/connection-editor/ce-page-security.c
index e2532696a..55d0e0e27 100644
--- a/panels/network/connection-editor/ce-page-security.c
+++ b/panels/network/connection-editor/ce-page-security.c
@@ -90,6 +90,11 @@ get_default_type_for_security (NMSettingWirelessSecurity *sec)
                         return NMU_SEC_LEAP;
                 return NMU_SEC_DYNAMIC_WEP;
         }
+#if NM_CHECK_VERSION(1,20,6)
+        if (!strcmp (key_mgmt, "sae")) {
+                return NMU_SEC_SAE;
+        }
+#endif
 
         if (   !strcmp (key_mgmt, "wpa-none")
             || !strcmp (key_mgmt, "wpa-psk")) {
@@ -348,6 +353,21 @@ finish_setup (CEPageSecurity *self)
                 }
         }
 
+#if NM_CHECK_VERSION(1,20,6)
+        if (nm_utils_security_valid (NMU_SEC_SAE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
+                WirelessSecurityWPAPSK *ws_wpa_psk;
+
+                ws_wpa_psk = ws_wpa_psk_new (self->connection, FALSE);
+                if (ws_wpa_psk) {
+                        add_security_item (self, WIRELESS_SECURITY (ws_wpa_psk), sec_model,
+                                           &iter, _("WPA3 Personal"), FALSE);
+                        if ((active < 0) && ((default_type == NMU_SEC_SAE)))
+                                active = item;
+                        item++;
+                }
+        }
+#endif
+
         gtk_combo_box_set_model (self->security_combo, GTK_TREE_MODEL (sec_model));
         gtk_cell_layout_clear (GTK_CELL_LAYOUT (self->security_combo));
 
@@ -483,6 +503,9 @@ ce_page_security_new (NMConnection *connection)
         if (default_type == NMU_SEC_STATIC_WEP ||
             default_type == NMU_SEC_LEAP ||
             default_type == NMU_SEC_WPA_PSK ||
+#if NM_CHECK_VERSION(1,20,6)
+           default_type == NMU_SEC_SAE ||
+#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]