}
+static bool wpa_group_first_sta_seen_mbssid(struct wpa_authenticator *wpa_auth,
+ struct wpa_group *group)
+{
+ if (!wpa_auth->cb->first_sta_seen_mbssid)
+ return false;
+
+ return wpa_auth->cb->first_sta_seen_mbssid(wpa_auth->cb_ctx,
+ group->vlan_id);
+}
+
+
static void wpa_group_ensure_init(struct wpa_authenticator *wpa_auth,
struct wpa_group *group)
{
- if (group->first_sta_seen)
+ bool first_sta_seen_mbssid =
+ wpa_group_first_sta_seen_mbssid(wpa_auth, group);
+
+ /* Skip group keys renewal for below cases:
+ * This is not the first station association on this authenticator.
+ * In MBSSID case, this is not the first station association in the
+ * MBSSID set.
+ */
+ if (group->first_sta_seen || first_sta_seen_mbssid)
return;
+
+ if (!first_sta_seen_mbssid && wpa_auth->conf.tx_bss_auth) {
+ struct wpa_group *tx_group =
+ wpa_auth->conf.tx_bss_auth->group;
+ tx_group->bigtk_set = false;
+ tx_group->bigtk_configured = false;
+ }
+
/*
* System has run bit further than at the time hostapd was started
* potentially very early during boot up. This provides better chances
sm->sae_pw_id_counter = counter;
}
}
+
+
+bool wpa_auth_get_first_sta_seen(struct wpa_authenticator *wpa_auth,
+ int vlan_id)
+{
+ struct wpa_group *group;
+
+ if (!wpa_auth)
+ return false;
+
+ group = wpa_select_vlan_wpa_group(wpa_auth->group, vlan_id);
+ return group->first_sta_seen;
+}
#endif /* CONFIG_IEEE80211BE */
int (*get_drv_flags)(void *ctx, u64 *drv_flags, u64 *drv_flags2);
int (*remove_pmkid)(void *ctx, const u8 *sta_addr, const u8 *pmkid);
+ bool (*first_sta_seen_mbssid)(void *ctx, int vlan_id);
};
struct wpa_authenticator * wpa_init(const u8 *addr,
const u8 * wpa_auth_get_pmk(struct wpa_state_machine *sm, int *len);
const u8 * wpa_auth_get_dpp_pkhash(struct wpa_state_machine *sm);
int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm);
+bool wpa_auth_get_first_sta_seen(struct wpa_authenticator *wpa_auth,
+ int vlan_id);
int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm);
int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm);
int wpa_auth_sta_fils_tk_already_set(struct wpa_state_machine *sm);
#endif /* CONFIG_PASN */
+static bool hostapd_first_sta_seen_mbssid(void *ctx, int vlan_id)
+{
+ struct hostapd_data *hapd = ctx;
+
+ if (hapd->iconf->mbssid) {
+ size_t i;
+
+ for (i = 0; i < hapd->iface->num_bss; i++) {
+ struct hostapd_data *tmp_hapd = hapd->iface->bss[i];
+
+ if (wpa_auth_get_first_sta_seen(tmp_hapd->wpa_auth,
+ vlan_id))
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
#ifdef CONFIG_IEEE80211BE
static int hostapd_wpa_auth_get_ml_key_info(void *ctx,
#endif /* CONFIG_IEEE80211BE */
.get_drv_flags = hostapd_wpa_auth_get_drv_flags,
.remove_pmkid = hostapd_wpa_auth_remove_pmkid,
+ .first_sta_seen_mbssid = hostapd_first_sta_seen_mbssid,
};
const u8 *wpa_ie;
size_t wpa_ie_len;