diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/key.c | 14 | ||||
-rw-r--r-- | net/mac80211/wep.c | 3 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 6 |
3 files changed, 14 insertions, 9 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 57afcd38cd9e..a5b06fe71980 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -281,6 +281,20 @@ struct ieee80211_key *ieee80211_key_alloc(enum ieee80211_key_alg alg, | |||
281 | key->conf.alg = alg; | 281 | key->conf.alg = alg; |
282 | key->conf.keyidx = idx; | 282 | key->conf.keyidx = idx; |
283 | key->conf.keylen = key_len; | 283 | key->conf.keylen = key_len; |
284 | switch (alg) { | ||
285 | case ALG_WEP: | ||
286 | key->conf.iv_len = WEP_IV_LEN; | ||
287 | key->conf.icv_len = WEP_ICV_LEN; | ||
288 | break; | ||
289 | case ALG_TKIP: | ||
290 | key->conf.iv_len = TKIP_IV_LEN; | ||
291 | key->conf.icv_len = TKIP_ICV_LEN; | ||
292 | break; | ||
293 | case ALG_CCMP: | ||
294 | key->conf.iv_len = CCMP_HDR_LEN; | ||
295 | key->conf.icv_len = CCMP_MIC_LEN; | ||
296 | break; | ||
297 | } | ||
284 | memcpy(key->conf.key, key_data, key_len); | 298 | memcpy(key->conf.key, key_data, key_len); |
285 | INIT_LIST_HEAD(&key->list); | 299 | INIT_LIST_HEAD(&key->list); |
286 | INIT_LIST_HEAD(&key->todo); | 300 | INIT_LIST_HEAD(&key->todo); |
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 376c84987e4f..f0e2d3ecb5c4 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
@@ -313,9 +313,6 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
313 | { | 313 | { |
314 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 314 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
315 | 315 | ||
316 | info->control.iv_len = WEP_IV_LEN; | ||
317 | info->control.icv_len = WEP_ICV_LEN; | ||
318 | |||
319 | if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { | 316 | if (!(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { |
320 | if (ieee80211_wep_encrypt(tx->local, skb, tx->key)) | 317 | if (ieee80211_wep_encrypt(tx->local, skb, tx->key)) |
321 | return -1; | 318 | return -1; |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 37ae9a959f63..6db649480e8f 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -152,9 +152,6 @@ static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
152 | int len, tail; | 152 | int len, tail; |
153 | u8 *pos; | 153 | u8 *pos; |
154 | 154 | ||
155 | info->control.icv_len = TKIP_ICV_LEN; | ||
156 | info->control.iv_len = TKIP_IV_LEN; | ||
157 | |||
158 | if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && | 155 | if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && |
159 | !(tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) { | 156 | !(tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) { |
160 | /* hwaccel - with no need for preallocated room for IV/ICV */ | 157 | /* hwaccel - with no need for preallocated room for IV/ICV */ |
@@ -374,9 +371,6 @@ static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
374 | u8 *pos, *pn; | 371 | u8 *pos, *pn; |
375 | int i; | 372 | int i; |
376 | 373 | ||
377 | info->control.icv_len = CCMP_MIC_LEN; | ||
378 | info->control.iv_len = CCMP_HDR_LEN; | ||
379 | |||
380 | if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && | 374 | if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && |
381 | !(tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) { | 375 | !(tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) { |
382 | /* hwaccel - with no need for preallocated room for CCMP " | 376 | /* hwaccel - with no need for preallocated room for CCMP " |