diff options
author | Rebecca Silberstein <silberst@google.com> | 2016-04-13 10:29:48 -0700 |
---|---|---|
committer | Rebecca Silberstein <silberst@google.com> | 2016-04-13 10:54:15 -0700 |
commit | af3c71f28531c8d52ebc8e913f34b674f91b9fd8 (patch) | |
tree | 2af57ff502907fde22d433a7c2bf9cd7e246ecfe /service | |
parent | 15c889b305b3086a93229258d4f3a083acadc8b5 (diff) |
WifiConfigStore: set requirePMF when ieee80211w==2
When reading back WifiConfigurations, the ieee80211w value is
incorrectly defaulting to 3, this is causing the requirePMF value to be
incorrectly set to true. Change this behavior to only set requirePMF
when the value read is 2.
BUG: 28159304
Change-Id: I0896b1feb10415c04b335ac1b91844ae0fe87f2d
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigStore.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index 8b4535ebf..0f842ec79 100644 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -83,6 +83,10 @@ public class WifiConfigStore { public static final String ID_STRING_KEY_FQDN = "fqdn"; public static final String ID_STRING_KEY_CREATOR_UID = "creatorUid"; public static final String ID_STRING_KEY_CONFIG_KEY = "configKey"; + + // Value stored by supplicant to requirePMF + public static final int STORED_VALUE_FOR_REQUIRE_PMF = 2; + /** * In old configurations, the "private_key" field was used. However, newer * configurations use the key_id field with the engine_id set to "keystore". @@ -373,7 +377,7 @@ public class WifiConfigStore { config.requirePMF = false; if (!TextUtils.isEmpty(value)) { try { - config.requirePMF = Integer.parseInt(value) != 0; + config.requirePMF = Integer.parseInt(value) == STORED_VALUE_FOR_REQUIRE_PMF; } catch (NumberFormatException ignore) { } } @@ -812,7 +816,7 @@ public class WifiConfigStore { if (config.requirePMF && !mWifiNative.setNetworkVariable( netId, WifiConfiguration.pmfVarName, - "2")) { + Integer.toString(STORED_VALUE_FOR_REQUIRE_PMF))) { loge(config.SSID + ": failed to set requirePMF: " + config.requirePMF); return false; } |