]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Reuse existing PTKSA cache keys instead of redoing PASN
authorPeddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
Fri, 13 Jun 2025 17:40:52 +0000 (23:10 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 19 Jun 2025 15:17:04 +0000 (18:17 +0300)
When a successful PASN exchange has already occurred with a peer,
the derived keys are stored in the PTKSA cache. If another PASN
request is received for the same peer, these cached keys should
be reused. However, the cache was previously bypassed due to the
incorrect pairwise cipher argument.

Ensure the correct parameters are set in advance, from the RSNE data
allowing the cache to be used when appropriate.

Signed-off-by: Peddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
wpa_supplicant/pasn_supplicant.c

index b290e3013e35e9f8a4a36a83bc0862929b56c243..6399c58bc7348d2a7e3b931839df2854362f87fb 100644 (file)
@@ -360,6 +360,12 @@ static void wpas_pasn_configure_next_peer(struct wpa_supplicant *wpa_s,
                        continue;
                }
 
+               if (wpas_pasn_get_params_from_bss(wpa_s, peer)) {
+                       peer->status = PASN_STATUS_FAILURE;
+                       wpa_s->pasn_count++;
+                       continue;
+               }
+
                if (wpas_pasn_set_keys_from_cache(wpa_s, peer->own_addr,
                                                  peer->peer_addr,
                                                  peer->cipher,
@@ -369,12 +375,6 @@ static void wpas_pasn_configure_next_peer(struct wpa_supplicant *wpa_s,
                        continue;
                }
 
-               if (wpas_pasn_get_params_from_bss(wpa_s, peer)) {
-                       peer->status = PASN_STATUS_FAILURE;
-                       wpa_s->pasn_count++;
-                       continue;
-               }
-
                if (wpas_pasn_auth_start(wpa_s, peer->own_addr,
                                         peer->peer_addr, peer->akmp,
                                         peer->cipher, peer->group,