Skip to content

Commit

Permalink
mac80211: incorrect shift direction
Browse files Browse the repository at this point in the history
Looks like  5d2cdcd ("mac80211: get a
TKIP phase key from skb") got the shifts wrong.

Noticed by sparse:
net/mac80211/tkip.c:234:25: warning: right shift by bigger than source value
net/mac80211/tkip.c:235:25: warning: right shift by bigger than source value
net/mac80211/tkip.c:236:25: warning: right shift by bigger than source value

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Harvey Harrison authored and John W. Linville committed May 1, 2008
1 parent 636c5d4 commit 17f8304
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/mac80211/tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,8 @@ void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,

iv16 = data[hdr_len] << 8;
iv16 += data[hdr_len + 2];
iv32 = data[hdr_len + 4] +
(data[hdr_len + 5] >> 8) +
(data[hdr_len + 6] >> 16) +
(data[hdr_len + 7] >> 24);
iv32 = data[hdr_len + 4] | (data[hdr_len + 5] << 8) |
(data[hdr_len + 6] << 16) | (data[hdr_len + 7] << 24);

#ifdef CONFIG_TKIP_DEBUG
printk(KERN_DEBUG "TKIP encrypt: iv16 = 0x%04x, iv32 = 0x%08x\n",
Expand Down

0 comments on commit 17f8304

Please sign in to comment.