diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 23681dcbf..a86358424 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -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; diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index f4ebabe47..a3c98fadd 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -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, diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index fcb267764..68184dfde 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -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 */ diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 6f05d4592..d5bfa7ddf 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -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 */