mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 09:20:20 +01:00
supplicant: fix setting pmf when the supplicant doesn't advertise support
wpa_supplicant only advertises pmf support since commit [1], which is after 2.6. When using a version without that commit (for example, plain 2.6), we would unconditionally set the global Pmf property to 1 (optional) and then skip setting the per-network property. The result was that pmf was enabled without the possibility to disable it by user. The correct behavior is instead to disable pmf on such versions. [1] https://w1.fi/cgit/hostap/commit/?id=3cdb4ac074f76accf24a51d143db545afad2c90b https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/129 (cherry picked from commit560a35dd43) (cherry picked from commitb837561bb6)
This commit is contained in:
parent
25d91e3b68
commit
353743b995
1 changed files with 18 additions and 15 deletions
|
|
@ -568,9 +568,8 @@ iface_set_pmf_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
|
|||
|
||||
self = NM_SUPPLICANT_INTERFACE (user_data);
|
||||
|
||||
/* This can fail if the supplicant doesn't support PMF */
|
||||
if (error)
|
||||
_LOGD ("failed to set Pmf=1: %s", error->message);
|
||||
_LOGW ("failed to set Pmf=1: %s", error->message);
|
||||
|
||||
iface_check_ready (self);
|
||||
}
|
||||
|
|
@ -1175,19 +1174,23 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_
|
|||
NULL,
|
||||
NULL);
|
||||
|
||||
/* Initialize global PMF setting to 'optional' */
|
||||
priv->ready_count = 1;
|
||||
g_dbus_proxy_call (priv->iface_proxy,
|
||||
DBUS_INTERFACE_PROPERTIES ".Set",
|
||||
g_variant_new ("(ssv)",
|
||||
WPAS_DBUS_IFACE_INTERFACE,
|
||||
"Pmf",
|
||||
g_variant_new_string ("1")),
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1,
|
||||
priv->init_cancellable,
|
||||
(GAsyncReadyCallback) iface_set_pmf_cb,
|
||||
self);
|
||||
priv->ready_count = 0;
|
||||
|
||||
if (priv->pmf_support == NM_SUPPLICANT_FEATURE_YES) {
|
||||
/* Initialize global PMF setting to 'optional' */
|
||||
priv->ready_count++;
|
||||
g_dbus_proxy_call (priv->iface_proxy,
|
||||
DBUS_INTERFACE_PROPERTIES ".Set",
|
||||
g_variant_new ("(ssv)",
|
||||
WPAS_DBUS_IFACE_INTERFACE,
|
||||
"Pmf",
|
||||
g_variant_new_string ("1")),
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1,
|
||||
priv->init_cancellable,
|
||||
(GAsyncReadyCallback) iface_set_pmf_cb,
|
||||
self);
|
||||
}
|
||||
|
||||
/* Check whether NetworkReply and AP mode are supported */
|
||||
priv->ready_count++;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue