To be honest, I'm a little bit a newbie myself when it comes to
linux-wireless so keep that in mind.  ;)  Changing the parameters seems
simple enough.  But it needs to an EXPORT_SYMBOL() and to be declared in
a header file and I'm not sure what else.  But we have four
implementations of this function now.

diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index 0ae2077..f149593 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -105,11 +105,9 @@ static void tkip_mixing_phase1(const u8 *tk, struct 
tkip_ctx *ctx,
        ctx->p1k_iv32 = tsc_IV32;
 }
 
-static void tkip_mixing_phase2(const u8 *tk, struct tkip_ctx *ctx,
-                              u16 tsc_IV16, u8 *rc4key)
+void tkip_mixing_phase2(const u8 *tk, const u16 *p1k, u16 tsc_IV16, u8 *rc4key)
 {
        u16 ppk[6];
-       const u16 *p1k = ctx->p1k;
        int i;
 
        ppk[0] = p1k[0];
@@ -210,7 +208,7 @@ void ieee80211_get_tkip_p2k(struct ieee80211_key_conf 
*keyconf,
 
        spin_lock(&key->u.tkip.txlock);
        ieee80211_compute_tkip_p1k(key, iv32);
-       tkip_mixing_phase2(tk, ctx, iv16, p2k);
+       tkip_mixing_phase2(tk, ctx->p1k, iv16, p2k);
        spin_unlock(&key->u.tkip.txlock);
 }
 EXPORT_SYMBOL(ieee80211_get_tkip_p2k);
@@ -295,7 +293,7 @@ int ieee80211_tkip_decrypt_data(struct crypto_cipher *tfm,
                key->u.tkip.rx[queue].state = TKIP_STATE_PHASE1_HW_UPLOADED;
        }
 
-       tkip_mixing_phase2(tk, &key->u.tkip.rx[queue], iv16, rc4key);
+       tkip_mixing_phase2(tk, key->u.tkip.rx[queue].p1k, iv16, rc4key);
 
        res = ieee80211_wep_decrypt_data(tfm, rc4key, 16, pos, payload_len - 
12);
  done:
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to