mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
wpa_supplicant: Add parsing support for WEP40 key
WEP key is passed as ascii key without "", add parsing support in supplicant for this.
This commit is contained in:
parent
b0f053d82d
commit
398dc28a4e
@ -263,8 +263,7 @@ char * ets_strdup(const char *s);
|
||||
#define os_strncpy(d, s, n) strncpy((d), (s), (n))
|
||||
#endif
|
||||
#ifndef os_strrchr
|
||||
//hard cold
|
||||
#define os_strrchr(s, c) NULL
|
||||
#define os_strrchr(s, c) strrchr((s), (c))
|
||||
#endif
|
||||
#ifndef os_strstr
|
||||
#define os_strstr(h, n) strstr((h), (n))
|
||||
|
@ -269,8 +269,21 @@ char * wpa_config_parse_string(const char *value, size_t *len)
|
||||
} else {
|
||||
u8 *str;
|
||||
size_t tlen, hlen = os_strlen(value);
|
||||
#ifndef ESP_SUPPLICANT
|
||||
if (hlen & 1)
|
||||
return NULL;
|
||||
#else
|
||||
if (hlen == 5 || hlen == 13) {
|
||||
*len = hlen;
|
||||
str = (u8 *)os_malloc(*len + 1);
|
||||
if (str == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
memcpy(str, value, *len);
|
||||
str[*len] = '\0';
|
||||
return (char *) str;
|
||||
}
|
||||
#endif
|
||||
tlen = hlen / 2;
|
||||
str = os_malloc(tlen + 1);
|
||||
if (str == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user