linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jouni Malinen <j@w1.fi>
Cc: Jouni Malinen <jouni.malinen@atheros.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath9k: Key cache allocation for AP mode
Date: Wed, 17 Dec 2008 13:00:13 +0100	[thread overview]
Message-ID: <1229515213.5175.0.camel@localhost> (raw)
In-Reply-To: <20081217120559.GB19453@jm.kir.nu>

On Wed, 2008-12-17 at 14:05 +0200, Jouni Malinen wrote:
> On Wed, Dec 17, 2008 at 12:30:11PM +0100, Johannes Berg wrote:
> > On Wed, 2008-12-17 at 13:32 +0200, Jouni Malinen wrote:
> > > +		if (vif->type != NL80211_IFTYPE_AP) {
> > > +			/* Only keyidx 0 should be used with unicast key, but
> > > +			 * allow this for client mode for now. */
> > > +			idx = key->keyidx;
> > 
> > Hey, good point, should we make the check in mac80211 stricter as well?
> > I know we accept non-zero pairwise key idx for some broken pairwise WEP
> > implementations, but that's only relevant for STA as you note.
> 
> Doing that in non-Managed modes in mac80211 sounds reasonable. I don't
> see any point in making it easier for people to make APs that do such a
> silly thing with WEP ;-). I did not look at more details here from the
> mac80211 view point, I just knew it would break the key cache changes I
> was working on for ath9k.

Right. This is what I had in mind:

--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -76,9 +76,12 @@ static int ieee80211_set_encryption(struct ieee80211_sub_if_data *sdata, u8 *sta
 			 * According to the standard, the key index of a
 			 * pairwise key must be zero. However, some AP are
 			 * broken when it comes to WEP key indices, so we
-			 * work around this.
+			 * work around this by allowing to set such keys
+			 * on STA mode interfaces.
 			 */
-			if (idx != 0 && alg != ALG_WEP) {
+			if (idx != 0 &&
+			    (sdata->vif.type != NL80211_IF_TYPE_STATION ||
+			     alg != ALG_WEP))) {
 				ieee80211_key_free(key);
 				err = -EINVAL;
 				goto out_unlock;



      reply	other threads:[~2008-12-17 12:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 11:32 [PATCH] ath9k: Key cache allocation for AP mode Jouni Malinen
2008-12-17 11:30 ` Johannes Berg
2008-12-17 12:05   ` Jouni Malinen
2008-12-17 12:00     ` Johannes Berg [this message]

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=1229515213.5175.0.camel@localhost \
    --to=johannes@sipsolutions.net \
    --cc=j@w1.fi \
    --cc=jouni.malinen@atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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 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).