linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* WEP and enc restricted
@ 2008-09-14 15:44 Ortwin Glück
  2008-09-15  5:24 ` Dan Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Ortwin Glück @ 2008-09-14 15:44 UTC (permalink / raw)
  To: linux-wireless

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

Hi,

I am pretty sure that the mac80211 code doesn't handle WEP with shared keys 
correctly. Using the ath9k driver on my MacBook I am unable to put the driver 
into restricted mode (shared key). It stays in open mode. That is the following 
command has no effect: iwconfig wlan0 enc restricted. I can also confirm this 
when looking at the authentication packets that go over the air: they are sent 
with the open flag, and not the shared key flag.

Surprisingly nowhere in the mac80211 code the ifsta->auth_alg is set to 
WLAN_AUTH_SHARED_KEY so far. The attached small patch does just that. I am not 
100% sure if that's the way to do it, so please review carefully.

With this patch authentication works. The AP now denies association, but that is 
another problem.

Cheers

Ortwin

[-- Attachment #2: patch.diff --]
[-- Type: text/plain, Size: 496 bytes --]

--- wext.c.orig	2008-07-21 22:18:29.000000000 +0200
+++ wext.c	2008-09-14 16:46:09.000000000 +0200
@@ -929,6 +929,14 @@
 	else
 		idx--;
 
+	if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+		struct ieee80211_if_sta *ifsta = &sdata->u.sta;
+		if (erq->flags & IW_ENCODE_OPEN)
+			ifsta->auth_alg = WLAN_AUTH_OPEN;
+		else if (erq->flags & IW_ENCODE_RESTRICTED)
+			ifsta->auth_alg = WLAN_AUTH_SHARED_KEY;
+	}
+
 	if (erq->flags & IW_ENCODE_DISABLED)
 		remove = 1;
 	else if (erq->length == 0) {

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

end of thread, other threads:[~2008-09-15  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-14 15:44 WEP and enc restricted Ortwin Glück
2008-09-15  5:24 ` Dan Williams
2008-09-15  8:31   ` Ortwin Glück

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).