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
diff --git a/src/utils/common.c b/src/utils/common.c
index 20f1c6c..2c12751 100644
--- a/src/utils/common.c
+++ b/src/utils/common.c
@@ -720,20 +720,6 @@
}
-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 660951e..45f72bb 100644
--- a/src/utils/common.h
+++ b/src/utils/common.h
@@ -509,7 +509,6 @@
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 04d42dd..3e773de 100644
--- a/wpa_supplicant/hidl/1.4/sta_network.cpp
+++ b/wpa_supplicant/hidl/1.4/sta_network.cpp
@@ -2414,7 +2414,7 @@
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;