aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-09-12 22:56:37 (GMT)
committerJouni Malinen <jouni@codeaurora.org>2018-09-15 02:17:49 (GMT)
commit3ecb8a520317c5fe9c3449a6554a6dfb15a29eab (patch)
tree3c8178d5a4013c453554c5f8e16448a2ae613160 /wpa_supplicant
parent1d73531fdbb5b231c18542f4a9e70abde4fb9b18 (diff)
downloadhostap-3ecb8a520317c5fe9c3449a6554a6dfb15a29eab.zip
hostap-3ecb8a520317c5fe9c3449a6554a6dfb15a29eab.tar.gz
hostap-3ecb8a520317c5fe9c3449a6554a6dfb15a29eab.tar.bz2
ANQP: Parse and report Venue URL information
Parse the Venue URL ANQP-element payload and report it with the new RX-VENUE-URL event messages if the query was done using PMF. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/interworking.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 7976eef..f3f88d3 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -2844,6 +2844,31 @@ static void anqp_add_extra(struct wpa_supplicant *wpa_s,
}
+static void interworking_parse_venue_url(struct wpa_supplicant *wpa_s,
+ const u8 *data, size_t len)
+{
+ const u8 *pos = data, *end = data + len;
+ char url[255];
+
+ while (end - pos >= 2) {
+ u8 slen, num;
+
+ slen = *pos++;
+ if (slen < 1 || slen > end - pos) {
+ wpa_printf(MSG_DEBUG,
+ "ANQP: Truncated Venue URL Duple field");
+ return;
+ }
+
+ num = *pos++;
+ os_memcpy(url, pos, slen - 1);
+ url[slen - 1] = '\0';
+ wpa_msg(wpa_s, MSG_INFO, RX_VENUE_URL "%u %s", num, url);
+ pos += slen - 1;
+ }
+}
+
+
static void interworking_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
struct wpa_bss *bss, const u8 *sa,
u16 info_id,
@@ -2950,6 +2975,18 @@ static void interworking_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
}
break;
#endif /* CONFIG_FILS */
+ case ANQP_VENUE_URL:
+ wpa_msg(wpa_s, MSG_INFO, RX_ANQP MACSTR " Venue URL",
+ MAC2STR(sa));
+ anqp_add_extra(wpa_s, anqp, info_id, pos, slen);
+
+ if (!wpa_sm_pmf_enabled(wpa_s->wpa)) {
+ wpa_printf(MSG_DEBUG,
+ "ANQP: Ignore Venue URL since PMF was not enabled");
+ break;
+ }
+ interworking_parse_venue_url(wpa_s, pos, slen);
+ break;
case ANQP_VENDOR_SPECIFIC:
if (slen < 3)
return;