All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vasanth@atheros.com>
To: <linux-wireless@vger.kernel.org>
Cc: <johannes@sipsolutions.net>, <Jouni.Malinen@atheros.com>,
	Vasanthakumar Thiagarajan <vasanth@atheros.com>
Subject: [PATCH] [RFC] mac80211: Disable HT negotiation with TKIP/WEP as pairwise cipher
Date: Fri, 19 Dec 2008 18:40:35 +0530	[thread overview]
Message-ID: <1229692235-21734-1-git-send-email-vasanth@atheros.com> (raw)

IEEE802.11n does not allow TKIP/WEP as pairwise cipher in HT mode.
Connect in non-ht mode if either of these ciphers is cofigured as
pairwise.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 net/mac80211/ieee80211_i.h |    1 +
 net/mac80211/mlme.c        |    9 ++++++++-
 net/mac80211/wext.c        |    5 ++++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index a7dabae..5d78d2e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -314,6 +314,7 @@ struct ieee80211_if_sta {
 	unsigned int auth_algs; /* bitfield of allowed auth algs */
 	int auth_alg; /* currently used IEEE 802.11 authentication algorithm */
 	int auth_transaction;
+	u32 ucast_cipher;
 
 	unsigned long ibss_join_req;
 	struct sk_buff *probe_resp; /* ProbeResp template for IBSS */
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 829cdf8..8a8c48c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -391,10 +391,17 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
 	}
 
 	/* wmm support is a must to HT */
+	/*
+	 * IEEE802.11n does not allow TKIP/WEP as pairwise
+	 * ciphers in HT mode. Connect in non-ht mode if any
+	 * one of these ciphers is configured as pairwise.
+	 */
 	if (wmm && (ifsta->flags & IEEE80211_STA_WMM_ENABLED) &&
 	    sband->ht_cap.ht_supported &&
 	    (ht_ie = ieee80211_bss_get_ie(bss, WLAN_EID_HT_INFORMATION)) &&
-	    ht_ie[1] >= sizeof(struct ieee80211_ht_info)) {
+	    ht_ie[1] >= sizeof(struct ieee80211_ht_info) &&
+	    (ifsta->ucast_cipher & (IW_AUTH_CIPHER_NONE |
+	    IW_AUTH_CIPHER_CCMP))) {
 		struct ieee80211_ht_info *ht_info =
 			(struct ieee80211_ht_info *)(ht_ie + 2);
 		u16 cap = sband->ht_cap.cap;
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 1542804..385b322 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -873,12 +873,15 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
 
 	switch (data->flags & IW_AUTH_INDEX) {
 	case IW_AUTH_WPA_VERSION:
-	case IW_AUTH_CIPHER_PAIRWISE:
 	case IW_AUTH_CIPHER_GROUP:
 	case IW_AUTH_WPA_ENABLED:
 	case IW_AUTH_RX_UNENCRYPTED_EAPOL:
 	case IW_AUTH_KEY_MGMT:
 		break;
+	case IW_AUTH_CIPHER_PAIRWISE:
+		if (sdata->vif.type == NL80211_IFTYPE_STATION)
+			sdata->u.sta.ucast_cipher = data->value;
+		break;
 	case IW_AUTH_DROP_UNENCRYPTED:
 		sdata->drop_unencrypted = !!data->value;
 		break;
-- 
1.5.5.1


             reply	other threads:[~2008-12-19 13:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19 13:10 Vasanthakumar Thiagarajan [this message]
2008-12-19 13:17 ` [PATCH] [RFC] mac80211: Disable HT negotiation with TKIP/WEP as pairwise cipher Johannes Berg
2008-12-19 14:25   ` Vasanthakumar Thiagarajan
2008-12-19 14:28 ` John W. Linville
2008-12-19 14:33   ` Vasanthakumar Thiagarajan
2008-12-19 14:42     ` John W. Linville
2008-12-19 14:52       ` Richard Farina
2008-12-19 14:56   ` Jouni Malinen
2008-12-19 15:30     ` John W. Linville

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=1229692235-21734-1-git-send-email-vasanth@atheros.com \
    --to=vasanth@atheros.com \
    --cc=Jouni.Malinen@atheros.com \
    --cc=johannes@sipsolutions.net \
    --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.