From bb2676abb394c9b4c236df5c3420140bbd8320f4 Mon Sep 17 00:00:00 2001 From: Daisuke Niwa Date: Wed, 27 Jun 2018 14:14:57 +0900 Subject: Skip Anonymous Identity check in SIM/AKA/AKA' networks The current code causes an issue that fast re-authentication identity is cleared when device re-connects to same AP. This is because when WifiStateMachine receives NETWORK_CONNECTION_EVENT, it doesn't update anonymousIdentity of mCurrentNetworkLocalConfigs. Hence isSameNetwork called by connectToNetwork returns false. And then network block in wpa_supplicant is removed and fast re-authentication identity (EAP state) is cleared. Since pseudonym identity is stored in anonymousIdentity field in case of EAP-SIM/AKA/AKA' network and it's frequently updated by server, skipping anonymousIdentity field comparison should not be a problem. Bug: 113952712 Test: Manual Test: Unit test Change-Id: I295f2489ab48022f95f2703e44ceb33fefcb3e1f --- .../android/server/wifi/WifiConfigurationUtilTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java index 7bb24371a..3774feca3 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java @@ -613,6 +613,21 @@ public class WifiConfigurationUtilTest { assertFalse(WifiConfigurationUtil.isSameNetwork(network1, network2)); } + /** + * Verify that WifiConfigurationUtil.isSameNetwork returns true when two WifiConfiguration + * objects have the different EAP anonymous(pseudonym) identity in EAP-SIM. + */ + @Test + public void testIsSameNetworkReturnsTrueOnDifferentEapAnonymousIdentityInEapSim() { + WifiConfiguration network1 = WifiConfigurationTestUtil.createEapNetwork(TEST_SSID); + WifiConfiguration network2 = WifiConfigurationTestUtil.createEapNetwork(TEST_SSID); + network1.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM); + network2.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM); + network1.enterpriseConfig.setAnonymousIdentity("Identity1"); + network2.enterpriseConfig.setAnonymousIdentity("Identity2"); + assertTrue(WifiConfigurationUtil.isSameNetwork(network1, network2)); + } + /** * Verify the instance of {@link android.net.wifi.WifiScanner.PnoSettings.PnoNetwork} created * for a EAP network using {@link WifiConfigurationUtil#createPnoNetwork(WifiConfiguration) -- cgit v1.2.3