mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
eapol: Decryption of packets changes affects size
This commit is contained in:
parent
b9fd2a8a48
commit
c71bfcbb7c
10
src/eapol.c
10
src/eapol.c
@ -119,7 +119,8 @@ bool eapol_verify_mic(const uint8_t *kck, const struct eapol_key *frame)
|
||||
}
|
||||
|
||||
uint8_t *eapol_decrypt_key_data(const uint8_t *kek,
|
||||
const struct eapol_key *frame)
|
||||
const struct eapol_key *frame,
|
||||
size_t *decrypted_size)
|
||||
{
|
||||
size_t key_data_len = L_BE16_TO_CPU(frame->key_data_len);
|
||||
const uint8_t *key_data = frame->key_data;
|
||||
@ -168,6 +169,9 @@ uint8_t *eapol_decrypt_key_data(const uint8_t *kek,
|
||||
break;
|
||||
}
|
||||
|
||||
if (decrypted_size)
|
||||
*decrypted_size = expected_len;
|
||||
|
||||
return buf;
|
||||
|
||||
error:
|
||||
@ -583,6 +587,7 @@ void __eapol_rx_packet(int ifindex, const uint8_t *sta_addr,
|
||||
struct eapol_sm *sm;
|
||||
struct crypto_ptk *ptk;
|
||||
uint8_t *decrypted_key_data = NULL;
|
||||
size_t decrypted_key_data_len;
|
||||
uint64_t replay_counter;
|
||||
|
||||
ek = eapol_key_validate(frame, len);
|
||||
@ -636,7 +641,8 @@ void __eapol_rx_packet(int ifindex, const uint8_t *sta_addr,
|
||||
if (!sm->have_snonce)
|
||||
return;
|
||||
|
||||
decrypted_key_data = eapol_decrypt_key_data(ptk->kek, ek);
|
||||
decrypted_key_data = eapol_decrypt_key_data(ptk->kek, ek,
|
||||
&decrypted_key_data_len);
|
||||
if (!decrypted_key_data)
|
||||
return;
|
||||
}
|
||||
|
@ -105,7 +105,8 @@ bool eapol_calculate_mic(const uint8_t *kck, const struct eapol_key *frame,
|
||||
bool eapol_verify_mic(const uint8_t *kck, const struct eapol_key *frame);
|
||||
|
||||
uint8_t *eapol_decrypt_key_data(const uint8_t *kek,
|
||||
const struct eapol_key *frame);
|
||||
const struct eapol_key *frame,
|
||||
size_t *decrypted_size);
|
||||
|
||||
const struct eapol_key *eapol_key_validate(const uint8_t *frame, size_t len);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user