diff options
-rw-r--r-- | include/linux/ieee80211.h | 18 | ||||
-rw-r--r-- | net/wireless/util.c | 36 |
2 files changed, 54 insertions, 0 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4f4eea8a6288..dbf417bf25bf 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -1994,9 +1994,15 @@ enum ieee80211_key_len { | |||
1994 | WLAN_KEY_LEN_WEP40 = 5, | 1994 | WLAN_KEY_LEN_WEP40 = 5, |
1995 | WLAN_KEY_LEN_WEP104 = 13, | 1995 | WLAN_KEY_LEN_WEP104 = 13, |
1996 | WLAN_KEY_LEN_CCMP = 16, | 1996 | WLAN_KEY_LEN_CCMP = 16, |
1997 | WLAN_KEY_LEN_CCMP_256 = 32, | ||
1997 | WLAN_KEY_LEN_TKIP = 32, | 1998 | WLAN_KEY_LEN_TKIP = 32, |
1998 | WLAN_KEY_LEN_AES_CMAC = 16, | 1999 | WLAN_KEY_LEN_AES_CMAC = 16, |
1999 | WLAN_KEY_LEN_SMS4 = 32, | 2000 | WLAN_KEY_LEN_SMS4 = 32, |
2001 | WLAN_KEY_LEN_GCMP = 16, | ||
2002 | WLAN_KEY_LEN_GCMP_256 = 32, | ||
2003 | WLAN_KEY_LEN_BIP_CMAC_256 = 32, | ||
2004 | WLAN_KEY_LEN_BIP_GMAC_128 = 16, | ||
2005 | WLAN_KEY_LEN_BIP_GMAC_256 = 32, | ||
2000 | }; | 2006 | }; |
2001 | 2007 | ||
2002 | #define IEEE80211_WEP_IV_LEN 4 | 2008 | #define IEEE80211_WEP_IV_LEN 4 |
@@ -2004,9 +2010,16 @@ enum ieee80211_key_len { | |||
2004 | #define IEEE80211_CCMP_HDR_LEN 8 | 2010 | #define IEEE80211_CCMP_HDR_LEN 8 |
2005 | #define IEEE80211_CCMP_MIC_LEN 8 | 2011 | #define IEEE80211_CCMP_MIC_LEN 8 |
2006 | #define IEEE80211_CCMP_PN_LEN 6 | 2012 | #define IEEE80211_CCMP_PN_LEN 6 |
2013 | #define IEEE80211_CCMP_256_HDR_LEN 8 | ||
2014 | #define IEEE80211_CCMP_256_MIC_LEN 16 | ||
2015 | #define IEEE80211_CCMP_256_PN_LEN 6 | ||
2007 | #define IEEE80211_TKIP_IV_LEN 8 | 2016 | #define IEEE80211_TKIP_IV_LEN 8 |
2008 | #define IEEE80211_TKIP_ICV_LEN 4 | 2017 | #define IEEE80211_TKIP_ICV_LEN 4 |
2009 | #define IEEE80211_CMAC_PN_LEN 6 | 2018 | #define IEEE80211_CMAC_PN_LEN 6 |
2019 | #define IEEE80211_GMAC_PN_LEN 6 | ||
2020 | #define IEEE80211_GCMP_HDR_LEN 8 | ||
2021 | #define IEEE80211_GCMP_MIC_LEN 16 | ||
2022 | #define IEEE80211_GCMP_PN_LEN 6 | ||
2010 | 2023 | ||
2011 | /* Public action codes */ | 2024 | /* Public action codes */ |
2012 | enum ieee80211_pub_actioncode { | 2025 | enum ieee80211_pub_actioncode { |
@@ -2230,6 +2243,11 @@ enum ieee80211_sa_query_action { | |||
2230 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 | 2243 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 |
2231 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 | 2244 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 |
2232 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 | 2245 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 |
2246 | #define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09 | ||
2247 | #define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A | ||
2248 | #define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B | ||
2249 | #define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C | ||
2250 | #define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D | ||
2233 | 2251 | ||
2234 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 | 2252 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 |
2235 | 2253 | ||
diff --git a/net/wireless/util.c b/net/wireless/util.c index 08f136ad2ea5..919fee807dd9 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -230,6 +230,9 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | |||
230 | switch (params->cipher) { | 230 | switch (params->cipher) { |
231 | case WLAN_CIPHER_SUITE_TKIP: | 231 | case WLAN_CIPHER_SUITE_TKIP: |
232 | case WLAN_CIPHER_SUITE_CCMP: | 232 | case WLAN_CIPHER_SUITE_CCMP: |
233 | case WLAN_CIPHER_SUITE_CCMP_256: | ||
234 | case WLAN_CIPHER_SUITE_GCMP: | ||
235 | case WLAN_CIPHER_SUITE_GCMP_256: | ||
233 | /* Disallow pairwise keys with non-zero index unless it's WEP | 236 | /* Disallow pairwise keys with non-zero index unless it's WEP |
234 | * or a vendor specific cipher (because current deployments use | 237 | * or a vendor specific cipher (because current deployments use |
235 | * pairwise WEP keys with non-zero indices and for vendor | 238 | * pairwise WEP keys with non-zero indices and for vendor |
@@ -240,6 +243,9 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | |||
240 | return -EINVAL; | 243 | return -EINVAL; |
241 | break; | 244 | break; |
242 | case WLAN_CIPHER_SUITE_AES_CMAC: | 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: | ||
243 | /* Disallow BIP (group-only) cipher as pairwise cipher */ | 249 | /* Disallow BIP (group-only) cipher as pairwise cipher */ |
244 | if (pairwise) | 250 | if (pairwise) |
245 | return -EINVAL; | 251 | return -EINVAL; |
@@ -261,6 +267,18 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | |||
261 | if (params->key_len != WLAN_KEY_LEN_CCMP) | 267 | if (params->key_len != WLAN_KEY_LEN_CCMP) |
262 | return -EINVAL; | 268 | return -EINVAL; |
263 | 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; | ||
264 | case WLAN_CIPHER_SUITE_WEP104: | 282 | case WLAN_CIPHER_SUITE_WEP104: |
265 | if (params->key_len != WLAN_KEY_LEN_WEP104) | 283 | if (params->key_len != WLAN_KEY_LEN_WEP104) |
266 | return -EINVAL; | 284 | return -EINVAL; |
@@ -269,6 +287,18 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | |||
269 | if (params->key_len != WLAN_KEY_LEN_AES_CMAC) | 287 | if (params->key_len != WLAN_KEY_LEN_AES_CMAC) |
270 | return -EINVAL; | 288 | return -EINVAL; |
271 | 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; | ||
272 | default: | 302 | default: |
273 | /* | 303 | /* |
274 | * We don't know anything about this algorithm, | 304 | * We don't know anything about this algorithm, |
@@ -288,7 +318,13 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | |||
288 | return -EINVAL; | 318 | return -EINVAL; |
289 | case WLAN_CIPHER_SUITE_TKIP: | 319 | case WLAN_CIPHER_SUITE_TKIP: |
290 | 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: | ||
291 | 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: | ||
292 | if (params->seq_len != 6) | 328 | if (params->seq_len != 6) |
293 | return -EINVAL; | 329 | return -EINVAL; |
294 | break; | 330 | break; |