diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 0e42542d9..51d7fed24 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -1109,6 +1109,8 @@ static int sme_sae_auth(struct wpa_supplicant *wpa_s, u16 auth_transaction, wpa_s->sme.sae.state == SAE_COMMITTED && (external || wpa_s->current_bss) && wpa_s->current_ssid) { wpa_dbg(wpa_s, MSG_DEBUG, "SME: SAE group not supported"); + int_array_add_unique(&wpa_s->sme.sae_rejected_groups, + wpa_s->sme.sae.group); wpa_s->sme.sae_group_index++; if (sme_set_sae_group(wpa_s) < 0) return -1; /* no other groups enabled */ @@ -2028,6 +2030,10 @@ void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s) void sme_deinit(struct wpa_supplicant *wpa_s) { sme_clear_on_disassoc(wpa_s); +#ifdef CONFIG_SAE + os_free(wpa_s->sme.sae_rejected_groups); + wpa_s->sme.sae_rejected_groups = NULL; +#endif /* CONFIG_SAE */ eloop_cancel_timeout(sme_assoc_timer, wpa_s, NULL); eloop_cancel_timeout(sme_auth_timer, wpa_s, NULL); diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 39f69be63..09c36097f 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2010,6 +2010,10 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, } } else { #ifdef CONFIG_SAE +#ifdef CONFIG_SME + os_free(wpa_s->sme.sae_rejected_groups); + wpa_s->sme.sae_rejected_groups = NULL; +#endif /* CONFIG_SME */ wpa_s_setup_sae_pt(wpa_s->conf, ssid); #endif /* CONFIG_SAE */ } @@ -4017,6 +4021,10 @@ void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s, wpa_s->disconnected = 0; wpa_s->reassociate = 1; +#if defined(CONFIG_SAE) && defined(CONFIG_SME) + os_free(wpa_s->sme.sae_rejected_groups); + wpa_s->sme.sae_rejected_groups = NULL; +#endif /* CONFIG_SAE && CONFIG_SME */ wpa_s->last_owe_group = 0; if (ssid) { ssid->owe_transition_bss_select_count = 0; diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index af938064b..e76b0d0a0 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -810,6 +810,7 @@ struct wpa_supplicant { u8 ext_auth_bssid[ETH_ALEN]; u8 ext_auth_ssid[SSID_MAX_LEN]; size_t ext_auth_ssid_len; + int *sae_rejected_groups; #endif /* CONFIG_SAE */ } sme; #endif /* CONFIG_SME */