mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-30 14:22:37 +01:00
eapol: Use eapol_start in authenticator mode too
On the supplicant side eapol_register would only register the eapol_sm on a given netdev to start receiving frames and an eapol_start call is required for the state machine to start executing. On the authenticator side we shouldn't have the "early frame" problem but there's no reason for the semantics of the two methods to be different. Somehow we were doing everything in eapol_register and not using eapol_start if hs->authenticator was true, so bring this in line with the supplicant side and require eapol_start to be called also from ap.c.
This commit is contained in:
parent
49f38b0d2e
commit
1f910f84b4
1
src/ap.c
1
src/ap.c
@ -469,6 +469,7 @@ static void ap_start_rsna(struct sta_state *sta, const uint8_t *gtk_rsc)
|
|||||||
eapol_sm_set_listen_interval(sta->sm, sta->listen_interval);
|
eapol_sm_set_listen_interval(sta->sm, sta->listen_interval);
|
||||||
|
|
||||||
eapol_register(sta->sm);
|
eapol_register(sta->sm);
|
||||||
|
eapol_start(sta->sm);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
33
src/eapol.c
33
src/eapol.c
@ -2338,28 +2338,14 @@ void __eapol_set_rekey_offload_func(eapol_rekey_offload_func_t func)
|
|||||||
|
|
||||||
void eapol_register(struct eapol_sm *sm)
|
void eapol_register(struct eapol_sm *sm)
|
||||||
{
|
{
|
||||||
|
eapol_frame_watch_func_t rx_handler = sm->handshake->authenticator ?
|
||||||
|
eapol_rx_auth_packet : eapol_rx_packet;
|
||||||
|
|
||||||
l_queue_push_head(state_machines, sm);
|
l_queue_push_head(state_machines, sm);
|
||||||
|
|
||||||
if (sm->handshake->authenticator) {
|
|
||||||
sm->watch_id = eapol_frame_watch_add(sm->handshake->ifindex,
|
sm->watch_id = eapol_frame_watch_add(sm->handshake->ifindex,
|
||||||
eapol_rx_auth_packet, sm);
|
rx_handler, sm);
|
||||||
|
|
||||||
if (!sm->handshake->proto_version)
|
|
||||||
sm->protocol_version = EAPOL_PROTOCOL_VERSION_2004;
|
|
||||||
else
|
|
||||||
sm->protocol_version = sm->handshake->proto_version;
|
sm->protocol_version = sm->handshake->proto_version;
|
||||||
|
|
||||||
sm->started = true;
|
|
||||||
/* Since AP/AdHoc only support AKM PSK we can hard code this */
|
|
||||||
sm->mic_len = 16;
|
|
||||||
|
|
||||||
/* kick off handshake */
|
|
||||||
eapol_ptk_1_of_4_retry(NULL, sm);
|
|
||||||
} else {
|
|
||||||
sm->watch_id = eapol_frame_watch_add(sm->handshake->ifindex,
|
|
||||||
eapol_rx_packet, sm);
|
|
||||||
sm->protocol_version = sm->handshake->proto_version;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool eapol_start(struct eapol_sm *sm)
|
bool eapol_start(struct eapol_sm *sm)
|
||||||
@ -2409,6 +2395,17 @@ bool eapol_start(struct eapol_sm *sm)
|
|||||||
sm->early_frame = NULL;
|
sm->early_frame = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sm->handshake->authenticator) {
|
||||||
|
if (L_WARN_ON(!sm->handshake->have_pmk))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!sm->protocol_version)
|
||||||
|
sm->protocol_version = EAPOL_PROTOCOL_VERSION_2004;
|
||||||
|
|
||||||
|
/* Kick off handshake */
|
||||||
|
eapol_ptk_1_of_4_retry(NULL, sm);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
eap_error:
|
eap_error:
|
||||||
|
Loading…
Reference in New Issue
Block a user