From 4ed34f5acd59a89382a22be45fc48f8366241f20 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 19 Aug 2012 12:34:14 +0300 Subject: [PATCH] HS 2.0: Do not indicate HS 2.0 status without WPA2-Enterprise Hotspot 2.0 allows only WPA2-Enterprise to be used, so other types of networks must not be indicated as Hotspot 2.0 networks even if they (incorrectly) advertise HS 2.0 support. Signed-hostap: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index f591f6892..4fd83b9e9 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -1124,7 +1124,9 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s, #ifdef CONFIG_HS20 if (wpa_s->current_bss && - wpa_bss_get_vendor_ie(wpa_s->current_bss, HS20_IE_VENDOR_TYPE)) { + wpa_bss_get_vendor_ie(wpa_s->current_bss, HS20_IE_VENDOR_TYPE) && + wpa_s->wpa_proto == WPA_PROTO_RSN && + wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt)) { ret = os_snprintf(pos, end - pos, "hs20=1\n"); if (ret < 0 || ret >= end - pos) return pos - buf; @@ -1623,7 +1625,7 @@ static int wpa_supplicant_ctrl_iface_scan_result( pos += ret; } #ifdef CONFIG_HS20 - if (wpa_bss_get_vendor_ie(bss, HS20_IE_VENDOR_TYPE)) { + if (wpa_bss_get_vendor_ie(bss, HS20_IE_VENDOR_TYPE) && ie2) { ret = os_snprintf(pos, end - pos, "[HS20]"); if (ret < 0 || ret >= end - pos) return -1;