aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2008-12-31 15:53:31 (GMT)
committerJouni Malinen <j@w1.fi>2008-12-31 15:53:31 (GMT)
commit97d3497e29cef533b9ea64c1b55427b793c27318 (patch)
treeb0a8d7833f0486f239ae2f85f8305eaae4cdbc8d /wpa_supplicant
parentc3469d153456d1681a0b5aa201dcbfa2e1970e05 (diff)
downloadhostap-06-97d3497e29cef533b9ea64c1b55427b793c27318.zip
hostap-06-97d3497e29cef533b9ea64c1b55427b793c27318.tar.gz
hostap-06-97d3497e29cef533b9ea64c1b55427b793c27318.tar.bz2
MFP: Require MFP is it is enabled and AP scan shows support for it
When using ap_scan=1, we know before the association request that MFP will be supported, so we can as well require it. This helps mac80211 in configuring whether to enable MFP.
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wpa_supplicant.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index a5a7765..0fb70c3 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1122,6 +1122,18 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
params.mgmt_frame_protection = MGMT_FRAME_PROTECTION_REQUIRED;
break;
}
+ if (ssid->ieee80211w != NO_IEEE80211W && bss) {
+ const u8 *rsn = wpa_scan_get_ie(bss, WLAN_EID_RSN);
+ struct wpa_ie_data ie;
+ if (rsn && wpa_parse_wpa_ie(rsn, 2 + rsn[1], &ie) == 0 &&
+ ie.capabilities &
+ (WPA_CAPABILITY_MFPC | WPA_CAPABILITY_MFPR)) {
+ wpa_printf(MSG_DEBUG, "WPA: Selected AP supports MFP: "
+ "require MFP");
+ params.mgmt_frame_protection =
+ MGMT_FRAME_PROTECTION_REQUIRED;
+ }
+ }
#endif /* CONFIG_IEEE80211W */
if (wpa_s->use_client_mlme)