diff options
author | Roshan Pius <rpius@google.com> | 2017-05-18 05:09:08 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-18 05:09:08 +0000 |
commit | 49c5b299dbeefd39c6a2ed7b65b5f92262e7688b (patch) | |
tree | f11c25f71332e9e340c75a3eaa50b0302492a0cc /service | |
parent | fd9a6d5607bd6c92045f80046ae344a1275a06d7 (diff) | |
parent | 648915b024ce8a8aa35431b8d388fb6745407ba3 (diff) |
Merge "WifiBackupRestore: Tighten key checks in string parsing" into oc-dev am: 526ca05b3f
am: 648915b024
Change-Id: Icd565145e9d7e7263306b50aa218498cd172939e
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiBackupRestore.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/service/java/com/android/server/wifi/WifiBackupRestore.java b/service/java/com/android/server/wifi/WifiBackupRestore.java index 34aaa0360..4095d8283 100644 --- a/service/java/com/android/server/wifi/WifiBackupRestore.java +++ b/service/java/com/android/server/wifi/WifiBackupRestore.java @@ -573,37 +573,37 @@ public class WifiBackupRestore { if (line.isEmpty()) return; // only whitespace; drop the line. // Now parse the network block within wpa_supplicant.conf and store the important - // lines for procesing later. - if (line.startsWith(SUPPLICANT_KEY_SSID)) { + // lines for processing later. + if (line.startsWith(SUPPLICANT_KEY_SSID + "=")) { mParsedSSIDLine = line; - } else if (line.startsWith(SUPPLICANT_KEY_HIDDEN)) { + } else if (line.startsWith(SUPPLICANT_KEY_HIDDEN + "=")) { mParsedHiddenLine = line; - } else if (line.startsWith(SUPPLICANT_KEY_KEY_MGMT)) { + } else if (line.startsWith(SUPPLICANT_KEY_KEY_MGMT + "=")) { mParsedKeyMgmtLine = line; if (line.contains("EAP")) { isEap = true; } - } else if (line.startsWith(SUPPLICANT_KEY_CLIENT_CERT)) { + } else if (line.startsWith(SUPPLICANT_KEY_CLIENT_CERT + "=")) { certUsed = true; - } else if (line.startsWith(SUPPLICANT_KEY_CA_CERT)) { + } else if (line.startsWith(SUPPLICANT_KEY_CA_CERT + "=")) { certUsed = true; - } else if (line.startsWith(SUPPLICANT_KEY_CA_PATH)) { + } else if (line.startsWith(SUPPLICANT_KEY_CA_PATH + "=")) { certUsed = true; - } else if (line.startsWith(SUPPLICANT_KEY_EAP)) { + } else if (line.startsWith(SUPPLICANT_KEY_EAP + "=")) { isEap = true; - } else if (line.startsWith(SUPPLICANT_KEY_PSK)) { + } else if (line.startsWith(SUPPLICANT_KEY_PSK + "=")) { mParsedPskLine = line; - } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY0)) { + } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY0 + "=")) { mParsedWepKeyLines[0] = line; - } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY1)) { + } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY1 + "=")) { mParsedWepKeyLines[1] = line; - } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY2)) { + } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY2 + "=")) { mParsedWepKeyLines[2] = line; - } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY3)) { + } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY3 + "=")) { mParsedWepKeyLines[3] = line; - } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY_IDX)) { + } else if (line.startsWith(SUPPLICANT_KEY_WEP_KEY_IDX + "=")) { mParsedWepTxKeyIdxLine = line; - } else if (line.startsWith(SUPPLICANT_KEY_ID_STR)) { + } else if (line.startsWith(SUPPLICANT_KEY_ID_STR + "=")) { mParsedIdStrLine = line; } } |