Skip to content

Commit

Permalink
hostapd: fix wifi-7 e-mpsk
Browse files Browse the repository at this point in the history
Signed-off-by: John Crispin <[email protected]>
  • Loading branch information
blogic committed Feb 3, 2025
1 parent 4050db8 commit 3e7fd62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions feeds/qca/hostapd/files/mpskd
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ function cache_gc() {

for (let addr in keys(ssid_cache)) {
let sta = ssid_cache[addr];
let keep = ts < cache.timeout;
let keep = ts < sta.timeout;

if (keep && !ssid.keys[sta.key])
keep = false;
if (keep)
sta.keydata = ssid.keys[sta.key];
if (!keep)
delete cache[addr];
delete sta[addr];
}
}
}
Expand Down
15 changes: 11 additions & 4 deletions feeds/qca/hostapd/patches/601-ucode_support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ as adding/removing interfaces.
if (vlan_id)
*vlan_id = 0;
if (psk_len)
@@ -387,13 +388,16 @@ static const u8 * hostapd_wpa_auth_get_p
@@ -387,13 +388,18 @@ static const u8 * hostapd_wpa_auth_get_p
* returned psk which should not be returned again.
* logic list (all hostapd_get_psk; all sta->psk)
*/
Expand All @@ -768,16 +768,23 @@ as adding/removing interfaces.
*vlan_id = 0;
psk = sta->psk->psk;
- for (pos = sta->psk; pos; pos = pos->next) {
+ if (vlan_id)
+ sta->psk_idx = psk_idx;
+ for (pos = sta->psk; pos; pos = pos->next, psk_idx++) {
if (pos->is_passphrase) {
if (pbkdf2_sha1(pos->passphrase,
hapd->conf->ssid.ssid,
@@ -410,6 +414,8 @@ static const u8 * hostapd_wpa_auth_get_p
@@ -407,9 +413,13 @@ static const u8 * hostapd_wpa_auth_get_p
}
if (pos->psk == prev_psk) {
psk = pos->next ? pos->next->psk : NULL;
+ if (vlan_id)
+ sta->psk_idx = psk_idx + 1;
break;
}
}
+ if (psk)
+ sta->psk_idx = psk_idx;
+ if (vlan_id && !psk)
+ sta->psk_idx = 0;
}
return psk;
}

0 comments on commit 3e7fd62

Please sign in to comment.