Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290255
b: refs/heads/master
c: 4a8ce2f
h: refs/heads/master
i:
  290253: 7bb16c7
  290251: 99f9e51
  290247: 431419f
  290239: 98a6c60
v: v3
  • Loading branch information
Sujith Manoharan authored and Kalle Valo committed Jan 12, 2012
1 parent 96a00c3 commit 0c7d57d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 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: 866dc88607aa07f297eec7b504be58ca17d91a26
refs/heads/master: 4a8ce2fd055f8c117fb6fa6da39af8f62cbffe4b
31 changes: 15 additions & 16 deletions trunk/drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
struct ath6kl *ar = ath6kl_priv(ndev);
struct ath6kl_vif *vif = netdev_priv(ndev);
struct ath6kl_key *key = NULL;
int seq_len;
u8 key_usage;
u8 key_type;

Expand Down Expand Up @@ -1011,23 +1012,21 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
else
key_usage = GROUP_USAGE;

if (params) {
int seq_len = params->seq_len;
if (params->cipher == WLAN_CIPHER_SUITE_SMS4 &&
seq_len > ATH6KL_KEY_SEQ_LEN) {
/* Only first half of the WPI PN is configured */
seq_len = ATH6KL_KEY_SEQ_LEN;
}
if (params->key_len > WLAN_MAX_KEY_LEN ||
seq_len > sizeof(key->seq))
return -EINVAL;

key->key_len = params->key_len;
memcpy(key->key, params->key, key->key_len);
key->seq_len = seq_len;
memcpy(key->seq, params->seq, key->seq_len);
key->cipher = params->cipher;
seq_len = params->seq_len;
if (params->cipher == WLAN_CIPHER_SUITE_SMS4 &&
seq_len > ATH6KL_KEY_SEQ_LEN) {
/* Only first half of the WPI PN is configured */
seq_len = ATH6KL_KEY_SEQ_LEN;
}
if (params->key_len > WLAN_MAX_KEY_LEN ||
seq_len > sizeof(key->seq))
return -EINVAL;

key->key_len = params->key_len;
memcpy(key->key, params->key, key->key_len);
key->seq_len = seq_len;
memcpy(key->seq, params->seq, key->seq_len);
key->cipher = params->cipher;

switch (key->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
Expand Down

0 comments on commit 0c7d57d

Please sign in to comment.