aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/wpa_auth_glue.c
diff options
context:
space:
mode:
authorMichael Braun <michael-dev@fami-braun.de>2012-11-25 15:49:25 (GMT)
committerJouni Malinen <j@w1.fi>2012-11-25 15:57:16 (GMT)
commit5ee56c4e1930b007d36704f62e614e0dbb88f1f8 (patch)
treeed75849c98ed7c8fa4ff99bc9176ff4f43ada2ea /src/ap/wpa_auth_glue.c
parent2ad3e6c858526f5822a47741c57a7fe1423dc724 (diff)
downloadhostap-5ee56c4e1930b007d36704f62e614e0dbb88f1f8.zip
hostap-5ee56c4e1930b007d36704f62e614e0dbb88f1f8.tar.gz
hostap-5ee56c4e1930b007d36704f62e614e0dbb88f1f8.tar.bz2
Keep and use list of PSKs per station for RADIUS-based PSK
This adds support for multiple PSKs per station when using a RADIUS authentication server to fetch the PSKs during MAC address authentication step. This can be useful if multiple users share a device but each user has his or her own private passphrase. Signed-hostap: Michael Braun <michael-dev@fami-braun.de>
Diffstat (limited to 'src/ap/wpa_auth_glue.c')
-rw-r--r--src/ap/wpa_auth_glue.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
index 68fe596..76c61ea 100644
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -188,10 +188,18 @@ static const u8 * hostapd_wpa_auth_get_psk(void *ctx, const u8 *addr,
/*
* This is about to iterate over all psks, prev_psk gives the last
* returned psk which should not be returned again.
- * logic list (all hostapd_get_psk; sta->psk)
+ * logic list (all hostapd_get_psk; all sta->psk)
*/
- if (sta && sta->psk && !psk && sta->psk != prev_psk)
- psk = sta->psk;
+ if (sta && sta->psk && !psk) {
+ struct hostapd_sta_wpa_psk_short *pos;
+ psk = sta->psk->psk;
+ for (pos = sta->psk; pos; pos = pos->next) {
+ if (pos->psk == prev_psk) {
+ psk = pos->next ? pos->next->psk : NULL;
+ break;
+ }
+ }
+ }
return psk;
}