aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rndis_wlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r--drivers/net/wireless/rndis_wlan.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 98f6ff753d61..c254fdf446fd 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -405,6 +405,7 @@ struct rndis_wext_private {
405 int encr_tx_key_index; 405 int encr_tx_key_index;
406 char encr_keys[4][32]; 406 char encr_keys[4][32];
407 int encr_key_len[4]; 407 int encr_key_len[4];
408 char encr_key_wpa[4];
408 int wpa_version; 409 int wpa_version;
409 int wpa_keymgmt; 410 int wpa_keymgmt;
410 int wpa_authalg; 411 int wpa_authalg;
@@ -956,7 +957,7 @@ static int set_infra_mode(struct usbnet *usbdev, int mode)
956 if (priv->wpa_keymgmt == 0 || 957 if (priv->wpa_keymgmt == 0 ||
957 priv->wpa_keymgmt == IW_AUTH_KEY_MGMT_802_1X) { 958 priv->wpa_keymgmt == IW_AUTH_KEY_MGMT_802_1X) {
958 for (i = 0; i < 4; i++) { 959 for (i = 0; i < 4; i++) {
959 if (priv->encr_key_len[i] > 0) 960 if (priv->encr_key_len[i] > 0 && !priv->encr_key_wpa[i])
960 add_wep_key(usbdev, priv->encr_keys[i], 961 add_wep_key(usbdev, priv->encr_keys[i],
961 priv->encr_key_len[i], i); 962 priv->encr_key_len[i], i);
962 } 963 }
@@ -1027,6 +1028,7 @@ static int add_wep_key(struct usbnet *usbdev, char *key, int key_len, int index)
1027 } 1028 }
1028 1029
1029 priv->encr_key_len[index] = key_len; 1030 priv->encr_key_len[index] = key_len;
1031 priv->encr_key_wpa[index] = 0;
1030 memcpy(&priv->encr_keys[index], key, key_len); 1032 memcpy(&priv->encr_keys[index], key, key_len);
1031 1033
1032 return 0; 1034 return 0;
@@ -1092,7 +1094,8 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
1092 return ret; 1094 return ret;
1093 1095
1094 priv->encr_key_len[index] = key_len; 1096 priv->encr_key_len[index] = key_len;
1095 memcpy(&priv->encr_keys[index], ndis_key.material, key_len); 1097 priv->encr_key_wpa[index] = 1;
1098
1096 if (flags & ndis_80211_addkey_transmit_key) 1099 if (flags & ndis_80211_addkey_transmit_key)
1097 priv->encr_tx_key_index = index; 1100 priv->encr_tx_key_index = index;
1098 1101
@@ -1112,6 +1115,7 @@ static int remove_key(struct usbnet *usbdev, int index, u8 bssid[ETH_ALEN])
1112 return 0; 1115 return 0;
1113 1116
1114 priv->encr_key_len[index] = 0; 1117 priv->encr_key_len[index] = 0;
1118 priv->encr_key_wpa[index] = 0;
1115 memset(&priv->encr_keys[index], 0, sizeof(priv->encr_keys[index])); 1119 memset(&priv->encr_keys[index], 0, sizeof(priv->encr_keys[index]));
1116 1120
1117 if (priv->wpa_cipher_pair == IW_AUTH_CIPHER_TKIP || 1121 if (priv->wpa_cipher_pair == IW_AUTH_CIPHER_TKIP ||