summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/connection-editor/nm-connection-editor.c6
-rw-r--r--src/ethernet-dialog.c7
-rw-r--r--src/wireless-security/eap-method.c102
-rw-r--r--src/wireless-security/eap-method.h15
-rw-r--r--src/wireless-security/meson.build23
5 files changed, 6 insertions, 147 deletions
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index de3c16bf..ae2d1275 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -23,6 +23,7 @@
#include "nm-connection-editor.h"
#include "nma-cert-chooser.h"
+#include "nma-ui-utils.h"
#include "ce-page.h"
#include "page-general.h"
@@ -51,7 +52,6 @@
#include "page-wireguard.h"
#include "ce-polkit-button.h"
#include "vpn-helpers.h"
-#include "eap-method.h"
extern gboolean nm_ce_keep_above;
@@ -985,7 +985,7 @@ nm_connection_editor_set_connection (NMConnectionEditor *editor,
nm_connection_editor_update_title (editor);
/* Handle CA cert ignore stuff */
- eap_method_ca_cert_ignore_load (editor->connection);
+ nma_utils_ca_cert_ignore_load (editor->connection);
s_con = nm_connection_get_setting_connection (editor->connection);
g_assert (s_con);
@@ -1221,7 +1221,7 @@ ok_button_clicked_save_connection (NMConnectionEditor *self)
nm_connection_editor_set_busy (self, TRUE);
/* Save new CA cert ignore values to GSettings */
- eap_method_ca_cert_ignore_save (self->connection);
+ nma_utils_ca_cert_ignore_save (self->connection);
if (self->is_new_connection) {
nm_client_add_connection_async (self->client,
diff --git a/src/ethernet-dialog.c b/src/ethernet-dialog.c
index c558542b..498cdf35 100644
--- a/src/ethernet-dialog.c
+++ b/src/ethernet-dialog.c
@@ -9,11 +9,10 @@
#include "nm-default.h"
-
#include "nma-ws.h"
+#include "nma-ui-utils.h"
#include "ethernet-dialog.h"
#include "applet-dialogs.h"
-#include "eap-method.h"
static void
stuff_changed_cb (NMAWs *ws, gpointer user_data)
@@ -92,7 +91,7 @@ nma_ethernet_dialog_new (NMConnection *connection)
dialog_set_network_name (connection, GTK_ENTRY (gtk_builder_get_object (builder, "network_name_entry")));
/* Handle CA cert ignore stuff */
- eap_method_ca_cert_ignore_load (connection);
+ nma_utils_ca_cert_ignore_load (connection);
security = dialog_set_security (connection, builder, GTK_BOX (gtk_builder_get_object (builder, "security_vbox")));
g_signal_connect (security, "ws-changed", G_CALLBACK (stuff_changed_cb), GTK_WIDGET (gtk_builder_get_object (builder, "ok_button")));
@@ -128,7 +127,7 @@ nma_ethernet_dialog_get_connection (GtkWidget *dialog)
nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
/* Save new CA cert ignore values to GSettings */
- eap_method_ca_cert_ignore_save (connection);
+ nma_utils_ca_cert_ignore_save (connection);
return connection;
}
diff --git a/src/wireless-security/eap-method.c b/src/wireless-security/eap-method.c
deleted file mode 100644
index b874072b..00000000
--- a/src/wireless-security/eap-method.c
+++ /dev/null
@@ -1,102 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-
-/* NetworkManager Applet -- allow user control over networking
- *
- * Dan Williams <dcbw@redhat.com>
- *
- * Copyright 2007 - 2014 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include "eap-method.h"
-
-/* Used as both GSettings keys and GObject data tags */
-#define IGNORE_CA_CERT_TAG "ignore-ca-cert"
-#define IGNORE_PHASE2_CA_CERT_TAG "ignore-phase2-ca-cert"
-
-static GSettings *
-_get_ca_ignore_settings (NMConnection *connection)
-{
- GSettings *settings;
- char *path = NULL;
- const char *uuid;
-
- g_return_val_if_fail (connection, NULL);
-
- uuid = nm_connection_get_uuid (connection);
- g_return_val_if_fail (uuid && *uuid, NULL);
-
- path = g_strdup_printf ("/org/gnome/nm-applet/eap/%s/", uuid);
- settings = g_settings_new_with_path ("org.gnome.nm-applet.eap", path);
- g_free (path);
-
- return settings;
-}
-
-/**
- * eap_method_ca_cert_ignore_save:
- * @connection: the connection for which to save CA cert ignore values to GSettings
- *
- * Reads the CA cert ignore tags from the 802.1x setting GObject data and saves
- * then to GSettings if present, using the connection UUID as the index.
- */
-void
-eap_method_ca_cert_ignore_save (NMConnection *connection)
-{
- NMSetting8021x *s_8021x;
- GSettings *settings;
- gboolean ignore = FALSE, phase2_ignore = FALSE;
-
- g_return_if_fail (connection);
-
- s_8021x = nm_connection_get_setting_802_1x (connection);
- if (s_8021x) {
- ignore = !!g_object_get_data (G_OBJECT (s_8021x), IGNORE_CA_CERT_TAG);
- phase2_ignore = !!g_object_get_data (G_OBJECT (s_8021x), IGNORE_PHASE2_CA_CERT_TAG);
- }
-
- settings = _get_ca_ignore_settings (connection);
- if (!settings)
- return;
-
- g_settings_set_boolean (settings, IGNORE_CA_CERT_TAG, ignore);
- g_settings_set_boolean (settings, IGNORE_PHASE2_CA_CERT_TAG, phase2_ignore);
- g_object_unref (settings);
-}
-
-/**
- * eap_method_ca_cert_ignore_load:
- * @connection: the connection for which to load CA cert ignore values to GSettings
- *
- * Reads the CA cert ignore tags from the 802.1x setting GObject data and saves
- * then to GSettings if present, using the connection UUID as the index.
- */
-void
-eap_method_ca_cert_ignore_load (NMConnection *connection)
-{
- GSettings *settings;
- NMSetting8021x *s_8021x;
- gboolean ignore, phase2_ignore;
-
- g_return_if_fail (connection);
-
- s_8021x = nm_connection_get_setting_802_1x (connection);
- if (!s_8021x)
- return;
-
- settings = _get_ca_ignore_settings (connection);
- if (!settings)
- return;
-
- ignore = g_settings_get_boolean (settings, IGNORE_CA_CERT_TAG);
- phase2_ignore = g_settings_get_boolean (settings, IGNORE_PHASE2_CA_CERT_TAG);
-
- g_object_set_data (G_OBJECT (s_8021x),
- IGNORE_CA_CERT_TAG,
- GUINT_TO_POINTER (ignore));
- g_object_set_data (G_OBJECT (s_8021x),
- IGNORE_PHASE2_CA_CERT_TAG,
- GUINT_TO_POINTER (phase2_ignore));
- g_object_unref (settings);
-}
diff --git a/src/wireless-security/eap-method.h b/src/wireless-security/eap-method.h
deleted file mode 100644
index 3cc9da03..00000000
--- a/src/wireless-security/eap-method.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/* NetworkManager Applet -- allow user control over networking
- *
- * Dan Williams <dcbw@redhat.com>
- *
- * Copyright 2007 - 2014 Red Hat, Inc.
- */
-
-#ifndef EAP_METHOD_H
-#define EAP_METHOD_H
-
-void eap_method_ca_cert_ignore_save (NMConnection *connection);
-void eap_method_ca_cert_ignore_load (NMConnection *connection);
-
-#endif /* EAP_METHOD_H */
diff --git a/src/wireless-security/meson.build b/src/wireless-security/meson.build
deleted file mode 100644
index 36acf3b6..00000000
--- a/src/wireless-security/meson.build
+++ /dev/null
@@ -1,23 +0,0 @@
-wireless_security_inc = include_directories('.')
-
-sources = files(
- 'eap-method.c',
-)
-
-incs = [
- top_inc,
- shared_inc,
- src_inc
-]
-
-deps = [
- gtk_dep,
- libnm_dep,
-]
-
-libwireless_security_libnm = static_library(
- 'wireless-security-libnm',
- sources: sources,
- include_directories: incs,
- dependencies: deps
-)