3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 22:19:23 +01:00

handshake: handle OSEN AKM when setting IEs

This commit is contained in:
James Prestwood 2019-06-10 15:46:56 -07:00 committed by Denis Kenzior
parent b09dbcd5ac
commit 058d65c686
2 changed files with 16 additions and 1 deletions

View File

@ -143,6 +143,12 @@ static bool handshake_state_setup_own_ciphers(struct handshake_state *s,
s->pairwise_cipher = info->pairwise_ciphers;
s->group_cipher = info->group_cipher;
s->group_management_cipher = info->group_management_cipher;
/*
* Dont set MFP for OSEN otherwise EAPoL will attempt to negotiate a
* iGTK which is not allowe for OSEN.
*/
if (!s->osen_ie)
s->mfp = info->mfpc;
return true;
@ -156,6 +162,7 @@ bool handshake_state_set_authenticator_ie(struct handshake_state *s,
l_free(s->authenticator_ie);
s->authenticator_ie = l_memdup(ie, ie[1] + 2u);
s->wpa_ie = is_ie_wpa_ie(ie + 2, ie[1]);
s->osen_ie = is_ie_wfa_ie(ie + 2, ie[1], IE_WFA_OI_OSEN);
if (!s->authenticator)
return true;
@ -163,6 +170,9 @@ bool handshake_state_set_authenticator_ie(struct handshake_state *s,
if (s->wpa_ie) {
if (ie_parse_wpa_from_data(ie, ie[1] + 2, &info) < 0)
return false;
} else if (s->osen_ie) {
if (ie_parse_osen_from_data(ie, ie[1] + 2, &info) < 0)
return false;
} else {
if (ie_parse_rsne_from_data(ie, ie[1] + 2, &info) < 0)
return false;
@ -179,6 +189,7 @@ bool handshake_state_set_supplicant_ie(struct handshake_state *s,
l_free(s->supplicant_ie);
s->supplicant_ie = l_memdup(ie, ie[1] + 2u);
s->wpa_ie = is_ie_wpa_ie(ie + 2, ie[1]);
s->osen_ie = is_ie_wfa_ie(ie + 2, ie[1], IE_WFA_OI_OSEN);
if (s->authenticator)
return true;
@ -186,6 +197,9 @@ bool handshake_state_set_supplicant_ie(struct handshake_state *s,
if (s->wpa_ie) {
if (ie_parse_wpa_from_data(ie, ie[1] + 2, &info) < 0)
return false;
} else if (s->osen_ie) {
if (ie_parse_osen_from_data(ie, ie[1] + 2, &info) < 0)
return false;
} else {
if (ie_parse_rsne_from_data(ie, ie[1] + 2, &info) < 0)
return false;

View File

@ -103,6 +103,7 @@ struct handshake_state {
bool have_snonce : 1;
bool ptk_complete : 1;
bool wpa_ie : 1;
bool osen_ie : 1;
bool have_pmk : 1;
bool mfp : 1;
bool have_anonce : 1;