diff options
author | David Su <dysu@google.com> | 2019-05-28 14:12:56 -0700 |
---|---|---|
committer | David Su <dysu@google.com> | 2019-05-29 16:22:31 -0700 |
commit | 84641ba60a4c3518e6b60cf7d44a09fc1e5b5f69 (patch) | |
tree | 368857d8979c685d2e8e1a32629178f1a256f401 /tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java | |
parent | 8fcc04c02b7dec0f6fa806944a21ed7a2074ca2b (diff) | |
download | android_frameworks_opt_net_wifi-84641ba60a4c3518e6b60cf7d44a09fc1e5b5f69.tar.gz android_frameworks_opt_net_wifi-84641ba60a4c3518e6b60cf7d44a09fc1e5b5f69.tar.bz2 android_frameworks_opt_net_wifi-84641ba60a4c3518e6b60cf7d44a09fc1e5b5f69.zip |
Fixed code setting anonymous_identity to anonymous@<realm>
Need to set anonymous@<realm> in enterprise config before
saving WifiConfiguration to WifiConfigManager.
Bug: 133431451
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: Manual
Change-Id: I2dcf85e6fdabd98fc15dc946ddf30a3d95297016
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java index 1837acb7d..597ccae7b 100644 --- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java @@ -1024,6 +1024,9 @@ public class ClientModeImplTest { when(mDataTelephonyManager.getSimState()).thenReturn(TelephonyManager.SIM_STATE_READY); String expectedAnonymousIdentity = TelephonyUtil.getAnonymousIdentityWith3GppRealm( mTelephonyManager); + // we are using anonymous@<realm> as our anonymous identity before connection + mConnectedNetwork.enterpriseConfig.setAnonymousIdentity(expectedAnonymousIdentity); + triggerConnect(); when(mCarrierNetworkConfig.isCarrierEncryptionInfoAvailable()).thenReturn(true); @@ -1038,6 +1041,10 @@ public class ClientModeImplTest { mCmi.sendMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, sBSSID); mLooper.dispatchAll(); + // verify that WifiNative#getEapAnonymousIdentity() was never called since we are using + // encrypted IMSI full authentication and not using pseudonym identity. + verify(mWifiNative, never()).getEapAnonymousIdentity(any()); + // check that the anonymous identity remains anonymous@<realm> for subsequent connections. assertEquals(expectedAnonymousIdentity, mConnectedNetwork.enterpriseConfig.getAnonymousIdentity()); } |