From cc0da0ff4ce8439b48a3435760b5fad49ac1d103 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 5 Sep 2019 11:54:47 +0300 Subject: [PATCH] SAE: Advertise BSS membership selector for H2E-only case If hostapd is configured to enable only the hash-to-element version of SAE PWE derivation (sae_pwe=1), advertise BSS membership selector to indicate this. Signed-off-by: Jouni Malinen --- src/ap/ieee802_11.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index b1d520874..7ea801daa 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -98,6 +98,8 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid) num++; if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht) num++; + if (hapd->conf->sae_pwe == 1) + num++; if (num > 8) { /* rest of the rates are encoded in Extended supported * rates element */ @@ -124,6 +126,11 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid) *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY; } + if (hapd->conf->sae_pwe == 1 && count < 8) { + count++; + *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY; + } + return pos; } @@ -141,6 +148,8 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid) num++; if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht) num++; + if (hapd->conf->sae_pwe == 1) + num++; if (num <= 8) return eid; num -= 8; @@ -170,6 +179,12 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid) *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY; } + if (hapd->conf->sae_pwe == 1) { + count++; + if (count > 8) + *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY; + } + return pos; }