aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-12 23:33:42 +0200
committerJouni Malinen <j@w1.fi>2010-11-12 23:33:42 +0200
commita9dd29d3e1eb0d7159e8dc0f06f131de553db884 (patch)
tree76fa0c37fb85b9653f02be74d071c7291748c3cc /wlantest
parent42e79f82dcb1307349325beef7f52a0a4cac2bf9 (diff)
downloadexternal_wpa_supplicant_8_ti-a9dd29d3e1eb0d7159e8dc0f06f131de553db884.zip
external_wpa_supplicant_8_ti-a9dd29d3e1eb0d7159e8dc0f06f131de553db884.tar.gz
external_wpa_supplicant_8_ti-a9dd29d3e1eb0d7159e8dc0f06f131de553db884.tar.bz2
wlantest: Use negotiated AKM/cipher to select PMK-to-PTK parameters
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/rx_data.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wlantest/rx_data.c b/wlantest/rx_data.c
index bd80d43..5a8f0f3 100644
--- a/wlantest/rx_data.c
+++ b/wlantest/rx_data.c
@@ -17,6 +17,7 @@
#include "utils/common.h"
#include "crypto/aes_wrap.h"
#include "crypto/crypto.h"
+#include "common/defs.h"
#include "common/ieee802_11_defs.h"
#include "common/eapol_common.h"
#include "common/wpa_common.h"
@@ -118,12 +119,12 @@ static int try_pmk(struct wlantest_bss *bss, struct wlantest_sta *sta,
struct wlantest_pmk *pmk)
{
struct wpa_ptk ptk;
- size_t ptk_len = 48; /* FIX: 64 for TKIP */
+ size_t ptk_len = sta->pairwise_cipher == WPA_CIPHER_TKIP ? 64 : 48;
wpa_pmk_to_ptk(pmk->pmk, sizeof(pmk->pmk),
"Pairwise key expansion",
bss->bssid, sta->addr, sta->anonce, sta->snonce,
(u8 *) &ptk, ptk_len,
- 0 /* FIX: SHA256 based on AKM */);
+ wpa_key_mgmt_sha256(sta->key_mgmt));
if (check_mic(ptk.kck, ver, data, len) < 0)
return -1;