diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-05-24 16:57:19 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-03 14:05:10 -0400 |
commit | 8fc0fee09245fe740d81aded36f4af6db1054015 (patch) | |
tree | f2093f0edbef526bd54bb1d5f8913f2dc6a7a4c8 /net/wireless/util.c | |
parent | 362a415dce2130b0e4cebfc8f8fbd8128baff308 (diff) | |
download | op-kernel-dev-8fc0fee09245fe740d81aded36f4af6db1054015.zip op-kernel-dev-8fc0fee09245fe740d81aded36f4af6db1054015.tar.gz |
cfg80211: use key size constants
Instead of hardcoding the key length for validation, use the
constants Zhu Yi recently added and add one for AES_CMAC too.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index d072bff..5be9ed7 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -157,26 +157,25 @@ int cfg80211_validate_key_settings(struct key_params *params, int key_idx, params->cipher != WLAN_CIPHER_SUITE_WEP104) return -EINVAL; - /* TODO: add definitions for the lengths to linux/ieee80211.h */ switch (params->cipher) { case WLAN_CIPHER_SUITE_WEP40: - if (params->key_len != 5) + if (params->key_len != WLAN_KEY_LEN_WEP40) return -EINVAL; break; case WLAN_CIPHER_SUITE_TKIP: - if (params->key_len != 32) + if (params->key_len != WLAN_KEY_LEN_TKIP) return -EINVAL; break; case WLAN_CIPHER_SUITE_CCMP: - if (params->key_len != 16) + if (params->key_len != WLAN_KEY_LEN_CCMP) return -EINVAL; break; case WLAN_CIPHER_SUITE_WEP104: - if (params->key_len != 13) + if (params->key_len != WLAN_KEY_LEN_WEP104) return -EINVAL; break; case WLAN_CIPHER_SUITE_AES_CMAC: - if (params->key_len != 16) + if (params->key_len != WLAN_KEY_LEN_AES_CMAC) return -EINVAL; break; default: |