From 78a2e373a3f20899f8f6ec3b493c1f8245af107d Mon Sep 17 00:00:00 2001 From: Sravanthi Palakonda Date: Thu, 19 Nov 2015 19:39:32 +0530 Subject: Do not add (anonymous) identity for EAP-SIM/AKA/AKA` networks. Improper identity configuration by the user while attempting to modify a network from other EAP types to EAP-SIM/AKA/AKA' results in a failed authentication. EAP-SIM/AKA/AKA' authentication mechanisms shall get the identity from either the telephony manager or the Modem ( EAP-PROXY), if the identity is not configured by the user. Thus , do not configure the identity for such networks. Change-Id: Iceda2323189c7a159de3f0b5d1df6931801a4040 CRs-Fixed: 941567 --- .../com/android/server/wifi/WifiConfigStore.java | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index b3ed8a633..103648f75 100644 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -2938,6 +2938,56 @@ public class WifiConfigStore extends IpConfigStore { // No need to save realm or PLMN in supplicant continue; } + if (key.equals(WifiEnterpriseConfig.IDENTITY_KEY)) { + if ((config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.SIM)|| + (config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.AKA)|| + (config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.AKA_PRIME)) { + if ( (!newNetwork) && (value != null) && !mWifiNative.setNetworkVariable( + netId, + key, + "NULL")) { + loge(config.SSID + ": failed to set " + key + + ": " + value); + break setVariables; + } + } else { + if (!mWifiNative.setNetworkVariable( + netId, + key, + value)) { + removeKeys(enterpriseConfig); + loge(config.SSID + ": failed to set " + key + + ": " + value); + break setVariables; + } + } + continue; + } + if (key.equals(WifiEnterpriseConfig.ANON_IDENTITY_KEY)) { + if ((config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.SIM)|| + (config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.AKA)|| + (config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.AKA_PRIME)) { + if ( (!newNetwork) && (value != null) && !mWifiNative.setNetworkVariable( + netId, + key, + "NULL")) { + loge(config.SSID + ": failed to set " + key + + ": " + value); + break setVariables; + } + } else { + if (!mWifiNative.setNetworkVariable( + netId, + key, + value)) { + removeKeys(enterpriseConfig); + loge(config.SSID + ": failed to set " + key + + ": " + value); + break setVariables; + } + } + continue; + } if (!((newNetwork == false) && (savedValue != null) && (value != null) && value.equals(savedValue)) && !mWifiNative.setNetworkVariable( -- cgit v1.2.3