<string-array name="wifi_security">
<!-- The Wi-Fi network does not have any security. -->
<item>@string/wifi_security_none</item>
+ <item translatable="false">@string/wifi_security_owe</item>
<item translatable="false">@string/wifi_security_wep</item>
<item translatable="false">@string/wifi_security_psk_generic</item>
+ <item translatable="false">@string/wifi_security_sae</item>
<item translatable="false">@string/wifi_security_eap</item>
-
+ <item translatable="false">@string/wifi_security_eap_suiteb</item>
</string-array>
<!-- Match this with the constants in AccessPoint. --> <skip />
<item>@string/wifi_security_none</item>
<item translatable="false">@string/wifi_security_wep</item>
<item translatable="false">@string/wifi_security_psk_generic</item>
+ <item translatable="false">@string/wifi_security_sae</item>
</string-array>
<!-- Security types for wireless tether -->
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;
&& ((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)
} 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)) {
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
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();
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;
}
}
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;
}
}
}
- 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;
}
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);
}
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);
* 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
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;
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);
@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);
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");
}
}