ssid with double space not stored correctly

Jouni Malinen j at w1.fi
Thu Dec 14 02:50:12 PST 2017


On Wed, Dec 13, 2017 at 10:18:59PM -0500, Dale R. Worley wrote:
> David Poole <testcluster at gmail.com> writes:
> > I have a set of evil test SSIDs I use. The 802.11 spec just says "32 chars"
> > and is very unspecific about what a "char" consists of. We've found lots of
> > weird corner cases in applications, drivers, when hitting corner cases
> > (like exactly 32 chars).
> 
> Ugh.  So the real rules are whatever constraints the radio protocol
> places on the value that is put in the SSID field.

There are no constraints on the octets within the SSID value. It is not
"32 chars"; it is 32 arbitrary binary octets. Sure, many devices do not
support something like 0x00 showing up in the middle of something they
believe is a string that might be represented as a C string using null
termination within the program.. Anyway, the IEEE 802.11 standard does
not have such constraints.

Internally wpa_supplicant and hostapd support SSID as an arbitrary array
of 32 octets of binary data because that's what the value is in the
standard. For most use cases, it obviously does not make much sense to
take benefit of that and instead, it is best to limit oneself to using
ASCII or UTF8 or some similar encoding of text if the goal is to
actually interoperate with other devices.

As far as the wpa_cli examples in this email thread are concerned, they
are just pointing out behavior coming from the shell command line
parsing, not wpa_cli. If the SSID value is fully in a single command
line argument (e.g., '"example  with  spaces"'), that will go through
with those two double-spaces through wpa_cli to wpa_supplicant.

It is also possible to configure the SSID using other encoding on the
control interface command if something more special is needed: hexdump
without double-quotes or printf format style with P"hello\0hidden"
(i.e., that P" prefix). These different cases are described in the
wpa_supplicant/wpa_supplicant.conf file for the network profile ssid
parameter.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list