]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Collect list of rejected groups for H2E in STA
authorJouni Malinen <jouni@codeaurora.org>
Fri, 6 Sep 2019 12:40:39 +0000 (15:40 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 15 Oct 2019 12:39:22 +0000 (15:39 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 0e42542d94433fa17372d8e5f8d733dab994a615..51d7fed24ed44bba7061e1d6a1dec43759efcd55 100644 (file)
@@ -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);
index 39f69be6352c702d94b3d2a54b8d3545014c1a21..09c36097f370dbecbbf1b2afb8e198fc93f8a3df 100644 (file)
@@ -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;
index af938064b30ad464b1fa327d965d851ca11d4278..e76b0d0a04765e4c88a94a54b9503b202d1fa76b 100644 (file)
@@ -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 */