From 6d37c0e7b156dc26b177858111eee2f33dad9582 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Thu, 1 Nov 2018 10:44:00 -0700 Subject: [Carrier Wi-Fi] Reset config identity on reboot or SIM in/out For Carrier Wi-Fi configurations reset the complete configuration identity - not just the anonymous identity. This will ensure that the encrypted identity is queried for and used for the EAP-SIM negotiations. Bug: 118818180 Test: atest frameworks/opt/net/wifi/tests/wifitests Test: integration/sanity testing passes, ref: b/119678669 Merged-In: I4ebf85a524473bf28ce2245b1e85ed933ba208c2 Change-Id: I4ebf85a524473bf28ce2245b1e85ed933ba208c2 --- .../com/android/server/wifi/WifiConfigManager.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index 0b70dbf4e..7dc938b34 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -2470,13 +2470,23 @@ public class WifiConfigManager { currentIdentity = TelephonyUtil.getSimIdentity(mTelephonyManager, new TelephonyUtil(), config); } + if (mVerboseLoggingEnabled) { + Log.d(TAG, "New identity for config " + config + ": " + currentIdentity); + } + // Update the loaded config if (currentIdentity == null) { - Log.d(TAG, "Identity is null"); - return; + Log.d(TAG, "Identity is null for config:" + config); + break; } - config.enterpriseConfig.setIdentity(currentIdentity.first); - if (config.enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.PEAP) { + + if (config.enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.PEAP) { + config.enterpriseConfig.setIdentity(currentIdentity.first); + // do not reset anonymous identity since it may be dependent on user-entry + // (i.e. cannot re-request on every reboot/SIM re-entry) + } else { + // reset identity as well: supplicant will ask us for it + config.enterpriseConfig.setIdentity(""); config.enterpriseConfig.setAnonymousIdentity(""); } } -- cgit v1.2.3