[libnma/ac/owe] wireless security: change SAE compatibility macro to the compatibility file
- From: Ana Cabral <acabral src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libnma/ac/owe] wireless security: change SAE compatibility macro to the compatibility file
- Date: Wed, 9 Mar 2022 18:48:57 +0000 (UTC)
commit ca74c8ea38d6533ce6d340be019836a320b3f826
Author: Ana Cabral <acabral redhat com>
Date: Wed Mar 9 12:39:22 2022 -0300
wireless security: change SAE compatibility macro to the compatibility file
shared/nm-libnm-compat.h | 6 ++++++
src/nma-wifi-dialog.c | 7 ++-----
src/nma-ws/nma-ws-owe.c | 10 +++++-----
src/nma-ws/nma-ws-owe.h | 12 ++++++------
4 files changed, 19 insertions(+), 16 deletions(-)
---
diff --git a/shared/nm-libnm-compat.h b/shared/nm-libnm-compat.h
index fa66703e..8f8de685 100644
--- a/shared/nm-libnm-compat.h
+++ b/shared/nm-libnm-compat.h
@@ -28,6 +28,12 @@
G_GNUC_END_IGNORE_DEPRECATIONS \
})
+#define _NMU_SEC_SAE ((NMUtilsSecurityType) 9)
+#if !NM_CHECK_VERSION (1,22,0)
+#define NMU_SEC_SAE _NMU_SEC_SAE
+#endif
+G_STATIC_ASSERT(NMU_SEC_SAE == _NMU_SEC_SAE);
+
#define _NMU_SEC_OWE ((NMUtilsSecurityType) 10)
#if !NM_CHECK_VERSION (1,24,0)
#define NMU_SEC_OWE _NMU_SEC_OWE
diff --git a/src/nma-wifi-dialog.c b/src/nma-wifi-dialog.c
index 06c9af0e..9ad7f20d 100644
--- a/src/nma-wifi-dialog.c
+++ b/src/nma-wifi-dialog.c
@@ -18,9 +18,6 @@
#include "nma-ws.h"
#include "nma-eap.h"
-/* For compatibility with NetworkManager-1.20 and earlier. */
-#define NMU_SEC_SAE 9
-
G_DEFINE_TYPE (NMAWifiDialog, nma_wifi_dialog, GTK_TYPE_DIALOG)
#define NMA_WIFI_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
@@ -687,7 +684,7 @@ get_default_type_for_security (NMSettingWirelessSecurity *sec,
return NMU_SEC_STATIC_WEP;
if (!strcmp (key_mgmt, "owe"))
- return NMU_SEC_OWE;
+ return NMU_SEC_OWE;
if ( !strcmp (key_mgmt, "ieee8021x")
&& (!have_ap || (ap_flags & NM_802_11_AP_FLAGS_PRIVACY))) {
@@ -1026,7 +1023,7 @@ security_combo_init (NMAWifiDialog *self, gboolean secrets_only,
ws_owe = nma_ws_owe_new (priv->connection, secrets_only);
add_security_item (self, NMA_WS (ws_owe), sec_model,
- &iter, _("Enhanced Open"));
+ &iter, _("Enhanced Open"));
if (active < 0 && default_type == NMU_SEC_OWE)
active = item;
item++;
diff --git a/src/nma-ws/nma-ws-owe.c b/src/nma-ws/nma-ws-owe.c
index 1bd8ba66..bcbba808 100644
--- a/src/nma-ws/nma-ws-owe.c
+++ b/src/nma-ws/nma-ws-owe.c
@@ -47,8 +47,8 @@ fill_connection (NMAWs *ws, NMConnection *connection)
/* Blow away the old security setting by adding a clear one */
s_wireless_sec = nm_setting_wireless_security_new ();
g_object_set (s_wireless_sec,
- NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "owe",
- NULL);
+ NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "owe",
+ NULL);
nm_connection_add_setting (connection, s_wireless_sec);
}
@@ -134,7 +134,7 @@ nma_ws_owe_new (NMConnection *connection, gboolean secrets_only)
*/
return g_object_new (NMA_TYPE_WS_OWE,
"connection", connection,
- "secrets-only", FALSE,
+ "secrets-only", FALSE,
NULL);
}
@@ -158,9 +158,9 @@ nma_ws_owe_class_init (NMAWsOweClass *klass){
object_class->dispose = dispose;
g_object_class_override_property (object_class,
- PROP_CONNECTION, "connection");
+ PROP_CONNECTION, "connection");
g_object_class_override_property (object_class,
- PROP_SECRETS_ONLY, "secrets-only");
+ PROP_SECRETS_ONLY, "secrets-only");
}
diff --git a/src/nma-ws/nma-ws-owe.h b/src/nma-ws/nma-ws-owe.h
index fbfe0b87..4a74e324 100644
--- a/src/nma-ws/nma-ws-owe.h
+++ b/src/nma-ws/nma-ws-owe.h
@@ -8,12 +8,12 @@ G_BEGIN_DECLS
typedef struct _NMAWsOwe NMAWsOwe;
typedef struct _NMAWsOweClass NMAWsOweClass;
-#define NMA_TYPE_WS_OWE (nma_ws_owe_get_type ())
-#define NMA_WS_OWE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMA_TYPE_WS_OWE, NMAWsOwe))
-#define NMA_WS_OWE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMA_TYPE_WS_OWE, NMAWsOweClass))
-#define NMA_IS_WS_OWE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMA_TYPE_OWE))
-#define NMA_IS_OWE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMA_TYPE_WS_OWE))
-#define NMA_WS_OWE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMA_TYPE_WS_OWE, NMAWsOweClass))
+#define NMA_TYPE_WS_OWE (nma_ws_owe_get_type ())
+#define NMA_WS_OWE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMA_TYPE_WS_OWE, NMAWsOwe))
+#define NMA_WS_OWE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMA_TYPE_WS_OWE, NMAWsOweClass))
+#define NMA_IS_WS_OWE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMA_TYPE_OWE))
+#define NMA_IS_OWE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMA_TYPE_WS_OWE))
+#define NMA_WS_OWE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMA_TYPE_WS_OWE, NMAWsOweClass))
NMA_AVAILABLE_IN_1_8_36
GType nma_ws_owe_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]