]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Also remove from ml_pmksa when removing a PMKSA entry
authorChenming Huang <quic_chenhuan@quicinc.com>
Wed, 26 Feb 2025 14:32:22 +0000 (20:02 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 27 Feb 2025 10:11:44 +0000 (12:11 +0200)
When removing a PMKSA entry or flushing PMKSA entries, do the same for
both wpa_auth->pmksa and wpa_auth->ml_pmksa.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
src/ap/wpa_auth.c

index f8f704d3e1fd2019e087c51d670a6eaf6cab6f68..4a8218ab68532b20a8749537720f6298381c9a81 100644 (file)
@@ -6599,12 +6599,27 @@ void wpa_auth_pmksa_remove(struct wpa_authenticator *wpa_auth,
 
        if (!wpa_auth || !wpa_auth->pmksa)
                return;
+
        pmksa = pmksa_cache_auth_get(wpa_auth->pmksa, sta_addr, NULL);
        if (pmksa) {
                wpa_printf(MSG_DEBUG, "WPA: Remove PMKSA cache entry for "
                           MACSTR " based on request", MAC2STR(sta_addr));
                pmksa_cache_free_entry(wpa_auth->pmksa, pmksa);
        }
+
+#ifdef CONFIG_IEEE80211BE
+       if (wpa_auth->ml_pmksa) {
+               pmksa = pmksa_cache_auth_get(wpa_auth->ml_pmksa,
+                                            sta_addr, NULL);
+               if (pmksa) {
+                       wpa_printf(MSG_DEBUG,
+                                  "WPA: Remove PMKSA cache entry for " MACSTR
+                                  " based on request (MLD)",
+                                  MAC2STR(sta_addr));
+                       pmksa_cache_free_entry(wpa_auth->ml_pmksa, pmksa);
+               }
+       }
+#endif /* CONFIG_IEEE80211BE */
 }
 
 
@@ -6619,8 +6634,13 @@ int wpa_auth_pmksa_list(struct wpa_authenticator *wpa_auth, char *buf,
 
 void wpa_auth_pmksa_flush(struct wpa_authenticator *wpa_auth)
 {
-       if (wpa_auth && wpa_auth->pmksa)
+       if (wpa_auth && wpa_auth->pmksa) {
                pmksa_cache_auth_flush(wpa_auth->pmksa);
+#ifdef CONFIG_IEEE80211BE
+               if (wpa_auth->ml_pmksa && wpa_auth->primary_auth)
+                       pmksa_cache_auth_flush(wpa_auth->ml_pmksa);
+#endif /* CONFIG_IEEE80211BE */
+       }
 }