diff options
author | Nate Jiang <qiangjiang@google.com> | 2020-06-03 15:14:14 -0700 |
---|---|---|
committer | Nate Jiang <qiangjiang@google.com> | 2020-06-05 11:30:02 -0700 |
commit | cdd9dbff03f7c7712f68d80f67390a4f03001158 (patch) | |
tree | df7e6d2c4dabd252811f12f848b737909e35ba46 /service | |
parent | 590b4f71df5ffb5ef17da48e9d73b919de85b002 (diff) |
[Suggestion] block insecure Enterprise suggestion
Block adding and connecting to insecure Enterprise suggestion.
Bug: 157822251
Test: atest com.android.server.wifi
Change-Id: Ic0741df81a5b50b4e9f98e17d95262946a659118
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/NetworkSuggestionNominator.java | 5 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/NetworkSuggestionNominator.java b/service/java/com/android/server/wifi/NetworkSuggestionNominator.java index fbc1f5fdb..b174be5e0 100644 --- a/service/java/com/android/server/wifi/NetworkSuggestionNominator.java +++ b/service/java/com/android/server/wifi/NetworkSuggestionNominator.java @@ -145,6 +145,11 @@ public class NetworkSuggestionNominator implements WifiNetworkSelector.NetworkNo } Set<ExtendedWifiNetworkSuggestion> autojoinEnableSuggestions = new HashSet<>(); for (ExtendedWifiNetworkSuggestion ewns : matchingExtNetworkSuggestions) { + // Ignore insecure enterprise config. + if (ewns.wns.wifiConfiguration.isEnterprise() + && ewns.wns.wifiConfiguration.enterpriseConfig.isInsecure()) { + continue; + } // If untrusted network is not allowed, ignore untrusted suggestion. WifiConfiguration config = ewns.wns.wifiConfiguration; if (!untrustedNetworkAllowed && !config.trusted) { diff --git a/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java b/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java index 5d5a7d782..464ced0ad 100644 --- a/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java +++ b/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java @@ -993,6 +993,12 @@ public class WifiNetworkSuggestionsManager { WifiConfigurationUtil.VALIDATE_FOR_ADD)) { return false; } + if (wns.wifiConfiguration.isEnterprise() + && wns.wifiConfiguration.enterpriseConfig.isInsecure()) { + Log.e(TAG, "Insecure enterprise suggestion is invalid."); + return false; + } + } else { if (!wns.passpointConfiguration.validate()) { return false; |