developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From b43473e506400cc142f3d464c621714014ca196c Mon Sep 17 00:00:00 2001 |
| 2 | From: Allen Ye <allen.ye@mediatek.com> |
| 3 | Date: Thu, 6 Jun 2024 17:41:56 +0800 |
| 4 | Subject: [PATCH 102/126] mtk: hostapd: Fix multiple link connect get pmkid |
| 5 | failed |
| 6 | |
| 7 | Store pmkid in each link when receive STA auth. |
| 8 | |
| 9 | Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 10 | Signed-off-by: Allen Ye <allen.ye@mediatek.com> |
| 11 | --- |
| 12 | src/ap/ieee802_11.c | 15 ++++++++++++--- |
| 13 | 1 file changed, 12 insertions(+), 3 deletions(-) |
| 14 | |
| 15 | diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c |
| 16 | index fd954b6f5..ff0f24aaa 100644 |
| 17 | --- a/src/ap/ieee802_11.c |
| 18 | +++ b/src/ap/ieee802_11.c |
| 19 | @@ -945,6 +945,7 @@ static void sae_sme_send_external_auth_status(struct hostapd_data *hapd, |
| 20 | |
| 21 | void sae_accept_sta(struct hostapd_data *hapd, struct sta_info *sta) |
| 22 | { |
| 23 | + struct hostapd_data *link; |
| 24 | #ifndef CONFIG_NO_VLAN |
| 25 | struct vlan_description vlan_desc; |
| 26 | |
| 27 | @@ -986,9 +987,17 @@ void sae_accept_sta(struct hostapd_data *hapd, struct sta_info *sta) |
| 28 | crypto_bignum_deinit(sta->sae->peer_commit_scalar_accepted, 0); |
| 29 | sta->sae->peer_commit_scalar_accepted = sta->sae->peer_commit_scalar; |
| 30 | sta->sae->peer_commit_scalar = NULL; |
| 31 | - wpa_auth_pmksa_add_sae(hapd->wpa_auth, sta->addr, |
| 32 | - sta->sae->pmk, sta->sae->pmk_len, |
| 33 | - sta->sae->pmkid, sta->sae->akmp); |
| 34 | + if (hostapd_is_mld_ap(hapd)) { |
| 35 | + for_each_mld_link(link, hapd) { |
| 36 | + wpa_auth_pmksa_add_sae(link->wpa_auth, sta->addr, |
| 37 | + sta->sae->pmk, sta->sae->pmk_len, |
| 38 | + sta->sae->pmkid, sta->sae->akmp); |
| 39 | + } |
| 40 | + } else { |
| 41 | + wpa_auth_pmksa_add_sae(hapd->wpa_auth, sta->addr, |
| 42 | + sta->sae->pmk, sta->sae->pmk_len, |
| 43 | + sta->sae->pmkid, sta->sae->akmp); |
| 44 | + } |
| 45 | sae_sme_send_external_auth_status(hapd, sta, WLAN_STATUS_SUCCESS); |
| 46 | } |
| 47 | |
| 48 | -- |
| 49 | 2.18.0 |
| 50 | |