aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ap.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-09-01 10:40:33 (GMT)
committerJouni Malinen <j@w1.fi>2013-09-01 18:35:10 (GMT)
commit01a57fe420f49588ecc1d59d5a5faf18cf551521 (patch)
treed2eb06d131cd6634d182ea35900be01d0cba2d01 /wpa_supplicant/ap.c
parent759fd76b7fa554f3ee09a5a63d8cba76934b27d1 (diff)
downloadhostap-01a57fe420f49588ecc1d59d5a5faf18cf551521.zip
hostap-01a57fe420f49588ecc1d59d5a5faf18cf551521.tar.gz
hostap-01a57fe420f49588ecc1d59d5a5faf18cf551521.tar.bz2
P2P: Maintain list of per-client PSKs for persistent groups
Record all generated per-client PSKs in the persistent group network block and configure these for the GO Authenticator whenever re-starting the persistent group. This completes per-client PSK support for persistent groups. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/ap.c')
-rw-r--r--wpa_supplicant/ap.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 99c6d8a..c2fb215 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -367,6 +367,19 @@ static void ap_sta_authorized_cb(void *ctx, const u8 *mac_addr,
}
+#ifdef CONFIG_P2P
+static void ap_new_psk_cb(void *ctx, const u8 *mac_addr, const u8 *p2p_dev_addr,
+ const u8 *psk, size_t psk_len)
+{
+
+ struct wpa_supplicant *wpa_s = ctx;
+ if (wpa_s->ap_iface == NULL || wpa_s->current_ssid == NULL)
+ return;
+ wpas_p2p_new_psk_cb(wpa_s, mac_addr, p2p_dev_addr, psk, psk_len);
+}
+#endif /* CONFIG_P2P */
+
+
static int ap_vendor_action_rx(void *ctx, const u8 *buf, size_t len, int freq)
{
#ifdef CONFIG_P2P
@@ -571,6 +584,8 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
hapd_iface->bss[i]->sta_authorized_cb = ap_sta_authorized_cb;
hapd_iface->bss[i]->sta_authorized_cb_ctx = wpa_s;
#ifdef CONFIG_P2P
+ hapd_iface->bss[i]->new_psk_cb = ap_new_psk_cb;
+ hapd_iface->bss[i]->new_psk_cb_ctx = wpa_s;
hapd_iface->bss[i]->p2p = wpa_s->global->p2p;
hapd_iface->bss[i]->p2p_group = wpas_p2p_group_init(wpa_s,
ssid);