diff options
author | Hai Shalom <haishalom@google.com> | 2020-02-27 17:42:23 -0800 |
---|---|---|
committer | Hai Shalom <haishalom@google.com> | 2020-02-28 10:44:03 -0800 |
commit | 117cacc93f477feb6bbd56651bc6de5aece29ba9 (patch) | |
tree | 75d85efc615815cdec17445645a1de6534e8d47a /wifi/tests | |
parent | ef8cfa2a46ab4a81245b71d67e7d5020297715dd (diff) |
Fix KeyMgmt.OSEN and Eap.UNAUTH_TLS handling
Fix KeyMgmt.OSEN case in WifiConfiguration#getSsidAndSecurityTypeString
and return the correct key when key management type os OSEN.
Fix WifiEnterpriseconfig#saveToSupplicant when checking the
prerequisite conditions to save the network, Eap.UNAUTH_TLS does not
have a phase2 method.
Bug: 150418439
Test: atest WifiConfigurationTest WifiEnterpriseConfigTest
Change-Id: Iafb181c89530f67982541b07d0ac7a4e1eb3378a
Diffstat (limited to 'wifi/tests')
-rw-r--r-- | wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java b/wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java index d8db4ceb6e9c..320c187bbc2d 100644 --- a/wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java +++ b/wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java @@ -521,4 +521,23 @@ public class WifiEnterpriseConfigTest { // expected exception. } } + + /** Verifies that the EAP inner method is reset when we switch to Unauth-TLS */ + @Test + public void eapPhase2MethodForUnauthTls() { + // Initially select an EAP method that supports an phase2. + mEnterpriseConfig.setEapMethod(Eap.PEAP); + mEnterpriseConfig.setPhase2Method(Phase2.MSCHAPV2); + assertEquals("PEAP", getSupplicantEapMethod()); + assertEquals("\"auth=MSCHAPV2\"", getSupplicantPhase2Method()); + + // Change the EAP method to another type which supports a phase2. + mEnterpriseConfig.setEapMethod(Eap.TTLS); + assertEquals("TTLS", getSupplicantEapMethod()); + assertEquals("\"auth=MSCHAPV2\"", getSupplicantPhase2Method()); + + // Change the EAP method to Unauth-TLS which does not support a phase2. + mEnterpriseConfig.setEapMethod(Eap.UNAUTH_TLS); + assertEquals(null, getSupplicantPhase2Method()); + } } |