[PATCH] Add WPA_UNICODE_SSID support
Dmitry Shmidt
dimitrysh
Fri Feb 25 09:57:35 PST 2011
Hi Johannes,
On Fri, Feb 25, 2011 at 12:42 AM, Johannes Berg
<johannes at sipsolutions.net> wrote:
> On Thu, 2011-02-24 at 17:31 -0800, Dmitry Shmidt wrote:
>
>> --- a/src/utils/common.c
>> +++ b/src/utils/common.c
>> @@ -374,8 +374,10 @@ const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len)
>> ? ? ? os_memcpy(ssid_txt, ssid, ssid_len);
>> ? ? ? ssid_txt[ssid_len] = '\0';
>> ? ? ? for (pos = ssid_txt; *pos != '\0'; pos++) {
>> +#ifndef WPA_UNICODE_SSID
>> ? ? ? ? ? ? ? if ((u8) *pos < 32 || (u8) *pos >= 127)
>> ? ? ? ? ? ? ? ? ? ? ? *pos = '_';
>> +#endif
>
> That doesn't make sense, anyone who has a working, say UTF-8, config now
> will be totally confused by this change.
I am missing your point. The code I am trying to "remove" is hiding
non-ascii chars.
>
>> +#ifdef WPA_UNICODE_SSID
>> +static char * wpa_config_write_str_unicode(const struct parse_data *data,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct wpa_ssid *ssid)
>> +{
>> + ? ? size_t len;
>> + ? ? char **src;
>> +
>> + ? ? src = (char **) (((u8 *) ssid) + (long) data->param1);
>> + ? ? if (*src == NULL)
>> + ? ? ? ? ? ? return NULL;
>> +
>> + ? ? if (data->param2)
>> + ? ? ? ? ? ? len = *((size_t *) (((u8 *) ssid) + (long) data->param2));
>> + ? ? else
>> + ? ? ? ? ? ? len = os_strlen(*src);
>> +
>> + ? ? return wpa_config_write_string_ascii((const u8 *) *src, len);
>> +}
>> +#endif
>
> And without the first change, this change also doesn't make a lot of
> sense?
Correct, non-ascii chars will be replaced with '_'
>
> johannes
>
>
More information about the Hostap
mailing list