mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 10:57:47 +00:00
hostapd: fix wifi-7 e-mpsk
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -96,14 +96,14 @@ function cache_gc() {
|
|||||||
|
|
||||||
for (let addr in keys(ssid_cache)) {
|
for (let addr in keys(ssid_cache)) {
|
||||||
let sta = ssid_cache[addr];
|
let sta = ssid_cache[addr];
|
||||||
let keep = ts < cache.timeout;
|
let keep = ts < sta.timeout;
|
||||||
|
|
||||||
if (keep && !ssid.keys[sta.key])
|
if (keep && !ssid.keys[sta.key])
|
||||||
keep = false;
|
keep = false;
|
||||||
if (keep)
|
if (keep)
|
||||||
sta.keydata = ssid.keys[sta.key];
|
sta.keydata = ssid.keys[sta.key];
|
||||||
if (!keep)
|
if (!keep)
|
||||||
delete cache[addr];
|
delete sta[addr];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -754,7 +754,7 @@ as adding/removing interfaces.
|
|||||||
if (vlan_id)
|
if (vlan_id)
|
||||||
*vlan_id = 0;
|
*vlan_id = 0;
|
||||||
if (psk_len)
|
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.
|
* returned psk which should not be returned again.
|
||||||
* logic list (all hostapd_get_psk; all sta->psk)
|
* logic list (all hostapd_get_psk; all sta->psk)
|
||||||
*/
|
*/
|
||||||
@@ -768,16 +768,23 @@ as adding/removing interfaces.
|
|||||||
*vlan_id = 0;
|
*vlan_id = 0;
|
||||||
psk = sta->psk->psk;
|
psk = sta->psk->psk;
|
||||||
- for (pos = sta->psk; pos; pos = pos->next) {
|
- 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++) {
|
+ for (pos = sta->psk; pos; pos = pos->next, psk_idx++) {
|
||||||
if (pos->is_passphrase) {
|
if (pos->is_passphrase) {
|
||||||
if (pbkdf2_sha1(pos->passphrase,
|
if (pbkdf2_sha1(pos->passphrase,
|
||||||
hapd->conf->ssid.ssid,
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+ if (psk)
|
+ if (vlan_id && !psk)
|
||||||
+ sta->psk_idx = psk_idx;
|
+ sta->psk_idx = 0;
|
||||||
}
|
}
|
||||||
return psk;
|
return psk;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user