All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ortwin Glück" <odi@odi.ch>
To: linux-wireless@vger.kernel.org
Subject: WEP and enc restricted
Date: Sun, 14 Sep 2008 17:44:12 +0200	[thread overview]
Message-ID: <48CD314C.40105@odi.ch> (raw)

[-- 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) {

             reply	other threads:[~2008-09-14 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-14 15:44 Ortwin Glück [this message]
2008-09-15  5:24 ` WEP and enc restricted Dan Williams
2008-09-15  8:31   ` Ortwin Glück

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48CD314C.40105@odi.ch \
    --to=odi@odi.ch \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.