esp_wifi: Install keys after eapol and NVS store security values

1. Bugfix store authmode security in NVS
2. Install keys after successful transmission of EAPOL 4/4 Message
This commit is contained in:
Shreyas Sheth
2023-04-06 18:43:06 +05:30
parent dae9bac87f
commit 5e60fb4fd4
3 changed files with 8 additions and 1 deletions

View File

@ -280,5 +280,6 @@ esp_err_t esp_wifi_remain_on_channel(uint8_t ifx, uint8_t type, uint8_t channel,
uint8_t esp_wifi_sta_get_config_sae_pwe_h2e_internal(void); uint8_t esp_wifi_sta_get_config_sae_pwe_h2e_internal(void);
uint8_t esp_wifi_sta_get_use_h2e_internal(void); uint8_t esp_wifi_sta_get_use_h2e_internal(void);
void esp_wifi_sta_disable_wpa2_authmode_internal(void); void esp_wifi_sta_disable_wpa2_authmode_internal(void);
bool esp_wifi_eb_tx_status_success_internal(void *eb);
#endif /* _ESP_WIFI_DRIVER_H_ */ #endif /* _ESP_WIFI_DRIVER_H_ */

View File

@ -2581,6 +2581,12 @@ void eapol_txcb(void *eb)
case WPA_FIRST_HALF_4WAY_HANDSHAKE: case WPA_FIRST_HALF_4WAY_HANDSHAKE:
break; break;
case WPA_LAST_HALF_4WAY_HANDSHAKE: case WPA_LAST_HALF_4WAY_HANDSHAKE:
if (esp_wifi_eb_tx_status_success_internal(eb) != true) {
wpa_printf(MSG_ERROR, "Eapol message 4/4 tx failure, not installing keys");
return;
}
if (sm->txcb_flags & WPA_4_4_HANDSHAKE_BIT) { if (sm->txcb_flags & WPA_4_4_HANDSHAKE_BIT) {
sm->txcb_flags &= ~WPA_4_4_HANDSHAKE_BIT; sm->txcb_flags &= ~WPA_4_4_HANDSHAKE_BIT;
isdeauth = wpa_supplicant_send_4_of_4_txcallback(sm); isdeauth = wpa_supplicant_send_4_of_4_txcallback(sm);