aboutsummaryrefslogtreecommitdiffstats
path: root/src/rsn_supp
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-12-26 10:49:15 (GMT)
committerJouni Malinen <j@w1.fi>2008-12-26 10:49:15 (GMT)
commitff89afb77bb847dfa676fcef7e87f583b334bf89 (patch)
tree602e4df44fb7d79447a8f3927af551e5297ad36f /src/rsn_supp
parent45c94154a61d932174232e19f096e346a129b028 (diff)
downloadhostap-06-ff89afb77bb847dfa676fcef7e87f583b334bf89.zip
hostap-06-ff89afb77bb847dfa676fcef7e87f583b334bf89.tar.gz
hostap-06-ff89afb77bb847dfa676fcef7e87f583b334bf89.tar.bz2
Add Key Length field into IGTK sub-element (FTIE) per 802.11w/D7.0
Diffstat (limited to 'src/rsn_supp')
-rw-r--r--src/rsn_supp/wpa_ft.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/rsn_supp/wpa_ft.c b/src/rsn_supp/wpa_ft.c
index 0234f90..c89b89a 100644
--- a/src/rsn_supp/wpa_ft.c
+++ b/src/rsn_supp/wpa_ft.c
@@ -692,18 +692,24 @@ static int wpa_ft_process_igtk_subelem(struct wpa_sm *sm, const u8 *igtk_elem,
wpa_hexdump_key(MSG_DEBUG, "FT: Received IGTK in Reassoc Resp",
igtk_elem, igtk_elem_len);
- if (igtk_elem_len != 2 + 6 + 24) {
+ if (igtk_elem_len != 2 + 6 + 1 + WPA_IGTK_LEN + 8) {
wpa_printf(MSG_DEBUG, "FT: Invalid IGTK sub-elem "
"length %lu", (unsigned long) igtk_elem_len);
return -1;
}
- if (aes_unwrap(sm->ptk.kek, WPA_IGTK_LEN / 8, igtk_elem + 8, igtk)) {
+ if (igtk_elem[8] != WPA_IGTK_LEN) {
+ wpa_printf(MSG_DEBUG, "FT: Invalid IGTK sub-elem Key Length "
+ "%d", igtk_elem[8]);
+ return -1;
+ }
+
+ if (aes_unwrap(sm->ptk.kek, WPA_IGTK_LEN / 8, igtk_elem + 9, igtk)) {
wpa_printf(MSG_WARNING, "FT: AES unwrap failed - could not "
"decrypt IGTK");
return -1;
}
- /* KeyID[2] | PN[6] | Key[16+8] */
+ /* KeyID[2] | IPN[6] | Key Length[1] | Key[16+8] */
keyidx = WPA_GET_LE16(igtk_elem);