mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 02:19:26 +01:00
sae: Return an error when dropping frames
sae_verify_* functions were correctly marking frames to be dropped, but were returning 0, which caused the to-be-dropped frames to be further processed inside sae_rx_authenticate. Fix that by returning a proper error.
This commit is contained in:
parent
3474953d16
commit
0925a362d6
14
src/sae.c
14
src/sae.c
@ -860,9 +860,10 @@ static int sae_verify_committed(struct sae_sm *sm, uint16_t transaction,
|
||||
default:
|
||||
/*
|
||||
* If the Status is some other nonzero value, the frame shall
|
||||
* be silently discarded...
|
||||
* be silently discarded and the t0 (retransmission) timer
|
||||
* shall be set.
|
||||
*/
|
||||
return 0;
|
||||
return -ENOMSG;
|
||||
}
|
||||
|
||||
reject_unsupp_group:
|
||||
@ -882,10 +883,13 @@ static int sae_verify_confirmed(struct sae_sm *sm, uint16_t trans,
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* If the Status is nonzero, the frame shall be silently discarded...
|
||||
* Upon receipt of a Com event, the t0 (retransmission) timer shall be
|
||||
* canceled. If the Status is nonzero, the frame shall be silently
|
||||
* discarded, the t0 (retransmission) timer set, and the protocol
|
||||
* instance shall remain in the Confirmed state.
|
||||
*/
|
||||
if (status != 0)
|
||||
return 0;
|
||||
return -ENOMSG;
|
||||
|
||||
/*
|
||||
* If Sync is greater than dot11RSNASAESync, the protocol instance
|
||||
@ -900,7 +904,7 @@ static int sae_verify_confirmed(struct sae_sm *sm, uint16_t trans,
|
||||
|
||||
/* frame shall be silently discarded */
|
||||
if (l_get_le16(frame) != sm->group)
|
||||
return 0;
|
||||
return -EBADMSG;
|
||||
|
||||
/*
|
||||
* the protocol instance shall increment Sync, increment Sc, and
|
||||
|
Loading…
Reference in New Issue
Block a user