summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-03-18 14:45:35 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2017-04-15 10:36:55 +0200
commitd38eadd9907b216da12b2dc5bafe7a1b4ad07003 (patch)
treec9b86c15387acbf5adca299d64f0c4b9f459ae8c
parent8b051bb35e38e468d630431f1f5215a71d6049f6 (diff)
supplicant: enable PMF based on driver type
Instead of adding a new flag to configuration based on connection type, use the driver-type field directly in the supplicant-interface.
-rw-r--r--src/supplicant/nm-supplicant-config.c13
-rw-r--r--src/supplicant/nm-supplicant-config.h2
-rw-r--r--src/supplicant/nm-supplicant-interface.c37
3 files changed, 18 insertions, 34 deletions
diff --git a/src/supplicant/nm-supplicant-config.c b/src/supplicant/nm-supplicant-config.c
index 0f33f20c5f..1f4c74a5f4 100644
--- a/src/supplicant/nm-supplicant-config.c
+++ b/src/supplicant/nm-supplicant-config.c
@@ -44,7 +44,6 @@ typedef struct {
GHashTable *config;
GHashTable *blobs;
guint32 ap_scan;
- guint32 pmf;
gboolean fast_required;
gboolean dispose_has_run;
} NMSupplicantConfigPrivate;
@@ -97,7 +96,6 @@ nm_supplicant_config_init (NMSupplicantConfig * self)
(GDestroyNotify) blob_free);
priv->ap_scan = 1;
- priv->pmf = 1;
priv->dispose_has_run = FALSE;
}
@@ -282,14 +280,6 @@ nm_supplicant_config_get_ap_scan (NMSupplicantConfig * self)
return NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->ap_scan;
}
-guint32
-nm_supplicant_config_get_pmf (NMSupplicantConfig * self)
-{
- g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), 1);
-
- return NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->pmf;
-}
-
gboolean
nm_supplicant_config_fast_required (NMSupplicantConfig *self)
{
@@ -477,8 +467,6 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
else
priv->ap_scan = 1;
- priv->pmf = 1;
-
ssid = nm_setting_wireless_get_ssid (setting);
if (!nm_supplicant_config_add_option (self, "ssid",
(char *) g_bytes_get_data (ssid, NULL),
@@ -943,7 +931,6 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
if (!add_string_val (self, "0", "eapol_flags", FALSE, NULL, error))
return FALSE;
priv->ap_scan = 0;
- priv->pmf = 0;
}
if (!ADD_STRING_LIST_VAL (self, setting, 802_1x, eap_method, eap_methods, "eap", ' ', TRUE, NULL, error))
diff --git a/src/supplicant/nm-supplicant-config.h b/src/supplicant/nm-supplicant-config.h
index 8f67eb3fa1..6acfb7ee14 100644
--- a/src/supplicant/nm-supplicant-config.h
+++ b/src/supplicant/nm-supplicant-config.h
@@ -44,8 +44,6 @@ NMSupplicantConfig *nm_supplicant_config_new (void);
guint32 nm_supplicant_config_get_ap_scan (NMSupplicantConfig *self);
-guint32 nm_supplicant_config_get_pmf (NMSupplicantConfig *self);
-
gboolean nm_supplicant_config_fast_required (NMSupplicantConfig *self);
GVariant *nm_supplicant_config_to_variant (NMSupplicantConfig *self);
diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c
index fc25a414dc..dbdee193da 100644
--- a/src/supplicant/nm-supplicant-interface.c
+++ b/src/supplicant/nm-supplicant-interface.c
@@ -487,15 +487,11 @@ set_pmf_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
if (!reply) {
g_dbus_error_strip_remote_error (error);
- _LOGW ("couldn't send PMF mode to the supplicant interface: %s",
- error->message);
- emit_error_helper (self, error);
+ _LOGW ("couldn't enable PMF: %s", error->message);
return;
}
- _LOGI ("config: set interface pmf to %d",
- nm_supplicant_config_get_pmf (priv->cfg));
-
+ _LOGD ("PMF enabled");
}
gboolean
@@ -812,7 +808,7 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_
/* Scan result aging parameters */
g_dbus_proxy_call (priv->iface_proxy,
- "org.freedesktop.DBus.Properties.Set",
+ DBUS_INTERFACE_PROPERTIES ".Set",
g_variant_new ("(ssv)",
WPAS_DBUS_IFACE_INTERFACE,
"BSSExpireAge",
@@ -823,7 +819,7 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_
NULL,
NULL);
g_dbus_proxy_call (priv->iface_proxy,
- "org.freedesktop.DBus.Properties.Set",
+ DBUS_INTERFACE_PROPERTIES ".Set",
g_variant_new ("(ssv)",
WPAS_DBUS_IFACE_INTERFACE,
"BSSExpireCount",
@@ -834,6 +830,20 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_
NULL,
NULL);
+ if (priv->driver == NM_SUPPLICANT_DRIVER_WIRELESS) {
+ g_dbus_proxy_call (priv->iface_proxy,
+ DBUS_INTERFACE_PROPERTIES ".Set",
+ g_variant_new ("(ssv)",
+ WPAS_DBUS_IFACE_INTERFACE,
+ "Pmf",
+ g_variant_new_uint32 (1)),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ priv->init_cancellable,
+ (GAsyncReadyCallback) set_pmf_cb,
+ self);
+ }
+
/* Check whether NetworkReply and AP mode are supported */
priv->ready_count = 1;
g_dbus_proxy_call (priv->iface_proxy,
@@ -863,17 +873,6 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_
priv->init_cancellable,
(GAsyncReadyCallback) iface_introspect_cb,
self);
- g_dbus_proxy_call (priv->iface_proxy,
- DBUS_INTERFACE_PROPERTIES ".Set",
- g_variant_new ("(ssv)",
- WPAS_DBUS_IFACE_INTERFACE,
- "Pmf",
- g_variant_new_uint32 (nm_supplicant_config_get_pmf (priv->cfg))),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- priv->assoc_cancellable,
- (GAsyncReadyCallback) set_pmf_cb,
- self);
}
}