mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-21 03:32:42 +01:00
eapol: Change the interface index data type
The ifindex should be uint32_t instead of int.
This commit is contained in:
parent
8e6bd7d613
commit
acce7c9034
13
src/eapol.c
13
src/eapol.c
@ -497,12 +497,12 @@ void eapol_sm_set_own_rsn(struct eapol_sm *sm, const uint8_t *rsn_ie,
|
|||||||
sm->own_rsn = l_memdup(rsn_ie, len);
|
sm->own_rsn = l_memdup(rsn_ie, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void eapol_start(int ifindex, struct eapol_sm *sm)
|
void eapol_start(uint32_t ifindex, struct eapol_sm *sm)
|
||||||
{
|
{
|
||||||
l_hashmap_insert(state_machines, L_UINT_TO_PTR(ifindex), sm);
|
l_hashmap_insert(state_machines, L_UINT_TO_PTR(ifindex), sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void eapol_handle_ptk_1_of_4(int ifindex, struct eapol_sm *sm,
|
static void eapol_handle_ptk_1_of_4(uint32_t ifindex, struct eapol_sm *sm,
|
||||||
const struct eapol_key *ek)
|
const struct eapol_key *ek)
|
||||||
{
|
{
|
||||||
struct crypto_ptk *ptk = (struct crypto_ptk *) sm->ptk;
|
struct crypto_ptk *ptk = (struct crypto_ptk *) sm->ptk;
|
||||||
@ -671,7 +671,8 @@ static bool eapol_ap_rsne_matches(const uint8_t *eapol_rsne,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void eapol_handle_ptk_3_of_4(int ifindex, struct eapol_sm *sm,
|
static void eapol_handle_ptk_3_of_4(uint32_t ifindex,
|
||||||
|
struct eapol_sm *sm,
|
||||||
const struct eapol_key *ek,
|
const struct eapol_key *ek,
|
||||||
const uint8_t *decrypted_key_data,
|
const uint8_t *decrypted_key_data,
|
||||||
size_t decrypted_key_data_size)
|
size_t decrypted_key_data_size)
|
||||||
@ -736,9 +737,9 @@ fail:
|
|||||||
l_free(step4);
|
l_free(step4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __eapol_rx_packet(int ifindex, const uint8_t *sta_addr,
|
void __eapol_rx_packet(uint32_t ifindex,
|
||||||
const uint8_t *aa_addr,
|
const uint8_t *sta_addr, const uint8_t *aa_addr,
|
||||||
const uint8_t *frame, size_t len)
|
const uint8_t *frame, size_t len)
|
||||||
{
|
{
|
||||||
const struct eapol_key *ek;
|
const struct eapol_key *ek;
|
||||||
struct eapol_sm *sm;
|
struct eapol_sm *sm;
|
||||||
|
10
src/eapol.h
10
src/eapol.h
@ -95,9 +95,9 @@ struct eapol_key {
|
|||||||
uint8_t key_data[0];
|
uint8_t key_data[0];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
typedef int (*eapol_tx_packet_func_t)(int ifindex, const uint8_t *aa_addr,
|
typedef int (*eapol_tx_packet_func_t)(uint32_t ifindex, const uint8_t *aa_addr,
|
||||||
const uint8_t *sta_addr,
|
const uint8_t *sta_addr,
|
||||||
const struct eapol_key *ek);
|
const struct eapol_key *ek);
|
||||||
typedef bool (*eapol_get_nonce_func_t)(uint8_t nonce[]);
|
typedef bool (*eapol_get_nonce_func_t)(uint8_t nonce[]);
|
||||||
|
|
||||||
bool eapol_calculate_mic(const uint8_t *kck, const struct eapol_key *frame,
|
bool eapol_calculate_mic(const uint8_t *kck, const struct eapol_key *frame,
|
||||||
@ -128,7 +128,7 @@ struct eapol_key *eapol_create_ptk_4_of_4(
|
|||||||
enum eapol_key_descriptor_version version,
|
enum eapol_key_descriptor_version version,
|
||||||
uint64_t key_replay_counter);
|
uint64_t key_replay_counter);
|
||||||
|
|
||||||
void __eapol_rx_packet(int ifindex, const uint8_t *sta_addr,
|
void __eapol_rx_packet(uint32_t ifindex, const uint8_t *sta_addr,
|
||||||
const uint8_t *aa_addr,
|
const uint8_t *aa_addr,
|
||||||
const uint8_t *frame, size_t len);
|
const uint8_t *frame, size_t len);
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ void eapol_sm_set_own_rsn(struct eapol_sm *sm, const uint8_t *rsn_ie,
|
|||||||
size_t len);
|
size_t len);
|
||||||
struct l_io *eapol_open_pae(uint32_t index);
|
struct l_io *eapol_open_pae(uint32_t index);
|
||||||
|
|
||||||
void eapol_start(int ifindex, struct eapol_sm *sm);
|
void eapol_start(uint32_t ifindex, struct eapol_sm *sm);
|
||||||
|
|
||||||
bool eapol_init();
|
bool eapol_init();
|
||||||
bool eapol_exit();
|
bool eapol_exit();
|
||||||
|
Loading…
Reference in New Issue
Block a user