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:
kapil.gupta 2020-03-13 15:52:44 +05:30
parent b0f053d82d
commit 398dc28a4e
2 changed files with 14 additions and 2 deletions

View File

@ -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))

View File

@ -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)