aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-06-18 11:45:35 (GMT)
committerJouni Malinen <j@w1.fi>2016-06-19 17:18:09 (GMT)
commita4eec3c2305856bfb228daac6b047f6baf80c12e (patch)
treef2bfa3c16a3198edf297d14a86ce24ca35b8744b /wpa_supplicant
parentfccba2c946407f39b546ad0b6ba42b60577777ac (diff)
downloadhostap-a4eec3c2305856bfb228daac6b047f6baf80c12e.zip
hostap-a4eec3c2305856bfb228daac6b047f6baf80c12e.tar.gz
hostap-a4eec3c2305856bfb228daac6b047f6baf80c12e.tar.bz2
mesh: Use variable length MGTK for RX
This extends the data structures to allow variable length MGTK to be stored for RX. This is needed as an initial step towards supporting different cipher suites. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/mesh_mpm.c10
-rw-r--r--wpa_supplicant/mesh_rsn.c1
2 files changed, 7 insertions, 4 deletions
diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index 84c5b6b..090198d 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -797,15 +797,17 @@ static void mesh_mpm_plink_estab(struct wpa_supplicant *wpa_s,
/* TODO: support for other ciphers */
wpa_drv_set_key(wpa_s, WPA_ALG_CCMP, sta->addr, 0, 0,
seq, sizeof(seq), sta->mtk, sta->mtk_len);
+
+ wpa_hexdump_key(MSG_DEBUG, "mesh: RX MGTK",
+ sta->mgtk, sta->mgtk_len);
+ /* TODO: support for other ciphers */
+ /* FIX: key index.. */
wpa_drv_set_key(wpa_s, WPA_ALG_CCMP, sta->addr, 1, 0,
seq, sizeof(seq),
- sta->mgtk, sizeof(sta->mgtk));
+ sta->mgtk, sta->mgtk_len);
wpa_drv_set_key(wpa_s, WPA_ALG_IGTK, sta->addr, 4, 0,
seq, sizeof(seq),
sta->mgtk, sizeof(sta->mgtk));
-
- wpa_hexdump_key(MSG_DEBUG, "mgtk:",
- sta->mgtk, sizeof(sta->mgtk));
}
wpa_mesh_set_plink_state(wpa_s, sta, PLINK_ESTAB);
diff --git a/wpa_supplicant/mesh_rsn.c b/wpa_supplicant/mesh_rsn.c
index 0fa0fbf..db2a608 100644
--- a/wpa_supplicant/mesh_rsn.c
+++ b/wpa_supplicant/mesh_rsn.c
@@ -640,6 +640,7 @@ int mesh_rsn_process_ampe(struct wpa_supplicant *wpa_s, struct sta_info *sta,
os_memcpy(sta->peer_nonce, ampe->local_nonce,
sizeof(ampe->local_nonce));
os_memcpy(sta->mgtk, ampe->mgtk, sizeof(ampe->mgtk));
+ sta->mgtk_len = sizeof(ampe->mgtk);
/* todo parse mgtk expiration */
free: