aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Chiou <isaacchiou@google.com>2021-04-02 07:33:27 +0000
committerIsaac Chiou <isaacchiou@google.com>2021-04-02 12:15:23 +0000
commite8472c2b900ef63a28bb2086bf5c3ebd736c8625 (patch)
tree4626943adf255c2779c9e1497a7ea186fd69384b
parent8ba146cefb5bcb30c82228870ca1ee06b78d8743 (diff)
downloadwpa_supplicant_8-e8472c2b900ef63a28bb2086bf5c3ebd736c8625.tar.gz
Revert "Wifi: Support NVT-ASCII in passphrase"
This reverts commit 8ba146cefb5bcb30c82228870ca1ee06b78d8743. Reason for revert: Based on 802.11i specification, this patch is not necessary. Bug: 129974610 Test: Build pass. WiFi connection works. Change-Id: I0046bb67bf2a3c1f265bc72f75e59ab1c43a4842
-rw-r--r--src/utils/common.c14
-rw-r--r--src/utils/common.h1
-rw-r--r--wpa_supplicant/hidl/1.4/sta_network.cpp2
3 files changed, 1 insertions, 16 deletions
diff --git a/src/utils/common.c b/src/utils/common.c
index 20f1c6c3..2c127519 100644
--- a/src/utils/common.c
+++ b/src/utils/common.c
@@ -720,20 +720,6 @@ int has_ctrl_char(const u8 *data, size_t len)
}
-int has_non_nvt_ascii_char(const u8 *data, size_t len)
-{
- size_t i;
-
- for (i = 0; i < len; i++) {
- if (data[i] < 7
- || (13 < data[i] && data[i] < 32)
- || data[i] == 127)
- return 1;
- }
- return 0;
-}
-
-
int has_newline(const char *str)
{
while (*str) {
diff --git a/src/utils/common.h b/src/utils/common.h
index 660951ec..45f72bb3 100644
--- a/src/utils/common.h
+++ b/src/utils/common.h
@@ -509,7 +509,6 @@ const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len);
char * wpa_config_parse_string(const char *value, size_t *len);
int is_hex(const u8 *data, size_t len);
int has_ctrl_char(const u8 *data, size_t len);
-int has_non_nvt_ascii_char(const u8 *data, size_t len);
int has_newline(const char *str);
size_t merge_byte_arrays(u8 *res, size_t res_len,
const u8 *src1, size_t src1_len,
diff --git a/wpa_supplicant/hidl/1.4/sta_network.cpp b/wpa_supplicant/hidl/1.4/sta_network.cpp
index 04d42dd2..3e773de6 100644
--- a/wpa_supplicant/hidl/1.4/sta_network.cpp
+++ b/wpa_supplicant/hidl/1.4/sta_network.cpp
@@ -2414,7 +2414,7 @@ int StaNetwork::isPskPassphraseValid(const std::string &psk)
PSK_PASSPHRASE_MAX_LEN_IN_BYTES)) {
return 1;
}
- if (has_non_nvt_ascii_char((u8 *)psk.c_str(), psk.size())) {
+ if (has_ctrl_char((u8 *)psk.c_str(), psk.size())) {
return 1;
}
return 0;