mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-21 22:09:23 +01:00
unit: Decrypt key data and verify RSN is present
This commit is contained in:
parent
d8931f5b58
commit
57c51a2e12
@ -33,6 +33,7 @@
|
||||
#include "src/sha1.h"
|
||||
#include "src/eapol.h"
|
||||
#include "src/crypto.h"
|
||||
#include "src/aes.h"
|
||||
|
||||
struct eapol_key_data {
|
||||
const unsigned char *frame;
|
||||
@ -494,6 +495,7 @@ static void eapol_4way_test(const void *data)
|
||||
const struct eapol_key *step2;
|
||||
const struct eapol_key *step3;
|
||||
const struct eapol_key *step4;
|
||||
uint8_t *decrypted_key_data;
|
||||
|
||||
step1 = eapol_verify_ptk_1_of_4(eapol_key_data_3,
|
||||
sizeof(eapol_key_data_3));
|
||||
@ -532,6 +534,10 @@ static void eapol_4way_test(const void *data)
|
||||
assert(step3);
|
||||
assert(!memcmp(anonce, step3->key_nonce, sizeof(step3->key_nonce)));
|
||||
|
||||
decrypted_key_data = eapol_decrypt_key_data(ptk->kek, step3);
|
||||
assert(decrypted_key_data[0] == 48); // RSNE
|
||||
l_free(decrypted_key_data);
|
||||
|
||||
step4 = eapol_verify_ptk_4_of_4(eapol_key_data_6,
|
||||
sizeof(eapol_key_data_6));
|
||||
assert(step4);
|
||||
|
Loading…
Reference in New Issue
Block a user