summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorAhmed ElArabawy <arabawy@google.com>2018-03-24 13:43:16 -0700
committerAhmed ElArabawy <arabawy@google.com>2018-03-28 16:15:03 -0700
commita7e4dbab8c8cb4a024b8170c626f526ef322c818 (patch)
tree73ec76857bb4f9caf6b8379af0a0d8d707c6acc6 /service
parent99bd045d59f402efa3c3b157a6b2176a9fde8944 (diff)
WifiStateMachine: Act on reported EapFailure error
This commit acts on the EAP Failure error code recieved from wpa_supplicant. The receipt of AUTHENTICATION_FAILURE_EVENT with reason ERROR_AUTH_FAILIRE_EAP_FAILURE will trigger connect mode to check the error code, and if it matches the vendor specific code for certificate expiry, it will call into TelephonyManager to trigger the download of a new certificate. Bug: 64612561 Test: Unit Test Test: Regression Test Change-Id: I52b0a53504f2e50e91c0f19d987736d08699550c Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index b24d89519..c30af3c99 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -4306,8 +4306,9 @@ public class WifiStateMachine extends StateMachine {
mSupplicantStateTracker.sendMessage(WifiMonitor.AUTHENTICATION_FAILURE_EVENT);
int disableReason = WifiConfiguration.NetworkSelectionStatus
.DISABLED_AUTHENTICATION_FAILURE;
+ reasonCode = message.arg1;
// Check if this is a permanent wrong password failure.
- if (isPermanentWrongPasswordFailure(mTargetNetworkId, message.arg1)) {
+ if (isPermanentWrongPasswordFailure(mTargetNetworkId, reasonCode)) {
disableReason = WifiConfiguration.NetworkSelectionStatus
.DISABLED_BY_WRONG_PASSWORD;
WifiConfiguration targetedNetwork =
@@ -4316,6 +4317,8 @@ public class WifiStateMachine extends StateMachine {
mWrongPasswordNotifier.onWrongPasswordError(
targetedNetwork.SSID);
}
+ } else if (reasonCode == WifiManager.ERROR_AUTH_FAILURE_EAP_FAILURE) {
+ handleEapAuthFailure(mTargetNetworkId, message.arg2);
}
mWifiConfigManager.updateNetworkSelectionStatus(
mTargetNetworkId, disableReason);
@@ -4846,6 +4849,25 @@ public class WifiStateMachine extends StateMachine {
return TextUtils.equals(config.FQDN, providerFqdn);
}
+ private void handleEapAuthFailure(int networkId, int errorCode) {
+ WifiConfiguration targetedNetwork =
+ mWifiConfigManager.getConfiguredNetwork(mTargetNetworkId);
+ if (targetedNetwork != null) {
+ switch (targetedNetwork.enterpriseConfig.getEapMethod()) {
+ case WifiEnterpriseConfig.Eap.SIM:
+ case WifiEnterpriseConfig.Eap.AKA:
+ case WifiEnterpriseConfig.Eap.AKA_PRIME:
+ if (errorCode == WifiNative.EAP_SIM_VENDOR_SPECIFIC_CERT_EXPIRED) {
+ getTelephonyManager().resetCarrierKeysForImsiEncryption();
+ }
+ break;
+
+ default:
+ // Do Nothing
+ }
+ }
+ }
+
private class WifiNetworkAgent extends NetworkAgent {
public WifiNetworkAgent(Looper l, Context c, String TAG, NetworkInfo ni,
NetworkCapabilities nc, LinkProperties lp, int score, NetworkMisc misc) {