mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
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>
This commit is contained in:
parent
1d624a0702
commit
5420bcf477
@ -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,
|
||||
|
@ -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]++;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user