Loading wifi/java/android/net/wifi/WifiConfiguration.java +2 −0 Original line number Diff line number Diff line Loading @@ -2554,6 +2554,8 @@ public class WifiConfiguration implements Parcelable { key = SSID + KeyMgmt.strings[KeyMgmt.WAPI_PSK]; } else if (allowedKeyManagement.get(KeyMgmt.WAPI_CERT)) { key = SSID + KeyMgmt.strings[KeyMgmt.WAPI_CERT]; } else if (allowedKeyManagement.get(KeyMgmt.OSEN)) { key = SSID + KeyMgmt.strings[KeyMgmt.OSEN]; } else { key = SSID + KeyMgmt.strings[KeyMgmt.NONE]; } Loading wifi/java/android/net/wifi/WifiEnterpriseConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -482,7 +482,7 @@ public class WifiEnterpriseConfig implements Parcelable { return false; } if (mEapMethod != Eap.TLS && mPhase2Method != Phase2.NONE) { if (mEapMethod != Eap.TLS && mEapMethod != Eap.UNAUTH_TLS && mPhase2Method != Phase2.NONE) { boolean is_autheap = mEapMethod == Eap.TTLS && mPhase2Method == Phase2.GTC; String prefix = is_autheap ? Phase2.AUTHEAP_PREFIX : Phase2.AUTH_PREFIX; String value = convertToQuotedString(prefix + Phase2.strings[mPhase2Method]); Loading wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -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()); } } Loading
wifi/java/android/net/wifi/WifiConfiguration.java +2 −0 Original line number Diff line number Diff line Loading @@ -2554,6 +2554,8 @@ public class WifiConfiguration implements Parcelable { key = SSID + KeyMgmt.strings[KeyMgmt.WAPI_PSK]; } else if (allowedKeyManagement.get(KeyMgmt.WAPI_CERT)) { key = SSID + KeyMgmt.strings[KeyMgmt.WAPI_CERT]; } else if (allowedKeyManagement.get(KeyMgmt.OSEN)) { key = SSID + KeyMgmt.strings[KeyMgmt.OSEN]; } else { key = SSID + KeyMgmt.strings[KeyMgmt.NONE]; } Loading
wifi/java/android/net/wifi/WifiEnterpriseConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -482,7 +482,7 @@ public class WifiEnterpriseConfig implements Parcelable { return false; } if (mEapMethod != Eap.TLS && mPhase2Method != Phase2.NONE) { if (mEapMethod != Eap.TLS && mEapMethod != Eap.UNAUTH_TLS && mPhase2Method != Phase2.NONE) { boolean is_autheap = mEapMethod == Eap.TTLS && mPhase2Method == Phase2.GTC; String prefix = is_autheap ? Phase2.AUTHEAP_PREFIX : Phase2.AUTH_PREFIX; String value = convertToQuotedString(prefix + Phase2.strings[mPhase2Method]); Loading
wifi/tests/src/android/net/wifi/WifiEnterpriseConfigTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -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()); } }