]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Use negotiated AKM/cipher to select PMK-to-PTK parameters
authorJouni Malinen <j@w1.fi>
Fri, 12 Nov 2010 21:33:42 +0000 (23:33 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 12 Nov 2010 21:33:42 +0000 (23:33 +0200)
wlantest/rx_data.c

index bd80d43818c772e63f0f8f0ad849fcfc9ede65d5..5a8f0f369de575d3308a174fd07cf4c691f1652b 100644 (file)
@@ -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;