From 9cad61867983fe1cac26ede43a987d620e8e3fa4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 17 Dec 2016 22:01:02 +0200 Subject: [PATCH] FILS: Add Realm Information ANQP-element in BSS data Add a named BSS command output entry for FILS Realm Information ANQP-element (anqp_fils_realm_info). Signed-off-by: Jouni Malinen --- wpa_supplicant/bss.c | 2 ++ wpa_supplicant/bss.h | 1 + wpa_supplicant/ctrl_iface.c | 2 ++ wpa_supplicant/interworking.c | 12 ++++++++++++ 4 files changed, 17 insertions(+) diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c index 44a9a7b2c..37ac84475 100644 --- a/wpa_supplicant/bss.c +++ b/wpa_supplicant/bss.c @@ -93,6 +93,7 @@ static struct wpa_bss_anqp * wpa_bss_anqp_clone(struct wpa_bss_anqp *anqp) ANQP_DUP(nai_realm); ANQP_DUP(anqp_3gpp); ANQP_DUP(domain_name); + ANQP_DUP(fils_realm_info); #endif /* CONFIG_INTERWORKING */ #ifdef CONFIG_HS20 ANQP_DUP(hs20_capability_list); @@ -168,6 +169,7 @@ static void wpa_bss_anqp_free(struct wpa_bss_anqp *anqp) wpabuf_free(anqp->nai_realm); wpabuf_free(anqp->anqp_3gpp); wpabuf_free(anqp->domain_name); + wpabuf_free(anqp->fils_realm_info); while ((elem = dl_list_first(&anqp->anqp_elems, struct wpa_bss_anqp_elem, list))) { diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h index 84e8fb074..97ab0707e 100644 --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h @@ -40,6 +40,7 @@ struct wpa_bss_anqp { struct wpabuf *nai_realm; struct wpabuf *anqp_3gpp; struct wpabuf *domain_name; + struct wpabuf *fils_realm_info; struct dl_list anqp_elems; /* list of struct wpa_bss_anqp_elem */ #endif /* CONFIG_INTERWORKING */ #ifdef CONFIG_HS20 diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 4439efbe2..cd10fa84c 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -4381,6 +4381,8 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, pos = anqp_add_hex(pos, end, "anqp_3gpp", anqp->anqp_3gpp); pos = anqp_add_hex(pos, end, "anqp_domain_name", anqp->domain_name); + pos = anqp_add_hex(pos, end, "anqp_fils_realm_info", + anqp->fils_realm_info); #ifdef CONFIG_HS20 pos = anqp_add_hex(pos, end, "hs20_capability_list", anqp->hs20_capability_list); diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index 5c0e109eb..30b9c88a7 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -2893,6 +2893,18 @@ static void interworking_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s, anqp->domain_name = wpabuf_alloc_copy(pos, slen); } break; +#ifdef CONFIG_FILS + case ANQP_FILS_REALM_INFO: + wpa_msg(wpa_s, MSG_INFO, RX_ANQP MACSTR + " FILS Realm Information", MAC2STR(sa)); + wpa_hexdump_ascii(MSG_MSGDUMP, "ANQP: FILS Realm Information", + pos, slen); + if (anqp) { + wpabuf_free(anqp->fils_realm_info); + anqp->fils_realm_info = wpabuf_alloc_copy(pos, slen); + } + break; +#endif /* CONFIG_FILS */ case ANQP_VENDOR_SPECIFIC: if (slen < 3) return;