dbus: Omit FT key mgmt capabilities without CONFIG_IEEE80211R

If wpa_supplicant was build without CONFIG_IEEE80211R, the
exposed key-management capabilities should not include one of the
FT protocols. If someone would use a FT protocol in such situation,
it would fail anyway.

Signed-off-by: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
This commit is contained in:
Clemens Famulla-Conrad 2022-06-25 23:33:50 +02:00 committed by Jouni Malinen
parent d2caf6ef54
commit 3a7fe1e213

View file

@ -3135,12 +3135,16 @@ dbus_bool_t wpas_dbus_getter_capabilities(
if (capa.key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA | if (capa.key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA |
WPA_DRIVER_CAPA_KEY_MGMT_WPA2)) { WPA_DRIVER_CAPA_KEY_MGMT_WPA2)) {
if (!wpa_dbus_dict_string_array_add_element( if (!wpa_dbus_dict_string_array_add_element(
&iter_array, "wpa-eap") || &iter_array, "wpa-eap"))
((capa.key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT) &&
!wpa_dbus_dict_string_array_add_element(
&iter_array, "wpa-ft-eap")))
goto nomem; goto nomem;
#ifdef CONFIG_IEEE80211R
if ((capa.key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT) &&
!wpa_dbus_dict_string_array_add_element(
&iter_array, "wpa-ft-eap"))
goto nomem;
#endif /* CONFIG_IEEE80211R */
/* TODO: Ensure that driver actually supports sha256 encryption. */ /* TODO: Ensure that driver actually supports sha256 encryption. */
if (!wpa_dbus_dict_string_array_add_element( if (!wpa_dbus_dict_string_array_add_element(
&iter_array, "wpa-eap-sha256")) &iter_array, "wpa-eap-sha256"))
@ -3150,12 +3154,16 @@ dbus_bool_t wpas_dbus_getter_capabilities(
if (capa.key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK | if (capa.key_mgmt & (WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK |
WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK)) { WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK)) {
if (!wpa_dbus_dict_string_array_add_element( if (!wpa_dbus_dict_string_array_add_element(
&iter_array, "wpa-psk") || &iter_array, "wpa-psk"))
((capa.key_mgmt & goto nomem;
#ifdef CONFIG_IEEE80211R
if ((capa.key_mgmt &
WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK) && WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK) &&
!wpa_dbus_dict_string_array_add_element( !wpa_dbus_dict_string_array_add_element(
&iter_array, "wpa-ft-psk"))) &iter_array, "wpa-ft-psk"))
goto nomem; goto nomem;
#endif /* CONFIG_IEEE80211R */
/* TODO: Ensure that driver actually supports sha256 encryption. */ /* TODO: Ensure that driver actually supports sha256 encryption. */
if (!wpa_dbus_dict_string_array_add_element( if (!wpa_dbus_dict_string_array_add_element(