[wpa_supplicant] essid with non-ascii characters
Jouke Witteveen
j.witteveen
Tue Aug 7 08:07:55 PDT 2012
On Tue, Aug 7, 2012 at 3:40 PM, Jouni Malinen <j at w1.fi> wrote:
> On Fri, Aug 03, 2012 at 11:53:07PM +0200, Jouke Witteveen wrote:
>> On Fri, Aug 3, 2012 at 7:05 PM, Dan Williams <dcbw at redhat.com> wrote:
>> > Which is why I proposed something like a read-only ssid_hex config item
>> > that just copies back the SSID in hex form or something like that. I'm
>> > pretty sure that doing any sort of magic munging of the SSID in the
>> > config simply will not happen.
>> >
>> > The ssid field already accepts hex SSIDs if you do something like:
>> >
>> > ssid=AABBCCDD1199
>> >
>> > ie, by not enclosing the SSID in quotes. So the only piece you're
>> > missing is being able to *retrieve* the SSID in hex, right?
>>
>> That is right. The simpler, the better (i.e. preferably directly
>> through scan_results).
>
> This should now be possible with the current hostap.git snapshot. I
> changed wpa_ssid_txt() to use printf-like escaping of the data instead
> of masking non-ASCII characters. The new format is not identical (or
> compatible) with the previous formats used for the ssid parameter in the
> configuration file, so a new format is needed for this if you want to
> just copy an SSID as-is without converting it into a hexdump.
>
> For example:
>
> $ wpa_cli scan_results
> Selected interface 'wlan0'
> bssid / frequency / signal level / flags / ssid
> 02:00:00:00:01:00 2412 -30 [ESS] test\x00abc
> $ wpa_cli bss 02:00:00:00:01:00 | grep ^ssid= | cut -d= -f2-
> test\x00abc
> $ wpa_cli add_network
> Selected interface 'wlan0'
> 0
> $ wpa_cli set_network 0 key_mgmt NONE
> Selected interface 'wlan0'
> OK
> wpa_cli set_network 0 ssid 'P"test\x00abc"'
> Selected interface 'wlan0'
> OK
> $ wpa_cli select_network 0
> Selected interface 'wlan0'
> OK
>
>
> Or in the configuration file:
>
> network={
> key_mgmt=NONE
> ssid=P"test\x00abc"
> }
>
While I was still pondering on how to do this, you fixed it in the
best way I could want. Very cool, thanks!
- Jouke
More information about the Hostap
mailing list