aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/util.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-02-04 17:57:45 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-04 17:57:45 -0500
commit940288b6a560710d4c63bc84d9570779dd7dec2b (patch)
tree349a41e8d8d75239428efcfd299d4b680cc839a1 /net/wireless/util.c
parent541c571fa2fdfd4782d840276c5aedb535349075 (diff)
parent79044f60caa7c377333dc8f13cf1e48c144e2521 (diff)
Merge tag 'mac80211-next-for-davem-2015-02-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Last round of updates for net-next: * revert a patch that caused a regression with mesh userspace (Bob) * fix a number of suspend/resume related races (from Emmanuel, Luca and myself - we'll look at backporting later) * add software implementations for new ciphers (Jouni) * add a new ACPI ID for Broadcom's rfkill (Mika) * allow using netns FD for wireless (Vadim) * some other cleanups (various) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r--net/wireless/util.c68
1 files changed, 56 insertions, 12 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 0d1966d54aaa..6903dbdcb8c1 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -227,18 +227,32 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
227 if (pairwise && !mac_addr) 227 if (pairwise && !mac_addr)
228 return -EINVAL; 228 return -EINVAL;
229 229
230 /* 230 switch (params->cipher) {
231 * Disallow pairwise keys with non-zero index unless it's WEP 231 case WLAN_CIPHER_SUITE_TKIP:
232 * or a vendor specific cipher (because current deployments use 232 case WLAN_CIPHER_SUITE_CCMP:
233 * pairwise WEP keys with non-zero indices and for vendor specific 233 case WLAN_CIPHER_SUITE_CCMP_256:
234 * ciphers this should be validated in the driver or hardware level 234 case WLAN_CIPHER_SUITE_GCMP:
235 * - but 802.11i clearly specifies to use zero) 235 case WLAN_CIPHER_SUITE_GCMP_256:
236 */ 236 /* Disallow pairwise keys with non-zero index unless it's WEP
237 if (pairwise && key_idx && 237 * or a vendor specific cipher (because current deployments use
238 ((params->cipher == WLAN_CIPHER_SUITE_TKIP) || 238 * pairwise WEP keys with non-zero indices and for vendor
239 (params->cipher == WLAN_CIPHER_SUITE_CCMP) || 239 * specific ciphers this should be validated in the driver or
240 (params->cipher == WLAN_CIPHER_SUITE_AES_CMAC))) 240 * hardware level - but 802.11i clearly specifies to use zero)
241 return -EINVAL; 241 */
242 if (pairwise && key_idx)
243 return -EINVAL;
244 break;
245 case WLAN_CIPHER_SUITE_AES_CMAC:
246 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
247 case WLAN_CIPHER_SUITE_BIP_GMAC_128:
248 case WLAN_CIPHER_SUITE_BIP_GMAC_256:
249 /* Disallow BIP (group-only) cipher as pairwise cipher */
250 if (pairwise)
251 return -EINVAL;
252 break;
253 default:
254 break;
255 }
242 256
243 switch (params->cipher) { 257 switch (params->cipher) {
244 case WLAN_CIPHER_SUITE_WEP40: 258 case WLAN_CIPHER_SUITE_WEP40:
@@ -253,6 +267,18 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
253 if (params->key_len != WLAN_KEY_LEN_CCMP) 267 if (params->key_len != WLAN_KEY_LEN_CCMP)
254 return -EINVAL; 268 return -EINVAL;
255 break; 269 break;
270 case WLAN_CIPHER_SUITE_CCMP_256:
271 if (params->key_len != WLAN_KEY_LEN_CCMP_256)
272 return -EINVAL;
273 break;
274 case WLAN_CIPHER_SUITE_GCMP:
275 if (params->key_len != WLAN_KEY_LEN_GCMP)
276 return -EINVAL;
277 break;
278 case WLAN_CIPHER_SUITE_GCMP_256:
279 if (params->key_len != WLAN_KEY_LEN_GCMP_256)
280 return -EINVAL;
281 break;
256 case WLAN_CIPHER_SUITE_WEP104: 282 case WLAN_CIPHER_SUITE_WEP104:
257 if (params->key_len != WLAN_KEY_LEN_WEP104) 283 if (params->key_len != WLAN_KEY_LEN_WEP104)
258 return -EINVAL; 284 return -EINVAL;
@@ -261,6 +287,18 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
261 if (params->key_len != WLAN_KEY_LEN_AES_CMAC) 287 if (params->key_len != WLAN_KEY_LEN_AES_CMAC)
262 return -EINVAL; 288 return -EINVAL;
263 break; 289 break;
290 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
291 if (params->key_len != WLAN_KEY_LEN_BIP_CMAC_256)
292 return -EINVAL;
293 break;
294 case WLAN_CIPHER_SUITE_BIP_GMAC_128:
295 if (params->key_len != WLAN_KEY_LEN_BIP_GMAC_128)
296 return -EINVAL;
297 break;
298 case WLAN_CIPHER_SUITE_BIP_GMAC_256:
299 if (params->key_len != WLAN_KEY_LEN_BIP_GMAC_256)
300 return -EINVAL;
301 break;
264 default: 302 default:
265 /* 303 /*
266 * We don't know anything about this algorithm, 304 * We don't know anything about this algorithm,
@@ -280,7 +318,13 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
280 return -EINVAL; 318 return -EINVAL;
281 case WLAN_CIPHER_SUITE_TKIP: 319 case WLAN_CIPHER_SUITE_TKIP:
282 case WLAN_CIPHER_SUITE_CCMP: 320 case WLAN_CIPHER_SUITE_CCMP:
321 case WLAN_CIPHER_SUITE_CCMP_256:
322 case WLAN_CIPHER_SUITE_GCMP:
323 case WLAN_CIPHER_SUITE_GCMP_256:
283 case WLAN_CIPHER_SUITE_AES_CMAC: 324 case WLAN_CIPHER_SUITE_AES_CMAC:
325 case WLAN_CIPHER_SUITE_BIP_CMAC_256:
326 case WLAN_CIPHER_SUITE_BIP_GMAC_128:
327 case WLAN_CIPHER_SUITE_BIP_GMAC_256:
284 if (params->seq_len != 6) 328 if (params->seq_len != 6)
285 return -EINVAL; 329 return -EINVAL;
286 break; 330 break;