Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150650
b: refs/heads/master
c: 8fc0fee
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jun 3, 2009
1 parent a086901 commit 91099ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 362a415dce2130b0e4cebfc8f8fbd8128baff308
refs/heads/master: 8fc0fee09245fe740d81aded36f4af6db1054015
1 change: 1 addition & 0 deletions trunk/include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ enum ieee80211_key_len {
WLAN_KEY_LEN_WEP104 = 13,
WLAN_KEY_LEN_CCMP = 16,
WLAN_KEY_LEN_TKIP = 32,
WLAN_KEY_LEN_AES_CMAC = 16,
};

/*
Expand Down
11 changes: 5 additions & 6 deletions trunk/net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 91099ca

Please sign in to comment.