aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-05-14 19:26:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:47:50 -0400
commit3c83809917dce9bbd880f6b08edc2d0ccac14a25 (patch)
tree7c4795c3f32d3f2d3206e36e50fd78cb02c48700
parent82a57447fa66bf138cd55206f33eea21ee257335 (diff)
mac80211: tkip.c use struct tkip_ctx in phase 2 key mixing
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: "John W. Linville" <linville@tuxdriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/tkip.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index e9ee247e13f7..a00cf1ea7719 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -95,10 +95,12 @@ static void tkip_mixing_phase1(struct ieee80211_key *key, const u8 *ta,
95 ctx->initialized = 1; 95 ctx->initialized = 1;
96} 96}
97 97
98static void tkip_mixing_phase2(const u16 *p1k, const u8 *tk, u16 tsc_IV16, 98static void tkip_mixing_phase2(struct ieee80211_key *key, struct tkip_ctx *ctx,
99 u8 *rc4key) 99 u16 tsc_IV16, u8 *rc4key)
100{ 100{
101 u16 ppk[6]; 101 u16 ppk[6];
102 const u16 *p1k = ctx->p1k;
103 const u8 *tk = &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY];
102 int i; 104 int i;
103 105
104 ppk[0] = p1k[0]; 106 ppk[0] = p1k[0];
@@ -152,9 +154,7 @@ static void ieee80211_tkip_gen_rc4key(struct ieee80211_key *key, u8 *ta,
152 if (key->u.tkip.tx.iv16 == 0 || !key->u.tkip.tx.initialized) 154 if (key->u.tkip.tx.iv16 == 0 || !key->u.tkip.tx.initialized)
153 tkip_mixing_phase1(key, ta, &key->u.tkip.tx, key->u.tkip.tx.iv32); 155 tkip_mixing_phase1(key, ta, &key->u.tkip.tx, key->u.tkip.tx.iv32);
154 156
155 tkip_mixing_phase2(key->u.tkip.tx.p1k, 157 tkip_mixing_phase2(key, &key->u.tkip.tx, key->u.tkip.tx.iv16, rc4key);
156 &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY],
157 key->u.tkip.tx.iv16, rc4key);
158} 158}
159 159
160void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, 160void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
@@ -197,8 +197,7 @@ void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
197 return; 197 return;
198 } 198 }
199 199
200 tkip_mixing_phase2(key->u.tkip.tx.p1k, 200 tkip_mixing_phase2(key, &key->u.tkip.tx, iv16, outkey);
201 &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY], iv16, outkey);
202} 201}
203EXPORT_SYMBOL(ieee80211_get_tkip_key); 202EXPORT_SYMBOL(ieee80211_get_tkip_key);
204 203
@@ -315,9 +314,7 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
315 } 314 }
316 } 315 }
317 316
318 tkip_mixing_phase2(key->u.tkip.rx[queue].p1k, 317 tkip_mixing_phase2(key, &key->u.tkip.rx[queue], iv16, rc4key);
319 &key->conf.key[ALG_TKIP_TEMP_ENCR_KEY],
320 iv16, rc4key);
321#ifdef CONFIG_TKIP_DEBUG 318#ifdef CONFIG_TKIP_DEBUG
322 { 319 {
323 int i; 320 int i;