Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258450
b: refs/heads/master
c: 8bca5d8
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jul 15, 2011
1 parent 331e16f commit 34b72b7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66760eac005d569393bac34136bcbb8af55d8a5a
refs/heads/master: 8bca5d815311f53ada13b62f5e590df40fef317e
14 changes: 14 additions & 0 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2612,6 +2612,20 @@ static inline void ieee80211_get_tkip_p1k(struct ieee80211_key_conf *keyconf,
ieee80211_get_tkip_p1k_iv(keyconf, iv32, p1k);
}

/**
* ieee80211_get_tkip_rx_p1k - get a TKIP phase 1 key for RX
*
* This function returns the TKIP phase 1 key for the given IV32
* and transmitter address.
*
* @keyconf: the parameter passed with the set key
* @ta: TA that will be used with the key
* @iv32: IV32 to get the P1K for
* @p1k: a buffer to which the key will be written, as 5 u16 values
*/
void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
const u8 *ta, u32 iv32, u16 *p1k);

/**
* ieee80211_get_tkip_p2k - get a TKIP phase 2 key
*
Expand Down
11 changes: 11 additions & 0 deletions trunk/net/mac80211/tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ void ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *keyconf,
}
EXPORT_SYMBOL(ieee80211_get_tkip_p1k_iv);

void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
const u8 *ta, u32 iv32, u16 *p1k)
{
const u8 *tk = &keyconf->key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
struct tkip_ctx ctx;

tkip_mixing_phase1(tk, &ctx, ta, iv32);
memcpy(p1k, ctx.p1k, sizeof(ctx.p1k));
}
EXPORT_SYMBOL(ieee80211_get_tkip_rx_p1k);

void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
struct sk_buff *skb, u8 *p2k)
{
Expand Down

0 comments on commit 34b72b7

Please sign in to comment.