diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-06-08 16:57:02 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-06-08 16:57:02 +0000 |
commit | e565c0b697b0760443aceb02f9933e2a455da616 (patch) | |
tree | dbad16d54e43add3b130200ec817b768fc567e87 /service | |
parent | 1c683f1d21fa429de706f2397293e815b98e1ea2 (diff) | |
parent | cdd9dbff03f7c7712f68d80f67390a4f03001158 (diff) |
Merge "[Suggestion] block insecure Enterprise suggestion" into rvc-dev
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; |