New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function genWpaPSK fails on special chars in SSID #138
Comments
PS - I probably should have added another note:
|
Theres a bug in the validation pattern so its not really functioning correctly. Heres the fixed pattern but its only applicable to manually entered SSID. For SSID's in the scan list there is no validation. Only allow alphanumeric, dash and underscore. No embedded spaces, 3 to 32 chars.
Technically there are other invalid formats for SSID. It can't start with certain chars, etc. |
I think originally double quotes were used to enclose the SSID because some users reported using single quotes in their SSID's. Something like that. |
Unfortunately, the IEEE spec is hidden behind a paywall. Here's the Wikipedia interpretation
I added the emphasis. Vendors and software app writers may impose limitations but the spec doesn't. Cisco, for example, has a bunch
And many AP/client software which uses bash or busybox may have issues---which is why we're here:) I think we just have to do what's reasonable and then be explicit about any limitations in order to manage users' expectations. Maybe I'm overly sensitive to this issue, but it's with cause. Some years ago, I bought a WiFi-enabled scale which I couldn't associate with my router until I created a guest network with a totally dumbed-down SSID. |
Right, unfortunately there is no standard for SSID other than its length and given that the current approach in moOde seems to be working fine for the vast majority of users I would propose not making any changes. If we had a lot of reports of special character SSID's causing issues then for sure we would make changes. |
If we get more trouble reports relating to this issue I'll reopen. |
So please do, I'm having trouble setting a SSID manually via the web GUI when the SSID has a '.' on its name. Thanks! |
Do you mean the SSID contains a period? Maybe provide an example SSID that has the character(s) that currently are not allowed by the input field. |
Yes, a period. It's tt2.4 |
Edit the file /var/www/templates/net-config.html and add the period to the pattern.
Confirm whether or not it works for you and if so I'll update the file for the next release. |
Yes, it does work. Thanks for the quick fix! You may want to fix the info/error message as well: "Length 2-32 chars". It seems it should be 3-32 instead. Moode is wonderful. Bests, |
As reported in the forum by user ab.basu (post http://moodeaudio.org/forum/showthread.php?tid=1827&pid=21225#pid21225, moOde fails to associate with an AP if its SSID contains the dollar sign ($), which is a legal character in this context (see below).
The problem lies in /var/www/inc/playerlib.php in function genWpaPSK in this line (#2706 in my 6.5.2)
$result = sysCmd('wpa_passphrase "' . $ssid . '" < /tmp/passphrase');
Bash will interpret special characters in strings contained within double quotation marks.
I tried hacking this line to change the double quotation marks to escaped single quotes (\') which seemed to work, but I'm not the PHP guru.
Special characters:
The SSID can be 0-32 octets of unspecified encoding according to the standard, so naming is a tricky business. Various router/AP mfgrs set their own limitations
maybe there's a better way to escape these in PHP
there's also the matter of writing and reading special characters from SQLITE3 dbs. I'm no expert at this either.
The text was updated successfully, but these errors were encountered: