Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352710
b: refs/heads/master
c: 0339500
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg committed Feb 15, 2013
1 parent 8fecb19 commit 901c6d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65f704a52ec5db356c58f8ba53a31d3aef02737f
refs/heads/master: 03395003bf8ac813b1a0ac9299b3496484caf228
10 changes: 4 additions & 6 deletions trunk/net/mac80211/tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,11 @@ void ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *keyconf,
struct ieee80211_key *key = (struct ieee80211_key *)
container_of(keyconf, struct ieee80211_key, conf);
struct tkip_ctx *ctx = &key->u.tkip.tx;
unsigned long flags;

spin_lock_irqsave(&key->u.tkip.txlock, flags);
spin_lock_bh(&key->u.tkip.txlock);
ieee80211_compute_tkip_p1k(key, iv32);
memcpy(p1k, ctx->p1k, sizeof(ctx->p1k));
spin_unlock_irqrestore(&key->u.tkip.txlock, flags);
spin_unlock_bh(&key->u.tkip.txlock);
}
EXPORT_SYMBOL(ieee80211_get_tkip_p1k_iv);

Expand All @@ -208,12 +207,11 @@ void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
const u8 *data = (u8 *)hdr + ieee80211_hdrlen(hdr->frame_control);
u32 iv32 = get_unaligned_le32(&data[4]);
u16 iv16 = data[2] | (data[0] << 8);
unsigned long flags;

spin_lock_irqsave(&key->u.tkip.txlock, flags);
spin_lock_bh(&key->u.tkip.txlock);
ieee80211_compute_tkip_p1k(key, iv32);
tkip_mixing_phase2(tk, ctx, iv16, p2k);
spin_unlock_irqrestore(&key->u.tkip.txlock, flags);
spin_unlock_bh(&key->u.tkip.txlock);
}
EXPORT_SYMBOL(ieee80211_get_tkip_p2k);

Expand Down
5 changes: 2 additions & 3 deletions trunk/net/mac80211/wpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct ieee80211_key *key = tx->key;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
unsigned long flags;
unsigned int hdrlen;
int len, tail;
u8 *pos;
Expand Down Expand Up @@ -216,12 +215,12 @@ static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
return 0;

/* Increase IV for the frame */
spin_lock_irqsave(&key->u.tkip.txlock, flags);
spin_lock(&key->u.tkip.txlock);
key->u.tkip.tx.iv16++;
if (key->u.tkip.tx.iv16 == 0)
key->u.tkip.tx.iv32++;
pos = ieee80211_tkip_add_iv(pos, key);
spin_unlock_irqrestore(&key->u.tkip.txlock, flags);
spin_unlock(&key->u.tkip.txlock);

/* hwaccel - with software IV */
if (info->control.hw_key)
Expand Down

0 comments on commit 901c6d9

Please sign in to comment.