diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 94d915c965c..c3faabad9f9 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -215,10 +215,12 @@
- @string/wifi_security_none
+ - @string/wifi_security_owe
- @string/wifi_security_wep
- @string/wifi_security_psk_generic
+ - @string/wifi_security_sae
- @string/wifi_security_eap
-
+ - @string/wifi_security_eap_suiteb
@@ -228,6 +230,7 @@
- @string/wifi_security_none
- @string/wifi_security_wep
- @string/wifi_security_psk_generic
+ - @string/wifi_security_sae
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
index 4b93fc1796d..70837a6a810 100644
--- a/src/com/android/settings/wifi/WifiConfigController.java
+++ b/src/com/android/settings/wifi/WifiConfigController.java
@@ -454,6 +454,13 @@ public class WifiConfigController implements TextWatcher,
return false;
}
+ boolean isValidSaePassword(String password) {
+ if (password.length() >= 1 && password.length() <= 63) {
+ return true;
+ }
+ return false;
+ }
+
boolean isSubmittable() {
boolean enabled = false;
boolean passwordInvalid = false;
@@ -461,7 +468,9 @@ public class WifiConfigController implements TextWatcher,
&& ((mAccessPointSecurity == AccessPoint.SECURITY_WEP
&& mPasswordView.length() == 0)
|| (mAccessPointSecurity == AccessPoint.SECURITY_PSK
- && !isValidPsk(mPasswordView.getText().toString())))) {
+ && !isValidPsk(mPasswordView.getText().toString()))
+ || (mAccessPointSecurity == AccessPoint.SECURITY_SAE
+ && !isValidSaePassword(mPasswordView.getText().toString())))) {
passwordInvalid = true;
}
if ((mSsidView != null && mSsidView.length() == 0)
@@ -475,7 +484,9 @@ public class WifiConfigController implements TextWatcher,
} else {
enabled = ipAndProxyFieldsAreValid();
}
- if (mAccessPointSecurity == AccessPoint.SECURITY_EAP && mEapCaCertSpinner != null
+ if ((mAccessPointSecurity == AccessPoint.SECURITY_EAP ||
+ mAccessPointSecurity == AccessPoint.SECURITY_EAP_SUITE_B)
+ && mEapCaCertSpinner != null
&& mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
String caCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
if (caCertSelection.equals(mUnspecifiedCertString)) {
@@ -492,7 +503,9 @@ public class WifiConfigController implements TextWatcher,
enabled = false;
}
}
- if (mAccessPointSecurity == AccessPoint.SECURITY_EAP && mEapUserCertSpinner != null
+ if ((mAccessPointSecurity == AccessPoint.SECURITY_EAP ||
+ mAccessPointSecurity == AccessPoint.SECURITY_EAP_SUITE_B)
+ && mEapUserCertSpinner != null
&& mView.findViewById(R.id.l_user_cert).getVisibility() != View.GONE
&& mEapUserCertSpinner.getSelectedItem().equals(mUnspecifiedCertString)) {
// Disallow submit if the user has not selected a user certificate for an EAP network
@@ -590,8 +603,18 @@ public class WifiConfigController implements TextWatcher,
break;
case AccessPoint.SECURITY_EAP:
+ case AccessPoint.SECURITY_EAP_SUITE_B:
config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
config.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
+ if (mAccessPointSecurity == AccessPoint.SECURITY_EAP_SUITE_B) {
+ config.allowedKeyManagement.set(KeyMgmt.SUITE_B_192);
+ config.requirePMF = true;
+ config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
+ config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
+ config.allowedGroupMgmtCiphers.set(WifiConfiguration.GroupMgmtCipher
+ .BIP_GMAC_256);
+ config.allowedSuiteBCiphers.set(WifiConfiguration.SuiteBCipher.ECDHE_RSA);
+ }
config.enterpriseConfig = new WifiEnterpriseConfig();
int eapMethod = mEapMethodSpinner.getSelectedItemPosition();
int phase2Method = mPhase2Spinner.getSelectedItemPosition();
@@ -700,6 +723,20 @@ public class WifiConfigController implements TextWatcher,
config.enterpriseConfig.setPassword(mPasswordView.getText().toString());
}
break;
+ case AccessPoint.SECURITY_SAE:
+ config.allowedKeyManagement.set(KeyMgmt.SAE);
+ config.requirePMF = true;
+ if (mPasswordView.length() != 0) {
+ String password = mPasswordView.getText().toString();
+ config.preSharedKey = '"' + password + '"';
+ }
+ break;
+
+ case AccessPoint.SECURITY_OWE:
+ config.allowedKeyManagement.set(KeyMgmt.OWE);
+ config.requirePMF = true;
+ break;
+
default:
return null;
}
@@ -851,7 +888,8 @@ public class WifiConfigController implements TextWatcher,
}
private void showSecurityFields() {
- if (mAccessPointSecurity == AccessPoint.SECURITY_NONE) {
+ if (mAccessPointSecurity == AccessPoint.SECURITY_NONE ||
+ mAccessPointSecurity == AccessPoint.SECURITY_OWE) {
mView.findViewById(R.id.security_fields).setVisibility(View.GONE);
return;
}
@@ -870,7 +908,8 @@ public class WifiConfigController implements TextWatcher,
}
}
- if (mAccessPointSecurity != AccessPoint.SECURITY_EAP) {
+ if (mAccessPointSecurity != AccessPoint.SECURITY_EAP &&
+ mAccessPointSecurity != AccessPoint.SECURITY_EAP_SUITE_B) {
mView.findViewById(R.id.eap).setVisibility(View.GONE);
return;
}
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index f097d5b810c..1c9a5e136c0 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -488,7 +488,8 @@ public class WifiSettings extends RestrictedSettingsFragment
menu.add(Menu.NONE, MENU_ID_MODIFY, 0, R.string.wifi_menu_modify);
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(getActivity());
if (nfcAdapter != null && nfcAdapter.isEnabled() &&
- mSelectedAccessPoint.getSecurity() != AccessPoint.SECURITY_NONE) {
+ (!(mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
+ (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_OWE))) {
// Only allow writing of NFC tags for password-protected networks.
menu.add(Menu.NONE, MENU_ID_WRITE_NFC, 0, R.string.wifi_menu_write_to_nfc);
}
@@ -506,7 +507,8 @@ public class WifiSettings extends RestrictedSettingsFragment
boolean isSavedNetwork = mSelectedAccessPoint.isSaved();
if (isSavedNetwork) {
connect(mSelectedAccessPoint.getConfig(), isSavedNetwork);
- } else if (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) {
+ } else if ((mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
+ (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_OWE)) {
/** Bypass dialog for unsecured networks */
mSelectedAccessPoint.generateOpenNetworkConfig();
connect(mSelectedAccessPoint.getConfig(), isSavedNetwork);
@@ -552,7 +554,8 @@ public class WifiSettings extends RestrictedSettingsFragment
* networks, or Passpoint provided networks.
*/
WifiConfiguration config = mSelectedAccessPoint.getConfig();
- if (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) {
+ if ((mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
+ (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_OWE)) {
mSelectedAccessPoint.generateOpenNetworkConfig();
connect(mSelectedAccessPoint.getConfig(), mSelectedAccessPoint.isSaved());
} else if (mSelectedAccessPoint.isSaved() && config != null
@@ -772,7 +775,8 @@ public class WifiSettings extends RestrictedSettingsFragment
preference.setKey(key);
preference.setOrder(index);
if (mOpenSsid != null && mOpenSsid.equals(accessPoint.getSsidStr())
- && accessPoint.getSecurity() != AccessPoint.SECURITY_NONE) {
+ && (accessPoint.getSecurity() != AccessPoint.SECURITY_NONE &&
+ accessPoint.getSecurity() != AccessPoint.SECURITY_OWE)) {
if (!accessPoint.isSaved() || isDisabledByWrongPassword(accessPoint)) {
onPreferenceTreeClick(preference);
mOpenSsid = null;
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSecurityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSecurityPreferenceControllerTest.java
index f8131850fe3..e8d13dfe218 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSecurityPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSecurityPreferenceControllerTest.java
@@ -66,7 +66,7 @@ public class WifiTetherSecurityPreferenceControllerTest {
public void onPreferenceChange_securityValueUpdated() {
mController.onPreferenceChange(mPreference, WPA2_PSK);
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
- assertThat(mPreference.getSummary()).isEqualTo("WPA2 PSK");
+ assertThat(mPreference.getSummary()).isEqualTo("WPA2-Personal");
mController.onPreferenceChange(mPreference, NONE);
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.NONE);
@@ -75,11 +75,11 @@ public class WifiTetherSecurityPreferenceControllerTest {
@Test
public void updateDisplay_preferenceUpdated() {
- // test defaulting to WPA2 PSK on new config
+ // test defaulting to WPA2-Personal on new config
when(mWifiManager.getWifiApConfiguration()).thenReturn(null);
mController.updateDisplay();
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
- assertThat(mPreference.getSummary()).isEqualTo("WPA2 PSK");
+ assertThat(mPreference.getSummary()).isEqualTo("WPA2-Personal");
// test open tether network
when(mWifiManager.getWifiApConfiguration()).thenReturn(mConfig);
@@ -89,11 +89,11 @@ public class WifiTetherSecurityPreferenceControllerTest {
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.NONE);
assertThat(mPreference.getSummary()).isEqualTo("None");
- // test WPA2 PSK tether network
+ // test WPA2-Personal tether network
mConfig.allowedKeyManagement.clear();
mConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA2_PSK);
mController.updateDisplay();
assertThat(mController.getSecurityType()).isEqualTo(WifiConfiguration.KeyMgmt.WPA2_PSK);
- assertThat(mPreference.getSummary()).isEqualTo("WPA2 PSK");
+ assertThat(mPreference.getSummary()).isEqualTo("WPA2-Personal");
}
}