aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wep.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/wep.c')
-rw-r--r--net/mac80211/wep.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index 1ad3d75281cc..0b19e89fcf6a 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -67,7 +67,7 @@ void ieee80211_wep_get_iv(struct ieee80211_local *local,
67 struct ieee80211_key *key, u8 *iv) 67 struct ieee80211_key *key, u8 *iv)
68{ 68{
69 local->wep_iv++; 69 local->wep_iv++;
70 if (ieee80211_wep_weak_iv(local->wep_iv, key->keylen)) 70 if (ieee80211_wep_weak_iv(local->wep_iv, key->conf.keylen))
71 local->wep_iv += 0x0100; 71 local->wep_iv += 0x0100;
72 72
73 if (!iv) 73 if (!iv)
@@ -76,7 +76,7 @@ void ieee80211_wep_get_iv(struct ieee80211_local *local,
76 *iv++ = (local->wep_iv >> 16) & 0xff; 76 *iv++ = (local->wep_iv >> 16) & 0xff;
77 *iv++ = (local->wep_iv >> 8) & 0xff; 77 *iv++ = (local->wep_iv >> 8) & 0xff;
78 *iv++ = local->wep_iv & 0xff; 78 *iv++ = local->wep_iv & 0xff;
79 *iv++ = key->keyidx << 6; 79 *iv++ = key->conf.keyidx << 6;
80} 80}
81 81
82 82
@@ -159,10 +159,10 @@ int ieee80211_wep_encrypt(struct ieee80211_local *local, struct sk_buff *skb,
159 u8 *rc4key, *iv; 159 u8 *rc4key, *iv;
160 size_t len; 160 size_t len;
161 161
162 if (!key || key->alg != ALG_WEP) 162 if (!key || key->conf.alg != ALG_WEP)
163 return -1; 163 return -1;
164 164
165 klen = 3 + key->keylen; 165 klen = 3 + key->conf.keylen;
166 rc4key = kmalloc(klen, GFP_ATOMIC); 166 rc4key = kmalloc(klen, GFP_ATOMIC);
167 if (!rc4key) 167 if (!rc4key)
168 return -1; 168 return -1;
@@ -179,7 +179,7 @@ int ieee80211_wep_encrypt(struct ieee80211_local *local, struct sk_buff *skb,
179 memcpy(rc4key, iv, 3); 179 memcpy(rc4key, iv, 3);
180 180
181 /* Copy rest of the WEP key (the secret part) */ 181 /* Copy rest of the WEP key (the secret part) */
182 memcpy(rc4key + 3, key->key, key->keylen); 182 memcpy(rc4key + 3, key->conf.key, key->conf.keylen);
183 183
184 /* Add room for ICV */ 184 /* Add room for ICV */
185 skb_put(skb, WEP_ICV_LEN); 185 skb_put(skb, WEP_ICV_LEN);
@@ -251,10 +251,10 @@ int ieee80211_wep_decrypt(struct ieee80211_local *local, struct sk_buff *skb,
251 251
252 keyidx = skb->data[hdrlen + 3] >> 6; 252 keyidx = skb->data[hdrlen + 3] >> 6;
253 253
254 if (!key || keyidx != key->keyidx || key->alg != ALG_WEP) 254 if (!key || keyidx != key->conf.keyidx || key->conf.alg != ALG_WEP)
255 return -1; 255 return -1;
256 256
257 klen = 3 + key->keylen; 257 klen = 3 + key->conf.keylen;
258 258
259 rc4key = kmalloc(klen, GFP_ATOMIC); 259 rc4key = kmalloc(klen, GFP_ATOMIC);
260 if (!rc4key) 260 if (!rc4key)
@@ -264,7 +264,7 @@ int ieee80211_wep_decrypt(struct ieee80211_local *local, struct sk_buff *skb,
264 memcpy(rc4key, skb->data + hdrlen, 3); 264 memcpy(rc4key, skb->data + hdrlen, 3);
265 265
266 /* Copy rest of the WEP key (the secret part) */ 266 /* Copy rest of the WEP key (the secret part) */
267 memcpy(rc4key + 3, key->key, key->keylen); 267 memcpy(rc4key + 3, key->conf.key, key->conf.keylen);
268 268
269 if (ieee80211_wep_decrypt_data(local->wep_rx_tfm, rc4key, klen, 269 if (ieee80211_wep_decrypt_data(local->wep_rx_tfm, rc4key, klen,
270 skb->data + hdrlen + WEP_IV_LEN, 270 skb->data + hdrlen + WEP_IV_LEN,
@@ -321,7 +321,7 @@ u8 * ieee80211_wep_is_weak_iv(struct sk_buff *skb, struct ieee80211_key *key)
321 ivpos = skb->data + hdrlen; 321 ivpos = skb->data + hdrlen;
322 iv = (ivpos[0] << 16) | (ivpos[1] << 8) | ivpos[2]; 322 iv = (ivpos[0] << 16) | (ivpos[1] << 8) | ivpos[2];
323 323
324 if (ieee80211_wep_weak_iv(iv, key->keylen)) 324 if (ieee80211_wep_weak_iv(iv, key->conf.keylen))
325 return ivpos; 325 return ivpos;
326 326
327 return NULL; 327 return NULL;