mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 02:20:57 +02:00
Merge branch 'bugfix/wpa2_suiteb_192bit_and_eap_changes_v5.4' into 'release/v5.4'
Send disonnect event in connect fail for 192bit enterprise and add some fixes for wpa_supplicant(v5.4) See merge request espressif/esp-idf!41587
This commit is contained in:
@@ -1498,7 +1498,7 @@ esp_err_t esp_wifi_force_wakeup_release(void);
|
|||||||
/**
|
/**
|
||||||
* @brief configure country
|
* @brief configure country
|
||||||
*
|
*
|
||||||
* @attention 1. When ieee80211d_enabled, the country info of the AP to which
|
* @attention 1. When ieee80211d_enabled is enabled, the country info of the AP to which
|
||||||
* the station is connected is used. E.g. if the configured country is US
|
* the station is connected is used. E.g. if the configured country is US
|
||||||
* and the country info of the AP to which the station is connected is JP
|
* and the country info of the AP to which the station is connected is JP
|
||||||
* then the country info that will be used is JP. If the station disconnected
|
* then the country info that will be used is JP. If the station disconnected
|
||||||
|
Submodule components/esp_wifi/lib updated: 18cd59496b...154481d9d4
@@ -60,6 +60,7 @@ static struct eap_sm *gEapSm = NULL;
|
|||||||
|
|
||||||
static int eap_peer_sm_init(void);
|
static int eap_peer_sm_init(void);
|
||||||
static void eap_peer_sm_deinit(void);
|
static void eap_peer_sm_deinit(void);
|
||||||
|
static void eap_start_eapol(void *ctx, void *data);
|
||||||
|
|
||||||
static int eap_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len, uint8_t *bssid);
|
static int eap_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len, uint8_t *bssid);
|
||||||
static int wpa2_start_eapol_internal(void);
|
static int wpa2_start_eapol_internal(void);
|
||||||
@@ -529,6 +530,10 @@ static int eap_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len, uint8_t *bss
|
|||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!sm->eap_process_started) {
|
||||||
|
sm->eap_process_started = true;
|
||||||
|
eloop_cancel_timeout(eap_start_eapol, NULL, NULL);
|
||||||
|
}
|
||||||
if (len < sizeof(*hdr) + sizeof(*ehdr)) {
|
if (len < sizeof(*hdr) + sizeof(*ehdr)) {
|
||||||
wpa_printf(MSG_DEBUG, "WPA: EAPOL frame too short to be a WPA "
|
wpa_printf(MSG_DEBUG, "WPA: EAPOL frame too short to be a WPA "
|
||||||
"EAPOL-Key (len %lu, expecting at least %lu)",
|
"EAPOL-Key (len %lu, expecting at least %lu)",
|
||||||
@@ -612,15 +617,28 @@ _out:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wpa2_start_eapol(void)
|
static void eap_start_eapol(void *ctx, void *data)
|
||||||
{
|
{
|
||||||
#ifdef USE_WPA2_TASK
|
#ifdef USE_WPA2_TASK
|
||||||
return wpa2_post(SIG_WPA2_START, 0);
|
wpa2_post(SIG_WPA2_START, 0);
|
||||||
#else
|
#else
|
||||||
return wpa2_start_eapol_internal();
|
wpa2_start_eapol_internal();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int eap_start_eapol_timer(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Do not send EAPOL-Start immediately since in most cases,
|
||||||
|
* Authenticator is going to start authentication immediately
|
||||||
|
* after association and an extra EAPOL-Start is just going to
|
||||||
|
* delay authentication. Use a short timeout to send the first
|
||||||
|
* EAPOL-Start if Authenticator does not start authentication.
|
||||||
|
*/
|
||||||
|
eloop_register_timeout(2, 0, eap_start_eapol, NULL, NULL);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int wpa2_start_eapol_internal(void)
|
static int wpa2_start_eapol_internal(void)
|
||||||
{
|
{
|
||||||
struct eap_sm *sm = gEapSm;
|
struct eap_sm *sm = gEapSm;
|
||||||
@@ -739,6 +757,7 @@ static int eap_peer_sm_init(void)
|
|||||||
wpa_printf(MSG_INFO, "wifi_task prio:%d, stack:%d", WPA2_TASK_PRIORITY, WPA2_TASK_STACK_SIZE);
|
wpa_printf(MSG_INFO, "wifi_task prio:%d, stack:%d", WPA2_TASK_PRIORITY, WPA2_TASK_STACK_SIZE);
|
||||||
#endif
|
#endif
|
||||||
sm->workaround = 1;
|
sm->workaround = 1;
|
||||||
|
sm->eap_process_started = false;
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
|
|
||||||
_err:
|
_err:
|
||||||
@@ -806,7 +825,7 @@ static esp_err_t esp_client_enable_fn(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wpa2_cb->wpa2_sm_rx_eapol = wpa2_ent_rx_eapol;
|
wpa2_cb->wpa2_sm_rx_eapol = wpa2_ent_rx_eapol;
|
||||||
wpa2_cb->wpa2_start = wpa2_start_eapol;
|
wpa2_cb->wpa2_start = eap_start_eapol_timer;
|
||||||
wpa2_cb->wpa2_init = eap_peer_sm_init;
|
wpa2_cb->wpa2_init = eap_peer_sm_init;
|
||||||
wpa2_cb->wpa2_deinit = eap_peer_sm_deinit;
|
wpa2_cb->wpa2_deinit = eap_peer_sm_deinit;
|
||||||
|
|
||||||
|
@@ -311,6 +311,7 @@ struct eap_sm {
|
|||||||
size_t eapKeyDataLen;
|
size_t eapKeyDataLen;
|
||||||
struct wpabuf *lastRespData;
|
struct wpabuf *lastRespData;
|
||||||
const struct eap_method *m;
|
const struct eap_method *m;
|
||||||
|
bool eap_process_started;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@@ -2377,7 +2377,7 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher,
|
|||||||
}
|
}
|
||||||
#ifdef CONFIG_SUITEB192
|
#ifdef CONFIG_SUITEB192
|
||||||
extern bool g_wpa_suiteb_certification;
|
extern bool g_wpa_suiteb_certification;
|
||||||
if (g_wpa_suiteb_certification) {
|
if (is_wpa2_enterprise_connection() && g_wpa_suiteb_certification) {
|
||||||
if (sm->mgmt_group_cipher != WPA_CIPHER_BIP_GMAC_256) {
|
if (sm->mgmt_group_cipher != WPA_CIPHER_BIP_GMAC_256) {
|
||||||
wpa_printf(MSG_ERROR, "suite-b 192bit certification, only GMAC256 is supported");
|
wpa_printf(MSG_ERROR, "suite-b 192bit certification, only GMAC256 is supported");
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user