Skip to content

Commit 4ce1da7

Browse files
committed
Merge branch 'fix/bcast_mgmt_api' into 'master'
Add BIP support for AP mode. Closes WIFIBUG-1155 See merge request espressif/esp-idf!38249
2 parents 6aeba18 + 9abd30a commit 4ce1da7

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

components/wpa_supplicant/esp_supplicant/src/esp_hostap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "esp_wps.h"
2323
#include "esp_wps_i.h"
2424

25+
#include "rsn_supp/wpa.h"
2526
#include "ap/sta_info.h"
2627
#include "common/sae.h"
2728
#include "ap/ieee802_11.h"
@@ -172,7 +173,7 @@ void *hostap_init(void)
172173
}
173174

174175
#endif /* CONFIG_IEEE80211W */
175-
176+
esp_wifi_ap_set_group_mgmt_cipher_internal(cipher_type_map_supp_to_public(auth_conf->group_mgmt_cipher));
176177
spp_attrubute = esp_wifi_get_spp_attrubute_internal(WIFI_IF_AP);
177178
auth_conf->spp_sup.capable = ((spp_attrubute & WPA_CAPABILITY_SPP_CAPABLE) ? SPP_AMSDU_CAP_ENABLE : SPP_AMSDU_CAP_DISABLE);
178179
auth_conf->spp_sup.require = ((spp_attrubute & WPA_CAPABILITY_SPP_REQUIRED) ? SPP_AMSDU_REQ_ENABLE : SPP_AMSDU_REQ_DISABLE);
@@ -208,9 +209,6 @@ void *hostap_init(void)
208209
auth_conf->sae_require_mfp = 1;
209210
#endif /* CONFIG_SAE */
210211

211-
//TODO change it when AP support GCMP-PSK
212-
auth_conf->group_mgmt_cipher = WPA_CIPHER_AES_128_CMAC;
213-
214212
hapd->conf->ap_max_inactivity = 5 * 60;
215213
hostapd_setup_wpa_psk(hapd->conf);
216214

components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,5 +305,6 @@ void esp_wifi_enable_sae_pk_only_mode_internal(void);
305305
uint8_t esp_wifi_ap_get_transition_disable_internal(void);
306306
int esp_wifi_softap_set_obss_overlap(bool overlap);
307307
void esp_wifi_set_sigma_internal(bool flag);
308+
void esp_wifi_ap_set_group_mgmt_cipher_internal(wifi_cipher_type_t cipher);
308309

309310
#endif /* _ESP_WIFI_DRIVER_H_ */

components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/

components/wpa_supplicant/src/ap/wpa_auth.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ static inline int wpa_auth_set_key(struct wpa_authenticator *wpa_auth,
165165
if (key) {
166166
wpa_printf (MSG_DEBUG, "%s : igtk idx %d", __func__, idx);
167167
wifi_wpa_igtk_t *igtk = os_malloc(sizeof(wifi_wpa_igtk_t));
168-
169168
if (igtk != NULL) {
170-
memcpy(&igtk->igtk[0], key, WPA_IGTK_LEN);
169+
memcpy(&igtk->igtk[0], key, key_len);
171170
memset((uint8_t*)&igtk->pn[0],0,6);
172171
igtk->keyid[0] = idx;
173172
igtk->keyid[1] = 0;
@@ -2484,6 +2483,8 @@ static int wpa_group_config_group_keys(struct wpa_authenticator *wpa_auth,
24842483
struct wpa_group *group)
24852484
{
24862485
int ret = 0;
2486+
size_t len;
2487+
len = wpa_cipher_key_len(wpa_auth->conf.group_mgmt_cipher);
24872488
if (wpa_auth_set_key(wpa_auth, group->vlan_id,
24882489
wpa_cipher_to_alg(wpa_auth->conf.wpa_group),
24892490
(uint8_t *)broadcast_ether_addr, group->GN,
@@ -2495,7 +2496,7 @@ static int wpa_group_config_group_keys(struct wpa_authenticator *wpa_auth,
24952496
wpa_auth_set_key(wpa_auth, group->vlan_id, WIFI_WPA_ALG_IGTK,
24962497
broadcast_ether_addr, group->GN_igtk,
24972498
group->IGTK[group->GN_igtk - 4],
2498-
WPA_IGTK_LEN) < 0)
2499+
len) < 0)
24992500
ret = -1;
25002501

25012502
#endif /* CONFIG_IEEE80211W */

components/wpa_supplicant/src/rsn_supp/wpa.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ wifi_cipher_type_t cipher_type_map_supp_to_public(unsigned wpa_cipher)
110110
case WPA_CIPHER_AES_128_CMAC:
111111
return WIFI_CIPHER_TYPE_AES_CMAC128;
112112

113+
case WPA_CIPHER_BIP_GMAC_128:
114+
return WIFI_CIPHER_TYPE_AES_GMAC128;
115+
116+
case WPA_CIPHER_BIP_GMAC_256:
117+
return WIFI_CIPHER_TYPE_AES_GMAC256;
118+
113119
case WPA_CIPHER_SMS4:
114120
return WIFI_CIPHER_TYPE_SMS4;
115121

0 commit comments

Comments
 (0)