linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sukeshs@broadcom.com
To: gregkh@suse.de
Cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org
Subject: [PATCH 1/2] brcm80211: FIX for TKIP GTK bug
Date: Tue, 3 May 2011 00:00:56 -0700	[thread overview]
Message-ID: <1304406057-8722-2-git-send-email-sukeshs@broadcom.com> (raw)
In-Reply-To: <1304406057-8722-1-git-send-email-sukeshs@broadcom.com>

From: Sukesh Srikakula <sukeshs@xl-sj1-20.sj.broadcom.com>

The last 16 bytes of the key sent by cfg80211 needs to be swapped before installing it to FW for TKIP encryption.
This is not done for the group key in current code, which is corrected with this fix.

Signed-off-by: Sukesh Srikakula <sukeshs@broadcom.com>
Signed-off-by: Sukesh Srikakula <sukeshs@xl-sj1-20.sj.broadcom.com>
---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index b44daf9..c60fc7c 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1616,6 +1616,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 	s32 val;
 	s32 wsec;
 	s32 err = 0;
+	u8 keybuf[8];
 
 	WL_DBG("key index (%d)\n", key_idx);
 	CHECK_SYS_UP();
@@ -1644,6 +1645,9 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 		WL_DBG("WLAN_CIPHER_SUITE_WEP104\n");
 		break;
 	case WLAN_CIPHER_SUITE_TKIP:
+		memcpy(keybuf, &key.data[24], sizeof(keybuf));
+		memcpy(&key.data[24], &key.data[16], sizeof(keybuf));
+		memcpy(&key.data[16], keybuf, sizeof(keybuf));
 		key.algo = CRYPTO_ALGO_TKIP;
 		WL_DBG("WLAN_CIPHER_SUITE_TKIP\n");
 		break;
-- 
1.7.3.2



  reply	other threads:[~2011-05-03  7:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03  7:00 [PATCH 0/2] *** SUBJECT HERE *** sukeshs
2011-05-03  7:00 ` sukeshs [this message]
2011-05-03  7:00 ` [PATCH 2/2] brcm80211: Fix for suspend/resume bug sukeshs
2011-05-03  9:10   ` Arend van Spriel
2011-05-03 12:15   ` Greg KH
2011-05-03 12:33     ` Arend van Spriel
2011-05-03 13:00       ` Greg KH
2011-05-03 13:09         ` Arend van Spriel
2011-05-03 13:11           ` Greg KH
2011-05-03 13:17             ` Arend van Spriel
2011-05-03 13:41               ` Arend van Spriel
2011-05-03 19:46                 ` Greg KH
2011-05-03 12:14 ` [PATCH 0/2] *** SUBJECT HERE *** Greg KH

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=1304406057-8722-2-git-send-email-sukeshs@broadcom.com \
    --to=sukeshs@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --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 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).