HS 2.0: Process received Terms and Conditions Acceptance notification

Extend wpa_supplicant WNM-Notification RX handling to parse and process
received Terms and Conditions Acceptance notifications. If PMF is
enabled for the association, this frame results in control interface
indication (HS20-T-C-ACCEPTANCE <URL>) to get upper layers to guide the
user through the required acceptance steps.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2018-04-24 00:17:47 +03:00 committed by Jouni Malinen
parent 8760b9848c
commit 7fc6a024f9
4 changed files with 40 additions and 0 deletions

View file

@ -274,6 +274,7 @@ extern "C" {
#define HS20_SUBSCRIPTION_REMEDIATION "HS20-SUBSCRIPTION-REMEDIATION "
#define HS20_DEAUTH_IMMINENT_NOTICE "HS20-DEAUTH-IMMINENT-NOTICE "
#define HS20_T_C_ACCEPTANCE "HS20-T-C-ACCEPTANCE "
#define EXT_RADIO_WORK_START "EXT-RADIO-WORK-START "
#define EXT_RADIO_WORK_TIMEOUT "EXT-RADIO-WORK-TIMEOUT "

View file

@ -1232,6 +1232,18 @@ void hs20_rx_deauth_imminent_notice(struct wpa_supplicant *wpa_s, u8 code,
}
void hs20_rx_t_c_acceptance(struct wpa_supplicant *wpa_s, const char *url)
{
if (!wpa_sm_pmf_enabled(wpa_s->wpa)) {
wpa_printf(MSG_DEBUG,
"HS 2.0: Ignore Terms and Conditions Acceptance since PMF was not enabled");
return;
}
wpa_msg(wpa_s, MSG_INFO, HS20_T_C_ACCEPTANCE "%s", url);
}
void hs20_init(struct wpa_supplicant *wpa_s)
{
dl_list_init(&wpa_s->icon_head);

View file

@ -29,6 +29,7 @@ void hs20_rx_subscription_remediation(struct wpa_supplicant *wpa_s,
const char *url, u8 osu_method);
void hs20_rx_deauth_imminent_notice(struct wpa_supplicant *wpa_s, u8 code,
u16 reauth_delay, const char *url);
void hs20_rx_t_c_acceptance(struct wpa_supplicant *wpa_s, const char *url);
void hs20_free_osu_prov(struct wpa_supplicant *wpa_s);
void hs20_next_osu_icon(struct wpa_supplicant *wpa_s);

View file

@ -1644,6 +1644,32 @@ static void ieee802_11_rx_wnm_notif_req_wfa(struct wpa_supplicant *wpa_s,
pos = next;
continue;
}
if (ie == WLAN_EID_VENDOR_SPECIFIC && ie_len >= 5 &&
WPA_GET_BE24(pos) == OUI_WFA &&
pos[3] == HS20_WNM_T_C_ACCEPTANCE) {
const u8 *ie_end;
u8 url_len;
char *url;
ie_end = pos + ie_len;
pos += 4;
url_len = *pos++;
wpa_printf(MSG_DEBUG,
"WNM: HS 2.0 Terms and Conditions Acceptance (URL Length %u)",
url_len);
if (url_len > ie_end - pos)
break;
url = os_malloc(url_len + 1);
if (!url)
break;
os_memcpy(url, pos, url_len);
url[url_len] = '\0';
hs20_rx_t_c_acceptance(wpa_s, url);
os_free(url);
pos = next;
continue;
}
#endif /* CONFIG_HS20 */
pos = next;