Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
1fbfea54
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1fbfea54
编写于
8月 05, 2005
作者:
Z
Zhu Yi
提交者:
James Ketrenos
11月 07, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Bug 792] Fix WPA-PSK AES both for -Dipw and -Dwext.
Signed-off-by:
N
Zhu Yi
<
yi.zhu@intel.com
>
上级
e402c937
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
125 addition
and
16 deletion
+125
-16
drivers/net/wireless/ipw2200.c
drivers/net/wireless/ipw2200.c
+125
-16
未找到文件。
drivers/net/wireless/ipw2200.c
浏览文件 @
1fbfea54
...
...
@@ -5557,6 +5557,55 @@ static void ipw_send_wep_keys(struct ipw_priv *priv, int type)
}
}
static
void
ipw_set_hw_decrypt_unicast
(
struct
ipw_priv
*
priv
,
int
level
)
{
if
(
priv
->
ieee
->
host_encrypt
)
return
;
switch
(
level
)
{
case
SEC_LEVEL_3
:
priv
->
sys_config
.
disable_unicast_decryption
=
0
;
priv
->
ieee
->
host_decrypt
=
0
;
break
;
case
SEC_LEVEL_2
:
priv
->
sys_config
.
disable_unicast_decryption
=
1
;
priv
->
ieee
->
host_decrypt
=
1
;
break
;
case
SEC_LEVEL_1
:
priv
->
sys_config
.
disable_unicast_decryption
=
0
;
priv
->
ieee
->
host_decrypt
=
0
;
break
;
case
SEC_LEVEL_0
:
priv
->
sys_config
.
disable_unicast_decryption
=
1
;
break
;
default:
break
;
}
}
static
void
ipw_set_hw_decrypt_multicast
(
struct
ipw_priv
*
priv
,
int
level
)
{
if
(
priv
->
ieee
->
host_encrypt
)
return
;
switch
(
level
)
{
case
SEC_LEVEL_3
:
priv
->
sys_config
.
disable_multicast_decryption
=
0
;
break
;
case
SEC_LEVEL_2
:
priv
->
sys_config
.
disable_multicast_decryption
=
1
;
break
;
case
SEC_LEVEL_1
:
priv
->
sys_config
.
disable_multicast_decryption
=
0
;
break
;
case
SEC_LEVEL_0
:
priv
->
sys_config
.
disable_multicast_decryption
=
1
;
break
;
default:
break
;
}
}
static
void
ipw_set_hwcrypto_keys
(
struct
ipw_priv
*
priv
)
{
switch
(
priv
->
ieee
->
sec
.
level
)
{
...
...
@@ -5567,33 +5616,23 @@ static void ipw_set_hwcrypto_keys(struct ipw_priv *priv)
priv
->
ieee
->
sec
.
active_key
);
ipw_send_wep_keys
(
priv
,
DCW_WEP_KEY_SEC_TYPE_CCM
);
priv
->
sys_config
.
disable_unicast_decryption
=
0
;
priv
->
sys_config
.
disable_multicast_decryption
=
0
;
priv
->
ieee
->
host_decrypt
=
0
;
break
;
case
SEC_LEVEL_2
:
if
(
priv
->
ieee
->
sec
.
flags
&
SEC_ACTIVE_KEY
)
ipw_send_tgi_tx_key
(
priv
,
DCT_FLAG_EXT_SECURITY_TKIP
,
priv
->
ieee
->
sec
.
active_key
);
priv
->
sys_config
.
disable_unicast_decryption
=
1
;
priv
->
sys_config
.
disable_multicast_decryption
=
1
;
priv
->
ieee
->
host_decrypt
=
1
;
break
;
case
SEC_LEVEL_1
:
ipw_send_wep_keys
(
priv
,
DCW_WEP_KEY_SEC_TYPE_WEP
);
priv
->
sys_config
.
disable_unicast_decryption
=
0
;
priv
->
sys_config
.
disable_multicast_decryption
=
0
;
priv
->
ieee
->
host_decrypt
=
0
;
break
;
case
SEC_LEVEL_0
:
priv
->
sys_config
.
disable_unicast_decryption
=
1
;
priv
->
sys_config
.
disable_multicast_decryption
=
1
;
break
;
default:
break
;
}
ipw_set_hw_decrypt_unicast
(
priv
,
priv
->
ieee
->
sec
.
level
);
ipw_set_hw_decrypt_multicast
(
priv
,
priv
->
ieee
->
sec
.
level
);
}
static
void
ipw_adhoc_check
(
void
*
data
)
...
...
@@ -6185,12 +6224,31 @@ static int ipw_wpa_mlme(struct net_device *dev, int command, int reason)
return
ret
;
}
static
int
ipw_wpa_ie_cipher2level
(
u8
cipher
)
{
switch
(
cipher
)
{
case
4
:
/* CCMP */
return
SEC_LEVEL_3
;
case
2
:
/* TKIP */
return
SEC_LEVEL_2
;
case
5
:
/* WEP104 */
case
1
:
/* WEP40 */
return
SEC_LEVEL_1
;
case
0
:
/* NONE */
return
SEC_LEVEL_0
;
default:
return
-
1
;
}
}
static
int
ipw_wpa_set_wpa_ie
(
struct
net_device
*
dev
,
struct
ipw_param
*
param
,
int
plen
)
{
struct
ipw_priv
*
priv
=
ieee80211_priv
(
dev
);
struct
ieee80211_device
*
ieee
=
priv
->
ieee
;
u8
*
buf
;
u8
*
ptk
,
*
gtk
;
int
level
;
if
(
param
->
u
.
wpa_ie
.
len
>
MAX_WPA_IE_LEN
||
(
param
->
u
.
wpa_ie
.
len
&&
param
->
u
.
wpa_ie
.
data
==
NULL
))
...
...
@@ -6209,8 +6267,35 @@ static int ipw_wpa_set_wpa_ie(struct net_device *dev,
kfree
(
ieee
->
wpa_ie
);
ieee
->
wpa_ie
=
NULL
;
ieee
->
wpa_ie_len
=
0
;
goto
done
;
}
if
(
priv
->
ieee
->
host_encrypt
)
goto
done
;
/* HACK: Parse wpa_ie here to get pairwise suite, otherwise
* we need to change driver_ipw.c from wpa_supplicant. This
* is OK since -Dipw is deprecated. The -Dwext driver has a
* clean way to handle this. */
gtk
=
ptk
=
(
u8
*
)
ieee
->
wpa_ie
;
if
(
ieee
->
wpa_ie
[
0
]
==
0x30
)
{
/* RSN IE */
gtk
+=
4
+
3
;
ptk
+=
4
+
4
+
2
+
3
;
}
else
{
/* WPA IE */
gtk
+=
8
+
3
;
ptk
+=
8
+
4
+
2
+
3
;
}
if
(
ptk
-
(
u8
*
)
ieee
->
wpa_ie
>
ieee
->
wpa_ie_len
)
return
-
EINVAL
;
level
=
ipw_wpa_ie_cipher2level
(
*
gtk
);
ipw_set_hw_decrypt_multicast
(
priv
,
level
);
level
=
ipw_wpa_ie_cipher2level
(
*
ptk
);
ipw_set_hw_decrypt_unicast
(
priv
,
level
);
done:
ipw_wpa_assoc_frame
(
priv
,
ieee
->
wpa_ie
,
ieee
->
wpa_ie_len
);
return
0
;
}
...
...
@@ -6510,6 +6595,23 @@ static int ipw_wx_get_genie(struct net_device *dev,
return
err
;
}
static
int
wext_cipher2level
(
int
cipher
)
{
switch
(
cipher
)
{
case
IW_AUTH_CIPHER_NONE
:
return
SEC_LEVEL_0
;
case
IW_AUTH_CIPHER_WEP40
:
case
IW_AUTH_CIPHER_WEP104
:
return
SEC_LEVEL_1
;
case
IW_AUTH_CIPHER_TKIP
:
return
SEC_LEVEL_2
;
case
IW_AUTH_CIPHER_CCMP
:
return
SEC_LEVEL_3
;
default:
return
-
1
;
}
}
/* SIOCSIWAUTH */
static
int
ipw_wx_set_auth
(
struct
net_device
*
dev
,
struct
iw_request_info
*
info
,
...
...
@@ -6524,8 +6626,15 @@ static int ipw_wx_set_auth(struct net_device *dev,
switch
(
param
->
flags
&
IW_AUTH_INDEX
)
{
case
IW_AUTH_WPA_VERSION
:
break
;
case
IW_AUTH_CIPHER_PAIRWISE
:
ipw_set_hw_decrypt_unicast
(
priv
,
wext_cipher2level
(
param
->
value
));
break
;
case
IW_AUTH_CIPHER_GROUP
:
ipw_set_hw_decrypt_multicast
(
priv
,
wext_cipher2level
(
param
->
value
));
break
;
case
IW_AUTH_KEY_MGMT
:
/*
* ipw2200 does not use these parameters
...
...
@@ -10256,11 +10365,11 @@ static void shim__set_security(struct net_device *dev,
priv
->
ieee
->
sec
.
level
=
sec
->
level
;
priv
->
ieee
->
sec
.
flags
|=
SEC_LEVEL
;
priv
->
status
|=
STATUS_SECURITY_UPDATED
;
if
(
!
priv
->
ieee
->
host_encrypt
&&
(
sec
->
flags
&
SEC_ENCRYPT
))
ipw_set_hwcrypto_keys
(
priv
);
}
if
(
!
priv
->
ieee
->
host_encrypt
&&
(
sec
->
flags
&
SEC_ENCRYPT
))
ipw_set_hwcrypto_keys
(
priv
);
/* To match current functionality of ipw2100 (which works well w/
* various supplicants, we don't force a disassociate if the
* privacy capability changes ... */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录