summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2014-02-25 10:12:35 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-25 10:12:35 -0800
commit1f9ebc5fa73e7d324429a697cd10abb3761b1ff0 (patch)
tree0ddd7582291ff41f44500e72c572a31dcf1f9b21 /services
parent26c6c15f54231c154bb2f7febb053d034cbe40c5 (diff)
parent868d4c341034de6e2ebb6c1a247488b00d17c78d (diff)
downloadframeworks_base-1f9ebc5fa73e7d324429a697cd10abb3761b1ff0.zip
frameworks_base-1f9ebc5fa73e7d324429a697cd10abb3761b1ff0.tar.gz
frameworks_base-1f9ebc5fa73e7d324429a697cd10abb3761b1ff0.tar.bz2
am 868d4c34: am 95023066: DO NOT MERGE Sanitize WifiConfigs
* commit '868d4c341034de6e2ebb6c1a247488b00d17c78d': DO NOT MERGE Sanitize WifiConfigs
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wifi/WifiService.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/services/java/com/android/server/wifi/WifiService.java b/services/java/com/android/server/wifi/WifiService.java
index a70978e..851c00f 100644
--- a/services/java/com/android/server/wifi/WifiService.java
+++ b/services/java/com/android/server/wifi/WifiService.java
@@ -35,6 +35,7 @@ import android.net.wifi.WifiWatchdogStateMachine;
import android.net.DhcpInfo;
import android.net.DhcpResults;
import android.net.LinkAddress;
+import android.net.LinkProperties;
import android.net.NetworkUtils;
import android.net.RouteInfo;
import android.os.Binder;
@@ -470,6 +471,17 @@ public final class WifiService extends IWifiManager.Stub {
*/
public int addOrUpdateNetwork(WifiConfiguration config) {
enforceChangePermission();
+ // Until we have better UI so the user knows what's up we can't support undisplayable
+ // things (it's a security hole). Even when we can support it we probably need
+ // to lock down who can modify what. TODO - remove this when addOrUpdateNetwork
+ // restricts callers AND when the UI in settings lets users view the data AND
+ // when the VPN code is immune to specific routes.
+ if (config != null) {
+ LinkProperties lp = config.linkProperties;
+ if (lp == null || lp.equals(WifiConfiguration.stripUndisplayableConfig(lp)) == false) {
+ return -1;
+ }
+ }
if (mWifiStateMachineChannel != null) {
return mWifiStateMachine.syncAddOrUpdateNetwork(mWifiStateMachineChannel, config);
} else {