linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: handle auth failure returned with unmatching auth algo
@ 2012-06-12 10:40 Eyal Shapira
  2012-06-12 13:57 ` Kalle Valo
  2012-06-12 14:09 ` Johannes Berg
  0 siblings, 2 replies; 5+ messages in thread
From: Eyal Shapira @ 2012-06-12 10:40 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Some Netgear APs like WNAP210 have a quirk behavior when
configured for WEP Shared. They send an auth response with algo
SHARED and status code NOT_SUPPORTED_AUTH_ALG (13) when being
sent a request made with auth algo OPEN. Enable such response to
propagate to userspace instead of discarding it so wpa_s can
reattempt to auth with SHARED.

Reported-by: Noam Shaked <noams@ti.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
---
 net/mac80211/mlme.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0f45d02..3ad4366 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1783,7 +1783,8 @@ ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
 	auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction);
 	status_code = le16_to_cpu(mgmt->u.auth.status_code);
 
-	if (auth_alg != ifmgd->auth_data->algorithm ||
+	if ((auth_alg != ifmgd->auth_data->algorithm &&
+	     status_code != WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) ||
 	    auth_transaction != ifmgd->auth_data->expected_transaction)
 		return RX_MGMT_NONE;
 
-- 
1.7.4.1


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

* Re: [PATCH] mac80211: handle auth failure returned with unmatching auth algo
  2012-06-12 10:40 [PATCH] mac80211: handle auth failure returned with unmatching auth algo Eyal Shapira
@ 2012-06-12 13:57 ` Kalle Valo
  2012-06-12 14:51   ` Eyal Shapira
  2012-06-12 14:09 ` Johannes Berg
  1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2012-06-12 13:57 UTC (permalink / raw)
  To: Eyal Shapira; +Cc: Johannes Berg, linux-wireless

Eyal Shapira <eyal@wizery.com> writes:

> Some Netgear APs like WNAP210 have a quirk behavior when
> configured for WEP Shared. They send an auth response with algo
> SHARED and status code NOT_SUPPORTED_AUTH_ALG (13) when being
> sent a request made with auth algo OPEN. Enable such response to
> propagate to userspace instead of discarding it so wpa_s can
> reattempt to auth with SHARED.
>
> Reported-by: Noam Shaked <noams@ti.com>
> Signed-off-by: Eyal Shapira <eyal@wizery.com>

[...]

> -	if (auth_alg != ifmgd->auth_data->algorithm ||
> +	if ((auth_alg != ifmgd->auth_data->algorithm &&
> +	     status_code != WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) ||

I think a small comment in the code would be nice, like
"WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG is a workaround for Netgear
WNAPxxx".

-- 
Kalle Valo

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

* Re: [PATCH] mac80211: handle auth failure returned with unmatching auth algo
  2012-06-12 10:40 [PATCH] mac80211: handle auth failure returned with unmatching auth algo Eyal Shapira
  2012-06-12 13:57 ` Kalle Valo
@ 2012-06-12 14:09 ` Johannes Berg
  2012-06-12 14:50   ` Eyal Shapira
  1 sibling, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2012-06-12 14:09 UTC (permalink / raw)
  To: Eyal Shapira; +Cc: linux-wireless

On Tue, 2012-06-12 at 13:40 +0300, Eyal Shapira wrote:
> Some Netgear APs like WNAP210 have a quirk behavior when
> configured for WEP Shared. They send an auth response with algo
> SHARED and status code NOT_SUPPORTED_AUTH_ALG (13) when being
> sent a request made with auth algo OPEN. Enable such response to
> propagate to userspace instead of discarding it so wpa_s can
> reattempt to auth with SHARED.

Does cfg80211 need to handle this? How does wpa_s even handle it?

johannes


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

* Re: [PATCH] mac80211: handle auth failure returned with unmatching auth algo
  2012-06-12 14:09 ` Johannes Berg
@ 2012-06-12 14:50   ` Eyal Shapira
  0 siblings, 0 replies; 5+ messages in thread
From: Eyal Shapira @ 2012-06-12 14:50 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 12 June 2012 17:09, Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Tue, 2012-06-12 at 13:40 +0300, Eyal Shapira wrote:
> > Some Netgear APs like WNAP210 have a quirk behavior when
> > configured for WEP Shared. They send an auth response with algo
> > SHARED and status code NOT_SUPPORTED_AUTH_ALG (13) when being
> > sent a request made with auth algo OPEN. Enable such response to
> > propagate to userspace instead of discarding it so wpa_s can
> > reattempt to auth with SHARED.
>
> Does cfg80211 need to handle this? How does wpa_s even handle it?

wpa_s has the following code in wpa_supplicant/sme.c/sme_event_auth()
to automatically
"escalate" in the auth algorithms it tries (from OPEN to SHARED to LEAP) :

		switch (data->auth.auth_type) {
		case WLAN_AUTH_OPEN:
			wpa_s->current_ssid->auth_alg = WPA_AUTH_ALG_SHARED;

			wpa_dbg(wpa_s, MSG_DEBUG, "SME: Trying SHARED auth");
			wpa_supplicant_associate(wpa_s, wpa_s->current_bss,
						 wpa_s->current_ssid);
			return;

		case WLAN_AUTH_SHARED_KEY:
			wpa_s->current_ssid->auth_alg = WPA_AUTH_ALG_LEAP;

			wpa_dbg(wpa_s, MSG_DEBUG, "SME: Trying LEAP auth");
			wpa_supplicant_associate(wpa_s, wpa_s->current_bss,
						 wpa_s->current_ssid);
			return;

I have a patch for that code in wpa_s as well which attempts SHARED in
case we sent OPEN
and got the NOT_SUPPORTED_AUTH_ALG response on SHARED.
I first wanted to see that the kernel patch which allows the response
to go through is accepted.

You're right of course that I also need to take care of cfg80211 when
using its SME.
I'll send an additional patch for that.

>
> johannes
>

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

* Re: [PATCH] mac80211: handle auth failure returned with unmatching auth algo
  2012-06-12 13:57 ` Kalle Valo
@ 2012-06-12 14:51   ` Eyal Shapira
  0 siblings, 0 replies; 5+ messages in thread
From: Eyal Shapira @ 2012-06-12 14:51 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Johannes Berg, linux-wireless

On 12 June 2012 16:57, Kalle Valo <kvalo@adurom.com> wrote:
> Eyal Shapira <eyal@wizery.com> writes:
>
>> Some Netgear APs like WNAP210 have a quirk behavior when
>> configured for WEP Shared. They send an auth response with algo
>> SHARED and status code NOT_SUPPORTED_AUTH_ALG (13) when being
>> sent a request made with auth algo OPEN. Enable such response to
>> propagate to userspace instead of discarding it so wpa_s can
>> reattempt to auth with SHARED.
>>
>> Reported-by: Noam Shaked <noams@ti.com>
>> Signed-off-by: Eyal Shapira <eyal@wizery.com>
>
> [...]
>
>> -     if (auth_alg != ifmgd->auth_data->algorithm ||
>> +     if ((auth_alg != ifmgd->auth_data->algorithm &&
>> +          status_code != WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) ||
>
> I think a small comment in the code would be nice, like
> "WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG is a workaround for Netgear
> WNAPxxx".
>
Sure. I'll add that in v2.

> --
> Kalle Valo

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

end of thread, other threads:[~2012-06-12 14:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12 10:40 [PATCH] mac80211: handle auth failure returned with unmatching auth algo Eyal Shapira
2012-06-12 13:57 ` Kalle Valo
2012-06-12 14:51   ` Eyal Shapira
2012-06-12 14:09 ` Johannes Berg
2012-06-12 14:50   ` Eyal Shapira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).