Commit d38eadd9 authored by Beniamino Galvani's avatar Beniamino Galvani

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.
parent 8b051bb3
......@@ -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))
......
......@@ -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);
......
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment