Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
NetworkManager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ludek Janda
NetworkManager
Commits
a72ffe23
Commit
a72ffe23
authored
Mar 18, 2017
by
Beniamino Galvani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
supplicant: enable PMF only when wpa_supplicant supports it
parent
d38eadd9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
6 deletions
+48
-6
src/supplicant/nm-supplicant-interface.c
src/supplicant/nm-supplicant-interface.c
+28
-2
src/supplicant/nm-supplicant-interface.h
src/supplicant/nm-supplicant-interface.h
+5
-1
src/supplicant/nm-supplicant-manager.c
src/supplicant/nm-supplicant-manager.c
+15
-3
No files found.
src/supplicant/nm-supplicant-interface.c
View file @
a72ffe23
...
...
@@ -80,6 +80,7 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSupplicantInterface,
PROP_DRIVER
,
PROP_FAST_SUPPORT
,
PROP_AP_SUPPORT
,
PROP_PMF_SUPPORT
,
);
typedef
struct
{
...
...
@@ -88,6 +89,7 @@ typedef struct {
gboolean
has_credreq
;
/* Whether querying 802.1x credentials is supported */
NMSupplicantFeature
fast_support
;
NMSupplicantFeature
ap_support
;
/* Lightweight AP mode support */
NMSupplicantFeature
pmf_support
;
guint32
max_scan_ssids
;
guint32
ready_count
;
...
...
@@ -587,6 +589,15 @@ nm_supplicant_interface_set_fast_support (NMSupplicantInterface *self,
priv
->
fast_support
=
fast_support
;
}
void
nm_supplicant_interface_set_pmf_support
(
NMSupplicantInterface
*
self
,
NMSupplicantFeature
pmf_support
)
{
NMSupplicantInterfacePrivate
*
priv
=
NM_SUPPLICANT_INTERFACE_GET_PRIVATE
(
self
);
priv
->
pmf_support
=
pmf_support
;
}
static
void
iface_introspect_cb
(
GDBusProxy
*
proxy
,
GAsyncResult
*
result
,
gpointer
user_data
)
{
...
...
@@ -830,7 +841,8 @@ on_iface_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_
NULL
,
NULL
);
if
(
priv
->
driver
==
NM_SUPPLICANT_DRIVER_WIRELESS
)
{
if
(
priv
->
pmf_support
&&
priv
->
driver
==
NM_SUPPLICANT_DRIVER_WIRELESS
)
{
g_dbus_proxy_call
(
priv
->
iface_proxy
,
DBUS_INTERFACE_PROPERTIES
".Set"
,
g_variant_new
(
"(ssv)"
,
...
...
@@ -1597,6 +1609,10 @@ set_property (GObject *object,
/* construct-only */
priv
->
ap_support
=
g_value_get_int
(
value
);
break
;
case
PROP_PMF_SUPPORT
:
/* construct-only */
priv
->
pmf_support
=
g_value_get_int
(
value
);
break
;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
prop_id
,
pspec
);
break
;
...
...
@@ -1616,7 +1632,8 @@ NMSupplicantInterface *
nm_supplicant_interface_new
(
const
char
*
ifname
,
NMSupplicantDriver
driver
,
NMSupplicantFeature
fast_support
,
NMSupplicantFeature
ap_support
)
NMSupplicantFeature
ap_support
,
NMSupplicantFeature
pmf_support
)
{
g_return_val_if_fail
(
ifname
!=
NULL
,
NULL
);
...
...
@@ -1625,6 +1642,7 @@ nm_supplicant_interface_new (const char *ifname,
NM_SUPPLICANT_INTERFACE_DRIVER
,
(
guint
)
driver
,
NM_SUPPLICANT_INTERFACE_FAST_SUPPORT
,
(
int
)
fast_support
,
NM_SUPPLICANT_INTERFACE_AP_SUPPORT
,
(
int
)
ap_support
,
NM_SUPPLICANT_INTERFACE_PMF_SUPPORT
,
(
int
)
pmf_support
,
NULL
);
}
...
...
@@ -1706,6 +1724,14 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass)
G_PARAM_WRITABLE
|
G_PARAM_CONSTRUCT_ONLY
|
G_PARAM_STATIC_STRINGS
);
obj_properties
[
PROP_PMF_SUPPORT
]
=
g_param_spec_int
(
NM_SUPPLICANT_INTERFACE_PMF_SUPPORT
,
""
,
""
,
NM_SUPPLICANT_FEATURE_UNKNOWN
,
NM_SUPPLICANT_FEATURE_YES
,
NM_SUPPLICANT_FEATURE_UNKNOWN
,
G_PARAM_WRITABLE
|
G_PARAM_CONSTRUCT_ONLY
|
G_PARAM_STATIC_STRINGS
);
g_object_class_install_properties
(
object_class
,
_PROPERTY_ENUMS_LAST
,
obj_properties
);
...
...
src/supplicant/nm-supplicant-interface.h
View file @
a72ffe23
...
...
@@ -60,6 +60,7 @@ typedef enum {
#define NM_SUPPLICANT_INTERFACE_DRIVER "driver"
#define NM_SUPPLICANT_INTERFACE_FAST_SUPPORT "fast-support"
#define NM_SUPPLICANT_INTERFACE_AP_SUPPORT "ap-support"
#define NM_SUPPLICANT_INTERFACE_PMF_SUPPORT "pmf-support"
/* Signals */
#define NM_SUPPLICANT_INTERFACE_STATE "state"
...
...
@@ -76,7 +77,8 @@ GType nm_supplicant_interface_get_type (void);
NMSupplicantInterface
*
nm_supplicant_interface_new
(
const
char
*
ifname
,
NMSupplicantDriver
driver
,
NMSupplicantFeature
fast_support
,
NMSupplicantFeature
ap_support
);
NMSupplicantFeature
ap_support
,
NMSupplicantFeature
pmf_support
);
void
nm_supplicant_interface_set_supplicant_available
(
NMSupplicantInterface
*
self
,
gboolean
available
);
...
...
@@ -126,4 +128,6 @@ void nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self,
void
nm_supplicant_interface_set_fast_support
(
NMSupplicantInterface
*
self
,
NMSupplicantFeature
fast_support
);
void
nm_supplicant_interface_set_pmf_support
(
NMSupplicantInterface
*
self
,
NMSupplicantFeature
pmf_support
);
#endif
/* __NM_SUPPLICANT_INTERFACE_H__ */
src/supplicant/nm-supplicant-manager.c
View file @
a72ffe23
...
...
@@ -39,6 +39,7 @@ typedef struct {
GSList
*
ifaces
;
NMSupplicantFeature
fast_support
;
NMSupplicantFeature
ap_support
;
NMSupplicantFeature
pmf_support
;
guint
die_count_reset_id
;
guint
die_count
;
}
NMSupplicantManagerPrivate
;
...
...
@@ -159,7 +160,8 @@ nm_supplicant_manager_create_interface (NMSupplicantManager *self,
iface
=
nm_supplicant_interface_new
(
ifname
,
driver
,
priv
->
fast_support
,
priv
->
ap_support
);
priv
->
ap_support
,
priv
->
pmf_support
);
priv
->
ifaces
=
g_slist_prepend
(
priv
->
ifaces
,
iface
);
g_object_add_toggle_ref
((
GObject
*
)
iface
,
_sup_iface_last_ref
,
self
);
...
...
@@ -193,28 +195,37 @@ update_capabilities (NMSupplicantManager *self)
* dbus: Add global capabilities property
*/
priv
->
ap_support
=
NM_SUPPLICANT_FEATURE_UNKNOWN
;
priv
->
pmf_support
=
NM_SUPPLICANT_FEATURE_UNKNOWN
;
value
=
g_dbus_proxy_get_cached_property
(
priv
->
proxy
,
"Capabilities"
);
if
(
value
)
{
if
(
g_variant_is_of_type
(
value
,
G_VARIANT_TYPE_STRING_ARRAY
))
{
array
=
g_variant_get_strv
(
value
,
NULL
);
priv
->
ap_support
=
NM_SUPPLICANT_FEATURE_NO
;
priv
->
pmf_support
=
NM_SUPPLICANT_FEATURE_NO
;
if
(
array
)
{
if
(
g_strv_contains
(
array
,
"ap"
))
priv
->
ap_support
=
NM_SUPPLICANT_FEATURE_YES
;
if
(
g_strv_contains
(
array
,
"pmf"
))
priv
->
pmf_support
=
NM_SUPPLICANT_FEATURE_YES
;
g_free
(
array
);
}
}
g_variant_unref
(
value
);
}
/* Tell all interfaces about results of the AP check */
for
(
ifaces
=
priv
->
ifaces
;
ifaces
;
ifaces
=
ifaces
->
next
)
/* Tell all interfaces about results of the AP
/PMF
check */
for
(
ifaces
=
priv
->
ifaces
;
ifaces
;
ifaces
=
ifaces
->
next
)
{
nm_supplicant_interface_set_ap_support
(
ifaces
->
data
,
priv
->
ap_support
);
nm_supplicant_interface_set_pmf_support
(
ifaces
->
data
,
priv
->
pmf_support
);
}
_LOGD
(
"AP mode is %ssupported"
,
(
priv
->
ap_support
==
NM_SUPPLICANT_FEATURE_YES
)
?
""
:
(
priv
->
ap_support
==
NM_SUPPLICANT_FEATURE_NO
)
?
"not "
:
"possibly "
);
_LOGD
(
"PMF is %ssupported"
,
(
priv
->
pmf_support
==
NM_SUPPLICANT_FEATURE_YES
)
?
""
:
(
priv
->
pmf_support
==
NM_SUPPLICANT_FEATURE_NO
)
?
"not "
:
"possibly "
);
/* EAP-FAST */
priv
->
fast_support
=
NM_SUPPLICANT_FEATURE_NO
;
...
...
@@ -337,6 +348,7 @@ name_owner_cb (GDBusProxy *proxy, GParamSpec *pspec, gpointer user_data)
priv
->
ap_support
=
NM_SUPPLICANT_FEATURE_UNKNOWN
;
priv
->
fast_support
=
NM_SUPPLICANT_FEATURE_UNKNOWN
;
priv
->
pmf_support
=
NM_SUPPLICANT_FEATURE_UNKNOWN
;
set_running
(
self
,
FALSE
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment