提交 ccd0fda3 编写于 作者: J James Ketrenos 提交者: Jeff Garzik

[PATCH] ieee80211: Mixed PTK/GTK CCMP/TKIP support

tree 5c7559a1216ae1121487f6aed94a6017490729b3
parent c1ff4c22e5622c8987bf96c09158c4924cde98c2
author Hong Liu <hong.liu@intel.com> 1125482767 +0800
committer James Ketrenos <jketreno@linux.intel.com> 1127314427 -0500

Mixed PTK/GTK CCMP/TKIP support.
Signed-off-by: NHong Liu <hong.liu@intel.com>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 42c94e43
...@@ -851,6 +851,9 @@ struct ieee80211_device { ...@@ -851,6 +851,9 @@ struct ieee80211_device {
int host_encrypt; int host_encrypt;
int host_encrypt_msdu; int host_encrypt_msdu;
int host_decrypt; int host_decrypt;
/* host performs multicast decryption */
int host_mc_decrypt;
int host_open_frag; int host_open_frag;
int ieee802_1x; /* is IEEE 802.1X used */ int ieee802_1x; /* is IEEE 802.1X used */
......
...@@ -133,6 +133,8 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ...@@ -133,6 +133,8 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
/* Default to enabling full open WEP with host based encrypt/decrypt */ /* Default to enabling full open WEP with host based encrypt/decrypt */
ieee->host_encrypt = 1; ieee->host_encrypt = 1;
ieee->host_decrypt = 1; ieee->host_decrypt = 1;
ieee->host_mc_decrypt = 1;
/* Host fragementation in Open mode. Default is enabled. /* Host fragementation in Open mode. Default is enabled.
* Note: host fragmentation is always enabled if host encryption * Note: host fragmentation is always enabled if host encryption
* is enabled. For cards can do hardware encryption, they must do * is enabled. For cards can do hardware encryption, they must do
......
...@@ -409,7 +409,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -409,7 +409,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
return 1; return 1;
} }
if (ieee->host_decrypt) { if (is_multicast_ether_addr(hdr->addr1) ? ieee->host_mc_decrypt :
ieee->host_decrypt) {
int idx = 0; int idx = 0;
if (skb->len >= hdrlen + 3) if (skb->len >= hdrlen + 3)
idx = skb->data[hdrlen + 3] >> 6; idx = skb->data[hdrlen + 3] >> 6;
......
...@@ -493,6 +493,7 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, ...@@ -493,6 +493,7 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
struct iw_point *encoding = &wrqu->encoding; struct iw_point *encoding = &wrqu->encoding;
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
int i, idx, ret = 0; int i, idx, ret = 0;
int group_key = 0;
const char *alg, *module; const char *alg, *module;
struct ieee80211_crypto_ops *ops; struct ieee80211_crypto_ops *ops;
struct ieee80211_crypt_data **crypt; struct ieee80211_crypt_data **crypt;
...@@ -509,9 +510,10 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, ...@@ -509,9 +510,10 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
} else } else
idx = ieee->tx_keyidx; idx = ieee->tx_keyidx;
if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
crypt = &ieee->crypt[idx]; crypt = &ieee->crypt[idx];
else { group_key = 1;
} else {
if (idx != 0) if (idx != 0)
return -EINVAL; return -EINVAL;
if (ieee->iw_mode == IW_MODE_INFRA) if (ieee->iw_mode == IW_MODE_INFRA)
...@@ -542,7 +544,9 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, ...@@ -542,7 +544,9 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
sec.enabled = 1; sec.enabled = 1;
sec.encrypt = 1; sec.encrypt = 1;
if (!(ieee->host_encrypt || ieee->host_decrypt)) if (group_key ? !ieee->host_mc_decrypt :
!(ieee->host_encrypt || ieee->host_decrypt ||
ieee->host_encrypt_msdu))
goto skip_host_crypt; goto skip_host_crypt;
switch (ext->alg) { switch (ext->alg) {
...@@ -632,6 +636,9 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, ...@@ -632,6 +636,9 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
sec.flags |= SEC_LEVEL; sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_3; sec.level = SEC_LEVEL_3;
} }
/* Don't set sec level for group keys. */
if (group_key)
sec.flags &= ~SEC_LEVEL;
} }
done: done:
if (ieee->set_security) if (ieee->set_security)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册