diff options
Diffstat (limited to 'net/ieee80211')
-rw-r--r-- | net/ieee80211/ieee80211_crypt_tkip.c | 19 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_crypt_wep.c | 3 |
2 files changed, 19 insertions, 3 deletions
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c index 259572dfd4f1..4200ec509866 100644 --- a/net/ieee80211/ieee80211_crypt_tkip.c +++ b/net/ieee80211/ieee80211_crypt_tkip.c | |||
@@ -93,7 +93,7 @@ static void *ieee80211_tkip_init(int key_idx) | |||
93 | if (IS_ERR(priv->tx_tfm_arc4)) { | 93 | if (IS_ERR(priv->tx_tfm_arc4)) { |
94 | printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " | 94 | printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " |
95 | "crypto API arc4\n"); | 95 | "crypto API arc4\n"); |
96 | priv->tfm_arc4 = NULL; | 96 | priv->tx_tfm_arc4 = NULL; |
97 | goto fail; | 97 | goto fail; |
98 | } | 98 | } |
99 | 99 | ||
@@ -102,6 +102,7 @@ static void *ieee80211_tkip_init(int key_idx) | |||
102 | if (IS_ERR(priv->tx_tfm_michael)) { | 102 | if (IS_ERR(priv->tx_tfm_michael)) { |
103 | printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " | 103 | printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " |
104 | "crypto API michael_mic\n"); | 104 | "crypto API michael_mic\n"); |
105 | priv->tx_tfm_michael = NULL; | ||
105 | goto fail; | 106 | goto fail; |
106 | } | 107 | } |
107 | 108 | ||
@@ -110,6 +111,7 @@ static void *ieee80211_tkip_init(int key_idx) | |||
110 | if (IS_ERR(priv->rx_tfm_arc4)) { | 111 | if (IS_ERR(priv->rx_tfm_arc4)) { |
111 | printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " | 112 | printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " |
112 | "crypto API arc4\n"); | 113 | "crypto API arc4\n"); |
114 | priv->rx_tfm_arc4 = NULL; | ||
113 | goto fail; | 115 | goto fail; |
114 | } | 116 | } |
115 | 117 | ||
@@ -118,7 +120,7 @@ static void *ieee80211_tkip_init(int key_idx) | |||
118 | if (IS_ERR(priv->rx_tfm_michael)) { | 120 | if (IS_ERR(priv->rx_tfm_michael)) { |
119 | printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " | 121 | printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate " |
120 | "crypto API michael_mic\n"); | 122 | "crypto API michael_mic\n"); |
121 | priv->tfm_michael = NULL; | 123 | priv->rx_tfm_michael = NULL; |
122 | goto fail; | 124 | goto fail; |
123 | } | 125 | } |
124 | 126 | ||
@@ -392,6 +394,19 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
392 | return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); | 394 | return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); |
393 | } | 395 | } |
394 | 396 | ||
397 | /* | ||
398 | * deal with seq counter wrapping correctly. | ||
399 | * refer to timer_after() for jiffies wrapping handling | ||
400 | */ | ||
401 | static inline int tkip_replay_check(u32 iv32_n, u16 iv16_n, | ||
402 | u32 iv32_o, u16 iv16_o) | ||
403 | { | ||
404 | if ((s32)iv32_n - (s32)iv32_o < 0 || | ||
405 | (iv32_n == iv32_o && iv16_n <= iv16_o)) | ||
406 | return 1; | ||
407 | return 0; | ||
408 | } | ||
409 | |||
395 | static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | 410 | static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) |
396 | { | 411 | { |
397 | struct ieee80211_tkip_data *tkey = priv; | 412 | struct ieee80211_tkip_data *tkey = priv; |
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c index 9eeec13c28b0..1b2efff11d39 100644 --- a/net/ieee80211/ieee80211_crypt_wep.c +++ b/net/ieee80211/ieee80211_crypt_wep.c | |||
@@ -50,7 +50,7 @@ static void *prism2_wep_init(int keyidx) | |||
50 | if (IS_ERR(priv->tx_tfm)) { | 50 | if (IS_ERR(priv->tx_tfm)) { |
51 | printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " | 51 | printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " |
52 | "crypto API arc4\n"); | 52 | "crypto API arc4\n"); |
53 | priv->tfm = NULL; | 53 | priv->tx_tfm = NULL; |
54 | goto fail; | 54 | goto fail; |
55 | } | 55 | } |
56 | 56 | ||
@@ -58,6 +58,7 @@ static void *prism2_wep_init(int keyidx) | |||
58 | if (IS_ERR(priv->rx_tfm)) { | 58 | if (IS_ERR(priv->rx_tfm)) { |
59 | printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " | 59 | printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " |
60 | "crypto API arc4\n"); | 60 | "crypto API arc4\n"); |
61 | priv->rx_tfm = NULL; | ||
61 | goto fail; | 62 | goto fail; |
62 | } | 63 | } |
63 | /* start WEP IV from a random value */ | 64 | /* start WEP IV from a random value */ |