mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtl8188eu: Remove dead code associated with WAPI
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
7c593a903d
commit
acda213bd2
16 changed files with 5 additions and 841 deletions
|
@ -1039,14 +1039,9 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
} else {
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if (strcmp(param->u.crypt.alg, "SMS4"))
|
||||
#endif
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(param->u.crypt.alg, "WEP") == 0)
|
||||
{
|
||||
|
@ -1179,78 +1174,8 @@ _func_enter_;
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) //adhoc mode
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if (strcmp(param->u.crypt.alg, "SMS4") == 0)
|
||||
{
|
||||
PRT_WAPI_T pWapiInfo = &padapter->wapiInfo;
|
||||
PRT_WAPI_STA_INFO pWapiSta;
|
||||
u8 WapiASUEPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ;
|
||||
u8 WapiAEPNInitialValueSrc[16] = {0x37,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ;
|
||||
u8 WapiAEMultiCastPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ;
|
||||
|
||||
if (param->u.crypt.set_tx == 1)
|
||||
{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if (_rtw_memcmp(pWapiSta->PeerMacAddr,param->sta_addr,6))
|
||||
{
|
||||
_rtw_memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16);
|
||||
|
||||
pWapiSta->wapiUsk.bSet = true;
|
||||
_rtw_memcpy(pWapiSta->wapiUsk.dataKey,param->u.crypt.key,16);
|
||||
_rtw_memcpy(pWapiSta->wapiUsk.micKey,param->u.crypt.key+16,16);
|
||||
pWapiSta->wapiUsk.keyId = param->u.crypt.idx ;
|
||||
pWapiSta->wapiUsk.bTxEnable = true;
|
||||
|
||||
_rtw_memcpy(pWapiSta->lastRxUnicastPNBEQueue,WapiAEPNInitialValueSrc,16);
|
||||
_rtw_memcpy(pWapiSta->lastRxUnicastPNBKQueue,WapiAEPNInitialValueSrc,16);
|
||||
_rtw_memcpy(pWapiSta->lastRxUnicastPNVIQueue,WapiAEPNInitialValueSrc,16);
|
||||
_rtw_memcpy(pWapiSta->lastRxUnicastPNVOQueue,WapiAEPNInitialValueSrc,16);
|
||||
_rtw_memcpy(pWapiSta->lastRxUnicastPN,WapiAEPNInitialValueSrc,16);
|
||||
pWapiSta->wapiUskUpdate.bTxEnable = false;
|
||||
pWapiSta->wapiUskUpdate.bSet = false;
|
||||
|
||||
if (psecuritypriv->sw_encrypt== false || psecuritypriv->sw_decrypt == false)
|
||||
{
|
||||
//set unicast key for ASUE
|
||||
rtw_wapi_set_key(padapter, &pWapiSta->wapiUsk, pWapiSta, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if (_rtw_memcmp(pWapiSta->PeerMacAddr,get_bssid(pmlmepriv),6))
|
||||
{
|
||||
pWapiSta->wapiMsk.bSet = true;
|
||||
_rtw_memcpy(pWapiSta->wapiMsk.dataKey,param->u.crypt.key,16);
|
||||
_rtw_memcpy(pWapiSta->wapiMsk.micKey,param->u.crypt.key+16,16);
|
||||
pWapiSta->wapiMsk.keyId = param->u.crypt.idx ;
|
||||
pWapiSta->wapiMsk.bTxEnable = false;
|
||||
if (!pWapiSta->bSetkeyOk)
|
||||
pWapiSta->bSetkeyOk = true;
|
||||
pWapiSta->bAuthenticateInProgress = false;
|
||||
|
||||
_rtw_memcpy(pWapiSta->lastRxMulticastPN, WapiAEMultiCastPNInitialValueSrc, 16);
|
||||
|
||||
if (psecuritypriv->sw_decrypt == false)
|
||||
{
|
||||
//set rx broadcast key for ASUE
|
||||
rtw_wapi_set_key(padapter, &pWapiSta->wapiMsk, pWapiSta, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
exit:
|
||||
|
||||
DBG_88E("%s, ret=%d\n", __func__, ret);
|
||||
|
@ -1311,23 +1236,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
|
|||
case WLAN_CIPHER_SUITE_CCMP:
|
||||
alg_name = "CCMP";
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
case WLAN_CIPHER_SUITE_SMS4:
|
||||
alg_name= "SMS4";
|
||||
if (pairwise == NL80211_KEYTYPE_PAIRWISE) {
|
||||
if (key_index != 0 && key_index != 1) {
|
||||
ret = -ENOTSUPP;
|
||||
goto addkey_end;
|
||||
}
|
||||
_rtw_memcpy((void*)param->sta_addr, (void*)mac_addr, ETH_ALEN);
|
||||
} else {
|
||||
DBG_88E("mac_addr is null\n");
|
||||
}
|
||||
DBG_88E("rtw_wx_set_enc_ext: SMS4 case\n");
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
ret = -ENOTSUPP;
|
||||
goto addkey_end;
|
||||
|
@ -2043,28 +1951,15 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
|
|||
|
||||
if (psecuritypriv->ndisauthtype>Ndis802_11AuthModeWPA)
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWAPI)
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_WAPI;
|
||||
#endif
|
||||
|
||||
break;
|
||||
case NL80211_AUTHTYPE_SHARED_KEY:
|
||||
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
|
||||
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
|
||||
//return -ENOTSUPP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 cipher, bool ucast)
|
||||
|
@ -2087,12 +1982,6 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph
|
|||
case IW_AUTH_CIPHER_NONE:
|
||||
*profile_cipher = _NO_PRIVACY_;
|
||||
ndisencryptstatus = Ndis802_11EncryptionDisabled;
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if (psecuritypriv->dot11PrivacyAlgrthm ==_SMS4_ )
|
||||
{
|
||||
*profile_cipher = _SMS4_;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case WLAN_CIPHER_SUITE_WEP40:
|
||||
*profile_cipher = _WEP40_;
|
||||
|
@ -2110,12 +1999,6 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph
|
|||
*profile_cipher = _AES_;
|
||||
ndisencryptstatus = Ndis802_11Encryption3Enabled;
|
||||
break;
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
case WLAN_CIPHER_SUITE_SMS4:
|
||||
*profile_cipher = _SMS4_;
|
||||
ndisencryptstatus = Ndis802_11_EncrypteionWAPI;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
DBG_88E("Unsupported cipher: 0x%x\n", cipher);
|
||||
return -ENOTSUPP;
|
||||
|
@ -2141,22 +2024,9 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key
|
|||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
else if (key_mgt == WLAN_AKM_SUITE_PSK) {
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
}
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
else if (key_mgt ==WLAN_AKM_SUITE_WAPI_PSK){
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_WAPI;
|
||||
}
|
||||
else if (key_mgt ==WLAN_AKM_SUITE_WAPI_CERT){
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_WAPI;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
else {
|
||||
} else {
|
||||
DBG_88E("Invalid key mgt: 0x%x\n", key_mgt);
|
||||
//return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2524,31 +2394,11 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
|||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; //open system
|
||||
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
padapter->wapiInfo.bWapiEnable = false;
|
||||
#endif
|
||||
|
||||
ret = rtw_cfg80211_set_wpa_version(psecuritypriv, sme->crypto.wpa_versions);
|
||||
if (ret < 0)
|
||||
goto exit;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if (sme->crypto.wpa_versions & NL80211_WAPI_VERSION_1)
|
||||
{
|
||||
padapter->wapiInfo.bWapiEnable = true;
|
||||
padapter->wapiInfo.extra_prefix_len = WAPI_EXT_LEN;
|
||||
padapter->wapiInfo.extra_postfix_len = SMS4_MIC_LEN;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = rtw_cfg80211_set_auth_type(psecuritypriv, sme->auth_type);
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_WAPI)
|
||||
padapter->mlmeextpriv.mlmext_info.auth_algo = psecuritypriv->dot11AuthAlgrthm;
|
||||
#endif
|
||||
|
||||
|
||||
if (ret < 0)
|
||||
goto exit;
|
||||
|
||||
|
@ -2636,15 +2486,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if (sme->crypto.akm_suites[0] ==WLAN_AKM_SUITE_WAPI_PSK){
|
||||
padapter->wapiInfo.bWapiPSK = true;
|
||||
}
|
||||
else if (sme->crypto.akm_suites[0] ==WLAN_AKM_SUITE_WAPI_CERT){
|
||||
padapter->wapiInfo.bWapiPSK = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
authmode = psecuritypriv->ndisauthtype;
|
||||
rtw_set_802_11_authentication_mode(padapter, authmode);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue