mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-04-15 06:28:00 +02:00
netdev/eapol: removed eapol deauthenticate
This removes the need for the eapol/netdev deauthenticate function. netdev_handshake_failed was exposed so device.c could issue the disconnect.
This commit is contained in:
parent
28c400499d
commit
92f1ceb3ce
@ -657,8 +657,11 @@ static void device_handshake_event(struct handshake_state *hs,
|
|||||||
/* If we got here, then our PSK works. Save if required */
|
/* If we got here, then our PSK works. Save if required */
|
||||||
network_sync_psk(network);
|
network_sync_psk(network);
|
||||||
break;
|
break;
|
||||||
case HANDSHAKE_EVENT_COMPLETE:
|
|
||||||
case HANDSHAKE_EVENT_FAILED:
|
case HANDSHAKE_EVENT_FAILED:
|
||||||
|
netdev_handshake_failed(device_get_netdev(device),
|
||||||
|
l_get_u16(event_data));
|
||||||
|
break;
|
||||||
|
case HANDSHAKE_EVENT_COMPLETE:
|
||||||
/*
|
/*
|
||||||
* currently we dont care about any other events. The
|
* currently we dont care about any other events. The
|
||||||
* netdev_connect_cb will notify us when the connection is
|
* netdev_connect_cb will notify us when the connection is
|
||||||
|
11
src/eapol.c
11
src/eapol.c
@ -42,7 +42,6 @@ struct l_queue *preauths;
|
|||||||
struct watchlist frame_watches;
|
struct watchlist frame_watches;
|
||||||
static uint32_t eapol_4way_handshake_time = 2;
|
static uint32_t eapol_4way_handshake_time = 2;
|
||||||
|
|
||||||
eapol_deauthenticate_func_t deauthenticate = NULL;
|
|
||||||
eapol_rekey_offload_func_t rekey_offload = NULL;
|
eapol_rekey_offload_func_t rekey_offload = NULL;
|
||||||
|
|
||||||
eapol_tx_packet_func_t tx_packet = NULL;
|
eapol_tx_packet_func_t tx_packet = NULL;
|
||||||
@ -756,11 +755,6 @@ static inline void handshake_failed(struct eapol_sm *sm, uint16_t reason_code)
|
|||||||
{
|
{
|
||||||
handshake_event(sm->handshake, HANDSHAKE_EVENT_FAILED, &reason_code);
|
handshake_event(sm->handshake, HANDSHAKE_EVENT_FAILED, &reason_code);
|
||||||
|
|
||||||
if (deauthenticate)
|
|
||||||
deauthenticate(sm->handshake->ifindex,
|
|
||||||
sm->handshake->aa, sm->handshake->spa,
|
|
||||||
reason_code, sm->user_data);
|
|
||||||
|
|
||||||
eapol_sm_free(sm);
|
eapol_sm_free(sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2000,11 +1994,6 @@ void __eapol_set_tx_user_data(void *user_data)
|
|||||||
tx_user_data = user_data;
|
tx_user_data = user_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __eapol_set_deauthenticate_func(eapol_deauthenticate_func_t func)
|
|
||||||
{
|
|
||||||
deauthenticate = func;
|
|
||||||
}
|
|
||||||
|
|
||||||
void __eapol_set_rekey_offload_func(eapol_rekey_offload_func_t func)
|
void __eapol_set_rekey_offload_func(eapol_rekey_offload_func_t func)
|
||||||
{
|
{
|
||||||
rekey_offload = func;
|
rekey_offload = func;
|
||||||
|
@ -120,10 +120,6 @@ typedef void (*eapol_rekey_offload_func_t)(uint32_t ifindex,
|
|||||||
typedef void (*eapol_sm_event_func_t)(unsigned int event,
|
typedef void (*eapol_sm_event_func_t)(unsigned int event,
|
||||||
const void *event_data,
|
const void *event_data,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
typedef void (*eapol_deauthenticate_func_t)(uint32_t ifindex, const uint8_t *aa,
|
|
||||||
const uint8_t *spa,
|
|
||||||
uint16_t reason_code,
|
|
||||||
void *user_data);
|
|
||||||
typedef void (*eapol_preauth_cb_t)(const uint8_t *pmk, void *user_data);
|
typedef void (*eapol_preauth_cb_t)(const uint8_t *pmk, void *user_data);
|
||||||
typedef void (*eapol_preauth_destroy_func_t)(void *user_data);
|
typedef void (*eapol_preauth_destroy_func_t)(void *user_data);
|
||||||
typedef void (*eapol_frame_watch_func_t)(uint16_t proto, const uint8_t *from,
|
typedef void (*eapol_frame_watch_func_t)(uint16_t proto, const uint8_t *from,
|
||||||
@ -183,7 +179,6 @@ void __eapol_tx_packet(uint32_t ifindex, const uint8_t *dst, uint16_t proto,
|
|||||||
void __eapol_set_tx_packet_func(eapol_tx_packet_func_t func);
|
void __eapol_set_tx_packet_func(eapol_tx_packet_func_t func);
|
||||||
void __eapol_set_tx_user_data(void *user_data);
|
void __eapol_set_tx_user_data(void *user_data);
|
||||||
|
|
||||||
void __eapol_set_deauthenticate_func(eapol_deauthenticate_func_t func);
|
|
||||||
void __eapol_set_rekey_offload_func(eapol_rekey_offload_func_t func);
|
void __eapol_set_rekey_offload_func(eapol_rekey_offload_func_t func);
|
||||||
void __eapol_update_replay_counter(uint32_t ifindex, const uint8_t *spa,
|
void __eapol_update_replay_counter(uint32_t ifindex, const uint8_t *spa,
|
||||||
const uint8_t *aa, uint64_t replay_counter);
|
const uint8_t *aa, uint64_t replay_counter);
|
||||||
|
12
src/netdev.c
12
src/netdev.c
@ -1276,19 +1276,12 @@ invalid_key:
|
|||||||
netdev_setting_keys_failed(nhs, rc);
|
netdev_setting_keys_failed(nhs, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void netdev_handshake_failed(uint32_t ifindex,
|
void netdev_handshake_failed(struct netdev *netdev, uint16_t reason_code)
|
||||||
const uint8_t *aa, const uint8_t *spa,
|
|
||||||
uint16_t reason_code, void *user_data)
|
|
||||||
{
|
{
|
||||||
struct l_genl_msg *msg;
|
struct l_genl_msg *msg;
|
||||||
struct netdev *netdev;
|
|
||||||
|
|
||||||
netdev = netdev_find(ifindex);
|
|
||||||
if (!netdev)
|
|
||||||
return;
|
|
||||||
|
|
||||||
l_error("4-Way handshake failed for ifindex: %d, reason: %u",
|
l_error("4-Way handshake failed for ifindex: %d, reason: %u",
|
||||||
ifindex, reason_code);
|
netdev->index, reason_code);
|
||||||
|
|
||||||
netdev->sm = NULL;
|
netdev->sm = NULL;
|
||||||
|
|
||||||
@ -4140,7 +4133,6 @@ bool netdev_init(struct l_genl_family *in,
|
|||||||
__handshake_set_install_gtk_func(netdev_set_gtk);
|
__handshake_set_install_gtk_func(netdev_set_gtk);
|
||||||
__handshake_set_install_igtk_func(netdev_set_igtk);
|
__handshake_set_install_igtk_func(netdev_set_igtk);
|
||||||
|
|
||||||
__eapol_set_deauthenticate_func(netdev_handshake_failed);
|
|
||||||
__eapol_set_rekey_offload_func(netdev_set_rekey_offload);
|
__eapol_set_rekey_offload_func(netdev_set_rekey_offload);
|
||||||
__eapol_set_tx_packet_func(netdev_control_port_frame);
|
__eapol_set_tx_packet_func(netdev_control_port_frame);
|
||||||
|
|
||||||
|
@ -145,6 +145,8 @@ uint32_t netdev_frame_watch_add(struct netdev *netdev, uint16_t frame_type,
|
|||||||
void *user_data);
|
void *user_data);
|
||||||
bool netdev_frame_watch_remove(struct netdev *netdev, uint32_t id);
|
bool netdev_frame_watch_remove(struct netdev *netdev, uint32_t id);
|
||||||
|
|
||||||
|
void netdev_handshake_failed(struct netdev *netdev, uint16_t reason_code);
|
||||||
|
|
||||||
struct netdev *netdev_find(int ifindex);
|
struct netdev *netdev_find(int ifindex);
|
||||||
|
|
||||||
uint32_t netdev_watch_add(struct netdev *netdev, netdev_watch_func_t func,
|
uint32_t netdev_watch_add(struct netdev *netdev, netdev_watch_func_t func,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user