All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eapol: do not parse RSN for WPA1 in 1 of 4
@ 2019-10-17 23:43 James Prestwood
  2019-10-17 23:48 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2019-10-17 23:43 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

A recent change checked the return value of ie_parse_rsne_from_data
inside the ptk 1/4 handler. This seemed safe, but actually caused
the eapol unit test to fail.

The reason was because eapol was parsing the IEs assuming they were
an RSN, when they could be a WPA IE (WPA1 not WPA2). The WPA case
does not end up using the rsn_info at all, so having rsn_info
uninitialized did not pose a problem. After adding the return value
check it was found this fails every time for WPA1.

Since the rsn_info is not needed for WPA1 we can only do the RSN
parse for WPA2 and leave rsn_info uninitialized.
---
 src/eapol.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/eapol.c b/src/eapol.c
index 6f04dbc5..349e824f 100644
--- a/src/eapol.c
+++ b/src/eapol.c
@@ -1106,8 +1106,11 @@ static void eapol_handle_ptk_1_of_4(struct eapol_sm *sm,
 	pmkid = handshake_util_find_pmkid_kde(EAPOL_KEY_DATA(ek, sm->mic_len),
 					EAPOL_KEY_DATA_LEN(ek, sm->mic_len));
 
-	if (ie_parse_rsne_from_data(own_ie, own_ie[1] + 2, &rsn_info) < 0)
-		goto error_unspecified;
+	if (!sm->handshake->wpa_ie) {
+		if (ie_parse_rsne_from_data(own_ie, own_ie[1] + 2,
+						&rsn_info) < 0)
+			goto error_unspecified;
+	}
 
 	/*
 	 * Require the PMKID KDE whenever we've sent a list of PMKIDs in
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] eapol: do not parse RSN for WPA1 in 1 of 4
  2019-10-17 23:43 [PATCH] eapol: do not parse RSN for WPA1 in 1 of 4 James Prestwood
@ 2019-10-17 23:48 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2019-10-17 23:48 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

Hi James,

On 10/17/19 6:43 PM, James Prestwood wrote:
> A recent change checked the return value of ie_parse_rsne_from_data
> inside the ptk 1/4 handler. This seemed safe, but actually caused
> the eapol unit test to fail.
> 
> The reason was because eapol was parsing the IEs assuming they were
> an RSN, when they could be a WPA IE (WPA1 not WPA2). The WPA case
> does not end up using the rsn_info at all, so having rsn_info
> uninitialized did not pose a problem. After adding the return value
> check it was found this fails every time for WPA1.
> 
> Since the rsn_info is not needed for WPA1 we can only do the RSN
> parse for WPA2 and leave rsn_info uninitialized.
> ---
>   src/eapol.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 

applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-17 23:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-17 23:43 [PATCH] eapol: do not parse RSN for WPA1 in 1 of 4 James Prestwood
2019-10-17 23:48 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.