aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/mac80211.h14
-rw-r--r--net/mac80211/tkip.c11
2 files changed, 25 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ea2c8c36477c..9e91b4f47843 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2613,6 +2613,20 @@ static inline void ieee80211_get_tkip_p1k(struct ieee80211_key_conf *keyconf,
2613} 2613}
2614 2614
2615/** 2615/**
2616 * ieee80211_get_tkip_rx_p1k - get a TKIP phase 1 key for RX
2617 *
2618 * This function returns the TKIP phase 1 key for the given IV32
2619 * and transmitter address.
2620 *
2621 * @keyconf: the parameter passed with the set key
2622 * @ta: TA that will be used with the key
2623 * @iv32: IV32 to get the P1K for
2624 * @p1k: a buffer to which the key will be written, as 5 u16 values
2625 */
2626void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
2627 const u8 *ta, u32 iv32, u16 *p1k);
2628
2629/**
2616 * ieee80211_get_tkip_p2k - get a TKIP phase 2 key 2630 * ieee80211_get_tkip_p2k - get a TKIP phase 2 key
2617 * 2631 *
2618 * This function computes the TKIP RC4 key for the IV values 2632 * This function computes the TKIP RC4 key for the IV values
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index cc79e697cdb2..f49d00a4c7fd 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -185,6 +185,17 @@ void ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *keyconf,
185} 185}
186EXPORT_SYMBOL(ieee80211_get_tkip_p1k_iv); 186EXPORT_SYMBOL(ieee80211_get_tkip_p1k_iv);
187 187
188void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
189 const u8 *ta, u32 iv32, u16 *p1k)
190{
191 const u8 *tk = &keyconf->key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
192 struct tkip_ctx ctx;
193
194 tkip_mixing_phase1(tk, &ctx, ta, iv32);
195 memcpy(p1k, ctx.p1k, sizeof(ctx.p1k));
196}
197EXPORT_SYMBOL(ieee80211_get_tkip_rx_p1k);
198
188void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, 199void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
189 struct sk_buff *skb, u8 *p2k) 200 struct sk_buff *skb, u8 *p2k)
190{ 201{