Commit 55db5d02 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use keyparms->cipher to set WEP size

We already know which type of WEP we are using when we get here, no
point trying to determine it from key_len.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f84f97fd
...@@ -577,13 +577,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, ...@@ -577,13 +577,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
psecuritypriv->ndisencryptstatus = psecuritypriv->ndisencryptstatus =
Ndis802_11Encryption1Enabled; Ndis802_11Encryption1Enabled;
psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40; psecuritypriv->dot11PrivacyAlgrthm = keyparms->cipher;
psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; psecuritypriv->dot118021XGrpPrivacy = keyparms->cipher;
if (key_len == 13) {
psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104;
psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104;
}
psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx;
} }
...@@ -596,7 +591,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, ...@@ -596,7 +591,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
set_wep_key(padapter, keyparms->key, key_len, wep_key_idx); set_wep_key(padapter, keyparms->key, key_len, wep_key_idx);
goto exit; goto exit;
} }
if (!psta) { /* group key */ if (!psta) { /* group key */
...@@ -610,12 +604,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, ...@@ -610,12 +604,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
skey, keyparms->key, skey, keyparms->key,
(key_len > 16 ? 16 : key_len)); (key_len > 16 ? 16 : key_len));
psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40; psecuritypriv->dot118021XGrpPrivacy =
if (key_len == 13) { keyparms->cipher;
psecuritypriv->dot118021XGrpPrivacy =
WLAN_CIPHER_SUITE_WEP104;
}
} else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) {
DBG_8723A("%s, set group_key, TKIP\n", DBG_8723A("%s, set group_key, TKIP\n",
__func__); __func__);
...@@ -698,12 +688,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, ...@@ -698,12 +688,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
DBG_8723A("%s, set pairwise key, WEP\n", DBG_8723A("%s, set pairwise key, WEP\n",
__func__); __func__);
psta->dot118021XPrivacy = psecuritypriv->dot118021XGrpPrivacy =
WLAN_CIPHER_SUITE_WEP40; keyparms->cipher;
if (key_len == 13) {
psta->dot118021XPrivacy =
WLAN_CIPHER_SUITE_WEP104;
}
} else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) {
DBG_8723A("%s, set pairwise key, TKIP\n", DBG_8723A("%s, set pairwise key, TKIP\n",
__func__); __func__);
...@@ -748,11 +734,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, ...@@ -748,11 +734,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
(key_len > 16 ? 16 : key_len)); (key_len > 16 ? 16 : key_len));
psecuritypriv->dot118021XGrpPrivacy = psecuritypriv->dot118021XGrpPrivacy =
WLAN_CIPHER_SUITE_WEP40; keyparms->cipher;
if (key_len == 13) {
psecuritypriv->dot118021XGrpPrivacy =
WLAN_CIPHER_SUITE_WEP104;
}
} else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { } else if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) {
psecuritypriv->dot118021XGrpPrivacy = psecuritypriv->dot118021XGrpPrivacy =
WLAN_CIPHER_SUITE_TKIP; WLAN_CIPHER_SUITE_TKIP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment