All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Wu <flamingice@sourmilk.net>
To: Jiri Benc <jbenc@suse.cz>
Cc: Michael Buesch <mb@bu3sch.de>,
	John Linville <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>
Subject: d80211: Fix TKIP key type
Date: Tue, 6 Feb 2007 10:33:41 -0500	[thread overview]
Message-ID: <200702061033.50134.flamingice@sourmilk.net> (raw)
In-Reply-To: <20070205221957.3c9003b5@griffin.suse.cz>

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

d80211: Fix TKIP key type

Avoid the messy typecasting and let drivers handle byteordering.

Signed-off-by: Michael Wu <flamingice@sourmilk.net>

diff --git a/include/net/d80211.h b/include/net/d80211.h
index 65a5d36..0bd6b15 100644
--- a/include/net/d80211.h
+++ b/include/net/d80211.h
@@ -202,7 +202,10 @@ struct ieee80211_tx_control {
 				 * hw->set_key() */
 	u8 icv_len;		/* length of the ICV/MIC field in octets */
 	u8 iv_len;		/* length of the IV field in octets */
-	u8 tkip_key[16];	/* generated phase2/phase1 key for hw TKIP */
+	union {
+		u16 phase1[5];
+		u8 phase2[16];
+	} tkip;			/* generated phase2/phase1 key for hw TKIP */
 	u8 queue;		/* hardware queue to use for this frame;
 				 * 0 = highest, hw->queues-1 = lowest */
 	u8 sw_retry_attempt;	/* number of times hw has tried to
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
diff --git a/net/d80211/wpa.c b/net/d80211/wpa.c
index 7b64abf..d5ef61a 100644
--- a/net/d80211/wpa.c
+++ b/net/d80211/wpa.c
@@ -344,12 +344,12 @@ skip_iv_inc:
 
 		if (flags & IEEE80211_HW_TKIP_REQ_PHASE2_KEY)
 			ieee80211_tkip_gen_rc4key(key, hdr->addr2,
-						  tx->u.tx.control->tkip_key);
+						  tx->u.tx.control->tkip.phase2);
 		else if (flags & IEEE80211_HW_TKIP_REQ_PHASE1_KEY) {
 			if (key->u.tkip.iv16 == 0 ||
 			    !key->u.tkip.tx_initialized) {
 				ieee80211_tkip_gen_phase1key(key, hdr->addr2,
-					    (u16 *)tx->u.tx.control->tkip_key);
+					    tx->u.tx.control->tkip.phase1);
 				key->u.tkip.tx_initialized = 1;
 				tx->u.tx.control->flags |=
 					    IEEE80211_TXCTL_TKIP_NEW_PHASE1_KEY;

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2007-02-06 15:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-03 17:32 [PATCH RFC] d80211: Fix TKIP phase1 key mixing for hwcrypto Michael Buesch
2007-02-05 21:19 ` Jiri Benc
2007-02-06 15:02   ` Michael Buesch
2007-02-08 18:17     ` Jiri Benc
2007-02-06 15:33   ` Michael Wu [this message]
2007-02-06 15:44     ` d80211: Fix TKIP key type Michael Buesch
2007-02-07 11:44       ` Johannes Berg
2007-02-08 17:15     ` Michael Buesch
2007-02-08 18:22       ` Jiri Benc

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=200702061033.50134.flamingice@sourmilk.net \
    --to=flamingice@sourmilk.net \
    --cc=jbenc@suse.cz \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    /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.