aboutsummaryrefslogtreecommitdiffstats
path: root/src/rsn_supp
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-06-05 18:00:56 (GMT)
committerJouni Malinen <j@w1.fi>2008-06-05 18:00:56 (GMT)
commitb6ab429402959280446b15d772769c6c6fe2fab9 (patch)
tree12cafea4548e2f32c3d5b5edb4cb8d3e3ceeb813 /src/rsn_supp
parent7cdeb81e1fc25b96454ee9a66ef1f30aa57b7a40 (diff)
downloadhostap-06-b6ab429402959280446b15d772769c6c6fe2fab9.zip
hostap-06-b6ab429402959280446b15d772769c6c6fe2fab9.tar.gz
hostap-06-b6ab429402959280446b15d772769c6c6fe2fab9.tar.bz2
Read Michael MIC keys through TK2 union instead of offset from TK1
This gets rid of potential warnings about buffer bounds errors. The earlier code works fine, but it is not the cleanest way of using the struct wpa_ptk definition for TK1/TK2.
Diffstat (limited to 'src/rsn_supp')
-rw-r--r--src/rsn_supp/peerkey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rsn_supp/peerkey.c b/src/rsn_supp/peerkey.c
index ba5cc1e..92ced5b 100644
--- a/src/rsn_supp/peerkey.c
+++ b/src/rsn_supp/peerkey.c
@@ -867,8 +867,8 @@ static void wpa_supplicant_process_stk_3_of_4(struct wpa_sm *sm,
if (peerkey->cipher == WPA_CIPHER_TKIP) {
/* Swap Tx/Rx keys for Michael MIC */
os_memcpy(key_buf, _key, 16);
- os_memcpy(key_buf + 16, _key + 24, 8);
- os_memcpy(key_buf + 24, _key + 16, 8);
+ os_memcpy(key_buf + 16, peerkey->stk.u.auth.rx_mic_key, 8);
+ os_memcpy(key_buf + 24, peerkey->stk.u.auth.tx_mic_key, 8);
_key = key_buf;
key_len = 32;
} else