diff options
author | Dan Williams <dcbw@redhat.com> | 2007-05-25 23:01:24 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:44 -0400 |
commit | 90a42210f275e1f828eb6c08bf8252c2d6a774e0 (patch) | |
tree | 7530def8af573622c4d2a3223eb8774ee76a0405 /drivers/net/wireless/libertas/cmd.c | |
parent | 45f43de829981e9b9de56d6098d00d511b4fb56c (diff) |
[PATCH] libertas: Make WPA work through supplicant handshake
Fix WPA so it works up through the supplicant 4-Way handshake process.
Doesn't successfully pass traffic yet; may be problems installing
the GTK to the firmware.
- RSN needs to be enabled before the association command is sent
- Use keys from the association request not the adapter structure
- cmd_act_mac_strict_protection_enable != IW_AUTH_DROP_UNENCRYPTED
- Fix network filtering logic in is_network_compatible() WPA helpers
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 53ac28e3ecaf..8da788e2ecf9 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -232,22 +232,25 @@ done: | |||
232 | 232 | ||
233 | static int wlan_cmd_802_11_enable_rsn(wlan_private * priv, | 233 | static int wlan_cmd_802_11_enable_rsn(wlan_private * priv, |
234 | struct cmd_ds_command *cmd, | 234 | struct cmd_ds_command *cmd, |
235 | u16 cmd_action) | 235 | u16 cmd_action, |
236 | void * pdata_buf) | ||
236 | { | 237 | { |
237 | struct cmd_ds_802_11_enable_rsn *penableRSN = &cmd->params.enbrsn; | 238 | struct cmd_ds_802_11_enable_rsn *penableRSN = &cmd->params.enbrsn; |
238 | wlan_adapter *adapter = priv->adapter; | 239 | struct assoc_request * assoc_req = pdata_buf; |
240 | |||
241 | lbs_deb_enter(LBS_DEB_CMD); | ||
239 | 242 | ||
240 | cmd->command = cpu_to_le16(cmd_802_11_enable_rsn); | 243 | cmd->command = cpu_to_le16(cmd_802_11_enable_rsn); |
241 | cmd->size = | 244 | cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_enable_rsn) + |
242 | cpu_to_le16(sizeof(struct cmd_ds_802_11_enable_rsn) + | 245 | S_DS_GEN); |
243 | S_DS_GEN); | ||
244 | penableRSN->action = cpu_to_le16(cmd_action); | 246 | penableRSN->action = cpu_to_le16(cmd_action); |
245 | if (adapter->secinfo.WPAenabled || adapter->secinfo.WPA2enabled) { | 247 | if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { |
246 | penableRSN->enable = cpu_to_le16(cmd_enable_rsn); | 248 | penableRSN->enable = cpu_to_le16(cmd_enable_rsn); |
247 | } else { | 249 | } else { |
248 | penableRSN->enable = cpu_to_le16(cmd_disable_rsn); | 250 | penableRSN->enable = cpu_to_le16(cmd_disable_rsn); |
249 | } | 251 | } |
250 | 252 | ||
253 | lbs_deb_leave(LBS_DEB_CMD); | ||
251 | return 0; | 254 | return 0; |
252 | } | 255 | } |
253 | 256 | ||
@@ -258,14 +261,12 @@ static void set_one_wpa_key(struct MrvlIEtype_keyParamSet * pkeyparamset, | |||
258 | pkeyparamset->keytypeid = cpu_to_le16(pkey->type); | 261 | pkeyparamset->keytypeid = cpu_to_le16(pkey->type); |
259 | 262 | ||
260 | if (pkey->flags & KEY_INFO_WPA_ENABLED) { | 263 | if (pkey->flags & KEY_INFO_WPA_ENABLED) { |
261 | pkeyparamset->keyinfo = cpu_to_le16(KEY_INFO_WPA_ENABLED); | 264 | pkeyparamset->keyinfo |= cpu_to_le16(KEY_INFO_WPA_ENABLED); |
262 | } else { | ||
263 | pkeyparamset->keyinfo = cpu_to_le16(!KEY_INFO_WPA_ENABLED); | ||
264 | } | 265 | } |
265 | |||
266 | if (pkey->flags & KEY_INFO_WPA_UNICAST) { | 266 | if (pkey->flags & KEY_INFO_WPA_UNICAST) { |
267 | pkeyparamset->keyinfo |= cpu_to_le16(KEY_INFO_WPA_UNICAST); | 267 | pkeyparamset->keyinfo |= cpu_to_le16(KEY_INFO_WPA_UNICAST); |
268 | } else if (pkey->flags & KEY_INFO_WPA_MCAST) { | 268 | } |
269 | if (pkey->flags & KEY_INFO_WPA_MCAST) { | ||
269 | pkeyparamset->keyinfo |= cpu_to_le16(KEY_INFO_WPA_MCAST); | 270 | pkeyparamset->keyinfo |= cpu_to_le16(KEY_INFO_WPA_MCAST); |
270 | } | 271 | } |
271 | 272 | ||
@@ -283,9 +284,9 @@ static int wlan_cmd_802_11_key_material(wlan_private * priv, | |||
283 | u16 cmd_action, | 284 | u16 cmd_action, |
284 | u32 cmd_oid, void *pdata_buf) | 285 | u32 cmd_oid, void *pdata_buf) |
285 | { | 286 | { |
286 | wlan_adapter *adapter = priv->adapter; | ||
287 | struct cmd_ds_802_11_key_material *pkeymaterial = | 287 | struct cmd_ds_802_11_key_material *pkeymaterial = |
288 | &cmd->params.keymaterial; | 288 | &cmd->params.keymaterial; |
289 | struct assoc_request * assoc_req = pdata_buf; | ||
289 | int ret = 0; | 290 | int ret = 0; |
290 | int index = 0; | 291 | int index = 0; |
291 | 292 | ||
@@ -295,29 +296,28 @@ static int wlan_cmd_802_11_key_material(wlan_private * priv, | |||
295 | pkeymaterial->action = cpu_to_le16(cmd_action); | 296 | pkeymaterial->action = cpu_to_le16(cmd_action); |
296 | 297 | ||
297 | if (cmd_action == cmd_act_get) { | 298 | if (cmd_action == cmd_act_get) { |
298 | cmd->size = cpu_to_le16( S_DS_GEN | 299 | cmd->size = cpu_to_le16(S_DS_GEN + sizeof (pkeymaterial->action)); |
299 | + sizeof (pkeymaterial->action)); | ||
300 | ret = 0; | 300 | ret = 0; |
301 | goto done; | 301 | goto done; |
302 | } | 302 | } |
303 | 303 | ||
304 | memset(&pkeymaterial->keyParamSet, 0, sizeof(pkeymaterial->keyParamSet)); | 304 | memset(&pkeymaterial->keyParamSet, 0, sizeof(pkeymaterial->keyParamSet)); |
305 | 305 | ||
306 | if (adapter->wpa_unicast_key.len) { | 306 | if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { |
307 | set_one_wpa_key(&pkeymaterial->keyParamSet[index], | 307 | set_one_wpa_key(&pkeymaterial->keyParamSet[index], |
308 | &adapter->wpa_unicast_key); | 308 | &assoc_req->wpa_unicast_key); |
309 | index++; | 309 | index++; |
310 | } | 310 | } |
311 | 311 | ||
312 | if (adapter->wpa_mcast_key.len) { | 312 | if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { |
313 | set_one_wpa_key(&pkeymaterial->keyParamSet[index], | 313 | set_one_wpa_key(&pkeymaterial->keyParamSet[index], |
314 | &adapter->wpa_mcast_key); | 314 | &assoc_req->wpa_mcast_key); |
315 | index++; | 315 | index++; |
316 | } | 316 | } |
317 | 317 | ||
318 | cmd->size = cpu_to_le16( S_DS_GEN | 318 | cmd->size = cpu_to_le16( S_DS_GEN |
319 | + sizeof (pkeymaterial->action) | 319 | + sizeof (pkeymaterial->action) |
320 | + index * sizeof(struct MrvlIEtype_keyParamSet)); | 320 | + (index * sizeof(struct MrvlIEtype_keyParamSet))); |
321 | 321 | ||
322 | ret = 0; | 322 | ret = 0; |
323 | 323 | ||
@@ -1302,13 +1302,13 @@ int libertas_prepare_and_send_command(wlan_private * priv, | |||
1302 | break; | 1302 | break; |
1303 | 1303 | ||
1304 | case cmd_802_11_enable_rsn: | 1304 | case cmd_802_11_enable_rsn: |
1305 | ret = wlan_cmd_802_11_enable_rsn(priv, cmdptr, cmd_action); | 1305 | ret = wlan_cmd_802_11_enable_rsn(priv, cmdptr, cmd_action, |
1306 | pdata_buf); | ||
1306 | break; | 1307 | break; |
1307 | 1308 | ||
1308 | case cmd_802_11_key_material: | 1309 | case cmd_802_11_key_material: |
1309 | ret = wlan_cmd_802_11_key_material(priv, cmdptr, | 1310 | ret = wlan_cmd_802_11_key_material(priv, cmdptr, cmd_action, |
1310 | cmd_action, cmd_oid, | 1311 | cmd_oid, pdata_buf); |
1311 | pdata_buf); | ||
1312 | break; | 1312 | break; |
1313 | 1313 | ||
1314 | case cmd_802_11_pairwise_tsc: | 1314 | case cmd_802_11_pairwise_tsc: |