aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-11-14 10:54:45 (GMT)
committerJouni Malinen <j@w1.fi>2017-11-14 10:54:45 (GMT)
commit5420bcf477d0088fac84cba1d803f89830b6b970 (patch)
tree519c1d144ce45e36cd6b4e4a116ee7d3bafbfe20
parent1d624a0702288b2448191e15ad85a2d8b25dacd9 (diff)
downloadhostap-5420bcf477d0088fac84cba1d803f89830b6b970.zip
hostap-5420bcf477d0088fac84cba1d803f89830b6b970.tar.gz
hostap-5420bcf477d0088fac84cba1d803f89830b6b970.tar.bz2
wlantest: Remove unnecessary duplication of tk_len from STA entries
The length of the TK is available within struct wpa_ptk, so there is no need to try to maintain it separately in wlantest. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--wlantest/rx_data.c4
-rw-r--r--wlantest/rx_eapol.c1
-rw-r--r--wlantest/wlantest.h1
3 files changed, 2 insertions, 4 deletions
diff --git a/wlantest/rx_data.c b/wlantest/rx_data.c
index 23586ea..6437b83 100644
--- a/wlantest/rx_data.c
+++ b/wlantest/rx_data.c
@@ -426,7 +426,7 @@ skip_replay_det:
decrypted = ccmp_256_decrypt(tk, hdr, data, len, &dlen);
else if (sta->pairwise_cipher == WPA_CIPHER_GCMP ||
sta->pairwise_cipher == WPA_CIPHER_GCMP_256)
- decrypted = gcmp_decrypt(tk, sta->tk_len, hdr, data,
+ decrypted = gcmp_decrypt(tk, sta->ptk.tk_len, hdr, data,
len, &dlen);
else
decrypted = ccmp_decrypt(tk, hdr, data, len, &dlen);
@@ -440,7 +440,7 @@ skip_replay_det:
len, &dlen);
else if (sta->pairwise_cipher == WPA_CIPHER_GCMP ||
sta->pairwise_cipher == WPA_CIPHER_GCMP_256)
- decrypted = gcmp_decrypt(sta->ptk.tk, sta->tk_len,
+ decrypted = gcmp_decrypt(sta->ptk.tk, sta->ptk.tk_len,
hdr, data, len, &dlen);
else
decrypted = ccmp_decrypt(sta->ptk.tk, hdr, data, len,
diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c
index 1353702..536a6c0 100644
--- a/wlantest/rx_eapol.c
+++ b/wlantest/rx_eapol.c
@@ -136,7 +136,6 @@ static int try_pmk(struct wlantest *wt, struct wlantest_bss *bss,
return -1;
}
- sta->tk_len = wpa_cipher_key_len(sta->pairwise_cipher);
wpa_printf(MSG_INFO, "Derived PTK for STA " MACSTR " BSSID " MACSTR,
MAC2STR(sta->addr), MAC2STR(bss->bssid));
sta->counters[WLANTEST_STA_COUNTER_PTK_LEARNED]++;
diff --git a/wlantest/wlantest.h b/wlantest/wlantest.h
index a841c18..7a99b48 100644
--- a/wlantest/wlantest.h
+++ b/wlantest/wlantest.h
@@ -72,7 +72,6 @@ struct wlantest_sta {
u8 anonce[32]; /* ANonce from the previous EAPOL-Key msg 1/4 or 3/4 */
u8 snonce[32]; /* SNonce from the previous EAPOL-Key msg 2/4 */
struct wpa_ptk ptk; /* Derived PTK */
- size_t tk_len;
int ptk_set;
struct wpa_ptk tptk; /* Derived PTK during rekeying */
int tptk_set;