HS 2.0: Add Roaming Consortium Selection element into AssocReq

This makes wpa_supplicant add Hotspot 2.0 Roaming Consortium Selection
element into (Re)Association Request frames if the network profile
includes roaming_consortium_selection parameter.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2018-04-17 17:22:56 +03:00 committed by Jouni Malinen
parent ad5704631a
commit 4204669c69
4 changed files with 22 additions and 2 deletions

View File

@ -118,6 +118,22 @@ void wpas_hs20_add_indication(struct wpabuf *buf, int pps_mo_id)
}
void wpas_hs20_add_roam_cons_sel(struct wpabuf *buf,
const struct wpa_ssid *ssid)
{
if (!ssid->roaming_consortium_selection ||
!ssid->roaming_consortium_selection_len)
return;
wpabuf_put_u8(buf, WLAN_EID_VENDOR_SPECIFIC);
wpabuf_put_u8(buf, 4 + ssid->roaming_consortium_selection_len);
wpabuf_put_be24(buf, OUI_WFA);
wpabuf_put_u8(buf, HS20_ROAMING_CONS_SEL_OUI_TYPE);
wpabuf_put_data(buf, ssid->roaming_consortium_selection,
ssid->roaming_consortium_selection_len);
}
int is_hs20_network(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
struct wpa_bss *bss)
{

View File

@ -10,6 +10,8 @@
void hs20_configure_frame_filters(struct wpa_supplicant *wpa_s);
void wpas_hs20_add_indication(struct wpabuf *buf, int pps_mo_id);
void wpas_hs20_add_roam_cons_sel(struct wpabuf *buf,
const struct wpa_ssid *ssid);
int hs20_anqp_send_req(struct wpa_supplicant *wpa_s, const u8 *dst, u32 stypes,
const u8 *payload, size_t payload_len, int inmem);

View File

@ -500,12 +500,13 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
if (is_hs20_network(wpa_s, ssid, bss)) {
struct wpabuf *hs20;
hs20 = wpabuf_alloc(20);
hs20 = wpabuf_alloc(20 + MAX_ROAMING_CONS_OI_LEN);
if (hs20) {
int pps_mo_id = hs20_get_pps_mo_id(wpa_s, ssid);
size_t len;
wpas_hs20_add_indication(hs20, pps_mo_id);
wpas_hs20_add_roam_cons_sel(hs20, ssid);
len = sizeof(wpa_s->sme.assoc_req_ie) -
wpa_s->sme.assoc_req_ie_len;
if (wpabuf_len(hs20) <= len) {

View File

@ -2617,12 +2617,13 @@ static u8 * wpas_populate_assoc_ies(
if (is_hs20_network(wpa_s, ssid, bss)) {
struct wpabuf *hs20;
hs20 = wpabuf_alloc(20);
hs20 = wpabuf_alloc(20 + MAX_ROAMING_CONS_OI_LEN);
if (hs20) {
int pps_mo_id = hs20_get_pps_mo_id(wpa_s, ssid);
size_t len;
wpas_hs20_add_indication(hs20, pps_mo_id);
wpas_hs20_add_roam_cons_sel(hs20, ssid);
len = max_wpa_ie_len - wpa_ie_len;
if (wpabuf_len(hs20) <= len) {
os_memcpy(wpa_ie + wpa_ie_len,