[network-manager-applet/ac/libnma-owe] nm-connection-editor: use the new owe implementation in libnma




commit 8b66a739d64b434e76e5e7ab038bc9755bc96387
Author: Ana Cabral <acabral redhat com>
Date:   Tue Mar 8 14:14:29 2022 +0100

    nm-connection-editor: use the new owe implementation in libnma
    
    https://gitlab.gnome.org/GNOME/libnma/-/issues/9
    
    Related to 38731695f7b38d867e51b3d5cee2d0281c315a71

 src/connection-editor/page-wifi-security.c | 41 ++++++++++--------------------
 1 file changed, 14 insertions(+), 27 deletions(-)
---
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
index e8086452..fa43808f 100644
--- a/src/connection-editor/page-wifi-security.c
+++ b/src/connection-editor/page-wifi-security.c
@@ -426,15 +426,16 @@ finish_setup (CEPageWifiSecurity *self, gpointer user_data)
        }
 
        if (security_valid (NMU_SEC_OWE, mode)) {
-               gtk_list_store_append (sec_model, &iter);
-               gtk_list_store_set (sec_model, &iter,
-                                   S_NAME_COLUMN, _("Enhanced Open"),
-                                   S_ADHOC_VALID_COLUMN, FALSE,
-                                   S_HOTSPOT_VALID_COLUMN, TRUE,
-                                   -1);
-               if ((active < 0) && (default_type == NMU_SEC_OWE))
-                       active = item;
-               item++;
+               NMAWsOwe *ws_owe;
+
+               ws_owe = nma_ws_owe_new (connection);
+               if (ws_owe) {
+                       add_security_item (self, NMA_WS (ws_owe), sec_model,
+                                                          &iter, _("Enhanced Open"), FALSE, TRUE);
+                       if ((active < 0) && ((default_type == NMU_SEC_OWE)))
+                               active = item;
+                       item++;
+               }
        }
 
        combo = GTK_COMBO_BOX (gtk_builder_get_object (parent->builder, "wifi_security_combo"));
@@ -580,24 +581,10 @@ ce_page_validate_v (CEPage *page, NMConnection *connection, GError **error)
 
                g_object_unref (ws);
        } else {
-
-               if (gtk_combo_box_get_active (priv->security_combo) == 0) {
-                       /* No security, unencrypted */
-                       nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
-                       nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
-                       valid = TRUE;
-               } else {
-                       /* owe case:
-                        * fill the connection manually until libnma implements OWE wireless security
-                        */
-                       NMSetting *s_wireless_sec;
-
-                       s_wireless_sec = nm_setting_wireless_security_new ();
-                       g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "owe", NULL);
-                       nm_connection_add_setting (connection, s_wireless_sec);
-                       nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
-                       valid = TRUE;
-               }
+               /* No security, unencrypted */
+               nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
+               nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
+               valid = TRUE;
        }
 
        return valid;


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