[OWE] Support OWE in transition mode

Support OWE in transition mode for devices with OWE support
and devices without OWE support. Scan results will return a
new type of network for OWE in transition networks on devices
that support OWE, and Open for devices that don't support OWE.
Handle the case where Open network is manually added to a device
that supports OWE.

Bug: 132139642
Test: Device with OWE: Connect to Open, OWE-Transition, OWE networks
Test: Device without OWE: Connect to Open, OWE-Transition
Test: Manually create Open network, connect to OWE-Transition
Change-Id: I1a584ccbfec8507803c527ea13933cff6f699ccb
This commit is contained in:
Hai Shalom
2019-05-13 15:31:58 -07:00
parent ff5fb3f2d4
commit 98aa52dbec
3 changed files with 22 additions and 7 deletions

View File

@@ -582,9 +582,11 @@ public class WifiConfigController implements TextWatcher,
} }
/** /**
* Special handling for WPA2/WPA3 in Transition mode: The key SECURITY_PSK_SAE_TRANSITION is * Special handling for WPA2/WPA3 and OWE in Transition mode: The key
* a pseudo key which results by the scan results, but never appears in the saved networks. * SECURITY_PSK_SAE_TRANSITION and SECURITY_OWE_TRANSITION are pseudo keys which result by the
* A saved network is either WPA3 for supporting devices or WPA2 for non-supporting devices. * scan results, but never appears in the saved networks.
* A saved network is either WPA3 for supporting devices or WPA2 for non-supporting devices,
* or, OWE for supporting devices or Open for non-supporting devices.
* *
* @param accessPointSecurity Access point current security type * @param accessPointSecurity Access point current security type
* @return Converted security type (if required) * @return Converted security type (if required)
@@ -597,6 +599,14 @@ public class WifiConfigController implements TextWatcher,
return AccessPoint.SECURITY_PSK; return AccessPoint.SECURITY_PSK;
} }
} }
if (accessPointSecurity == AccessPoint.SECURITY_OWE_TRANSITION) {
if (mWifiManager.isEnhancedOpenSupported()) {
return AccessPoint.SECURITY_OWE;
} else {
return AccessPoint.SECURITY_NONE;
}
}
return accessPointSecurity; return accessPointSecurity;
} }
@@ -948,7 +958,8 @@ public class WifiConfigController implements TextWatcher,
private void showSecurityFields() { private void showSecurityFields() {
if (mAccessPointSecurity == AccessPoint.SECURITY_NONE || if (mAccessPointSecurity == AccessPoint.SECURITY_NONE ||
mAccessPointSecurity == AccessPoint.SECURITY_OWE) { mAccessPointSecurity == AccessPoint.SECURITY_OWE ||
mAccessPointSecurity == AccessPoint.SECURITY_OWE_TRANSITION) {
mView.findViewById(R.id.security_fields).setVisibility(View.GONE); mView.findViewById(R.id.security_fields).setVisibility(View.GONE);
return; return;
} }

View File

@@ -494,7 +494,9 @@ public class WifiSettings extends RestrictedSettingsFragment
if (isSavedNetwork) { if (isSavedNetwork) {
connect(mSelectedAccessPoint.getConfig(), isSavedNetwork); connect(mSelectedAccessPoint.getConfig(), isSavedNetwork);
} else if ((mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) || } else if ((mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
(mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_OWE)) { (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_OWE) ||
(mSelectedAccessPoint.getSecurity()
== AccessPoint.SECURITY_OWE_TRANSITION)) {
/** Bypass dialog for unsecured networks */ /** Bypass dialog for unsecured networks */
mSelectedAccessPoint.generateOpenNetworkConfig(); mSelectedAccessPoint.generateOpenNetworkConfig();
connect(mSelectedAccessPoint.getConfig(), isSavedNetwork); connect(mSelectedAccessPoint.getConfig(), isSavedNetwork);
@@ -748,7 +750,8 @@ public class WifiSettings extends RestrictedSettingsFragment
preference.setOrder(index); preference.setOrder(index);
if (mOpenSsid != null && mOpenSsid.equals(accessPoint.getSsidStr()) if (mOpenSsid != null && mOpenSsid.equals(accessPoint.getSsidStr())
&& (accessPoint.getSecurity() != AccessPoint.SECURITY_NONE && && (accessPoint.getSecurity() != AccessPoint.SECURITY_NONE &&
accessPoint.getSecurity() != AccessPoint.SECURITY_OWE)) { accessPoint.getSecurity() != AccessPoint.SECURITY_OWE &&
accessPoint.getSecurity() != AccessPoint.SECURITY_OWE_TRANSITION)) {
if (!accessPoint.isSaved() || isDisabledByWrongPassword(accessPoint)) { if (!accessPoint.isSaved() || isDisabledByWrongPassword(accessPoint)) {
onPreferenceTreeClick(preference); onPreferenceTreeClick(preference);
mOpenSsid = null; mOpenSsid = null;

View File

@@ -268,7 +268,8 @@ public class WifiUtils {
if (accessPoint.isOsuProvider()) { if (accessPoint.isOsuProvider()) {
return CONNECT_TYPE_OSU_PROVISION; return CONNECT_TYPE_OSU_PROVISION;
} else if ((accessPoint.getSecurity() == AccessPoint.SECURITY_NONE) || } else if ((accessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
(accessPoint.getSecurity() == AccessPoint.SECURITY_OWE)) { (accessPoint.getSecurity() == AccessPoint.SECURITY_OWE) ||
(accessPoint.getSecurity() == AccessPoint.SECURITY_OWE_TRANSITION)) {
return CONNECT_TYPE_OPEN_NETWORK; return CONNECT_TYPE_OPEN_NETWORK;
} else if (accessPoint.isSaved() && config != null } else if (accessPoint.isSaved() && config != null
&& config.getNetworkSelectionStatus() != null && config.getNetworkSelectionStatus() != null