dbus: Add FILS to global capabilities

If any of the interfaces supports FILS (and similarly for FILS-SK-PFS),
include the "fils" (and "fils_sk_pfs") capability in D-Bus information.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
This commit is contained in:
Masashi Honma 2018-02-04 10:50:37 +09:00 committed by Jouni Malinen
parent 208263c014
commit e480212765
4 changed files with 44 additions and 23 deletions

View File

@ -66,28 +66,6 @@ static int * freq_range_to_channel_list(struct wpa_supplicant *wpa_s,
char *val);
#ifdef CONFIG_FILS
static int wpa_is_fils_supported(struct wpa_supplicant *wpa_s)
{
return (((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_FILS)) ||
(!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD)));
}
#ifdef CONFIG_FILS_SK_PFS
static int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s)
{
return (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_FILS);
}
#endif /* CONFIG_FILS_SK_PFS */
#endif /* CONFIG_FILS */
static int set_bssid_filter(struct wpa_supplicant *wpa_s, char *val)
{
char *pos;

View File

@ -980,8 +980,21 @@ dbus_bool_t wpas_dbus_getter_global_capabilities(
const struct wpa_dbus_property_desc *property_desc,
DBusMessageIter *iter, DBusError *error, void *user_data)
{
const char *capabilities[6] = { NULL, NULL, NULL, NULL, NULL, NULL };
const char *capabilities[8] = { NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL };
size_t num_items = 0;
#ifdef CONFIG_FILS
struct wpa_global *global = user_data;
struct wpa_supplicant *wpa_s;
int fils_supported = 0, fils_sk_pfs_supported = 0;
for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
if (wpa_is_fils_supported(wpa_s))
fils_supported = 1;
if (wpa_is_fils_sk_pfs_supported(wpa_s))
fils_sk_pfs_supported = 1;
}
#endif /* CONFIG_FILS */
#ifdef CONFIG_AP
capabilities[num_items++] = "ap";
@ -1001,6 +1014,12 @@ dbus_bool_t wpas_dbus_getter_global_capabilities(
#ifdef CONFIG_MESH
capabilities[num_items++] = "mesh";
#endif /* CONFIG_MESH */
#ifdef CONFIG_FILS
if (fils_supported)
capabilities[num_items++] = "fils";
if (fils_sk_pfs_supported)
capabilities[num_items++] = "fils_sk_pfs";
#endif /* CONFIG_FILS */
return wpas_dbus_simple_array_property_getter(iter,
DBUS_TYPE_STRING,

View File

@ -2344,6 +2344,27 @@ static size_t wpas_add_fils_hlp_req(struct wpa_supplicant *wpa_s, u8 *ie_buf,
return ie_len;
}
int wpa_is_fils_supported(struct wpa_supplicant *wpa_s)
{
return (((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_FILS)) ||
(!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD)));
}
int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s)
{
#ifdef CONFIG_FILS_SK_PFS
return (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_FILS);
#else /* CONFIG_FILS_SK_PFS */
return 0;
#endif /* CONFIG_FILS_SK_PFS */
}
#endif /* CONFIG_FILS */

View File

@ -1475,4 +1475,7 @@ int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s,
unsigned int *num,
unsigned int *freq_list);
int wpa_is_fils_supported(struct wpa_supplicant *wpa_s);
int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s);
#endif /* WPA_SUPPLICANT_I_H */