fix(wifi): allow non-ascii characters in wifi ssids (#3365)#3375
fix(wifi): allow non-ascii characters in wifi ssids (#3365)#3375MattDHill wants to merge 2 commits into
Conversation
WiFi SSIDs are 0-32 arbitrary octets per 802.11; the is_ascii() guard wrongly rejected valid SSIDs containing non-ASCII characters (e.g. accented letters or a typographic apostrophe). NetworkManager receives the SSID as an argv argument, so non-ASCII is passed through safely. The WPA passphrase ASCII check is kept, since WPA-PSK passphrases must be ASCII. Removes the now-unused net.wifi.ssid-no-special-characters i18n key. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@helix-nine verify that NetworkManager handles UTF-8 wifi SSIDs and passwords properly |
|
Verified empirically. I ran the real NetworkManager daemon (nmcli 1.42.4) and replicated exactly how SSIDs — UTF-8 handled correctly. The 11 input octets No corruption, no truncation, no quoting hazard — confirming the PR's reasoning. Two things to know about why this works and its one inherent limit:
Passwords — keeping the ASCII guard is correct. WPA-PSK passphrases are 8–63 printable ASCII per 802.11i, and NM enforces this itself: So the PR's decision to retain One unrelated note I checked while in there (not introduced by this PR): LGTM on the UTF-8 behavior. |
|
we should probably fix the |
nmcli `-t`/`-g` terse output escapes `:` as `\:` and `\` as `\\` within a field, but `list_networks_low`/`list_wifi_low` split on raw `:`, so an SSID containing a colon was split into the wrong fields — the connection then failed the `wireless` type check and vanished from the list, leaving connect/remove/active-detection unable to find it. Add `split_nmcli_terse_line`, which splits on unescaped colons and unescapes `\:`/`\\`, and route both parsers through it. Also drop a leftover `JCWM` debug log.
|
Done — pushed The root cause: Fix adds a small
|
Closes #3365.
Summary
Adding, connecting to, or removing a WiFi network whose SSID contains a non-ASCII character (e.g. an accented letter or a typographic apostrophe
') failed with "WiFi Internal Error SSID may not have special characters".The cause is an
if !ssid.is_ascii()guard at all three WiFi RPC entry points (add,connect,remove) innet/wifi.rs. 802.11 defines an SSID as 0–32 arbitrary octets — non-ASCII is valid, and plenty of real networks use it. This guard is unchanged from 0.3.5.1, so the restriction is live in 0.4.0.This drops the SSID guard at all three sites. The SSID is handed to NetworkManager (
nmcli) as a direct argv argument — a RustStringis always valid UTF-8 and NetworkManager handles UTF-8 SSIDs natively — so there's no quoting/shell hazard.The passphrase
is_ascii()check is intentionally kept: WPA-PSK passphrases must be 8–63 printable ASCII characters per 802.11i.The now-unused
net.wifi.ssid-no-special-charactersi18n key is removed from all five locales.Notes
', ASCII) was already accepted; the reporter's error implies a non-ASCII character (most likely a typographic'auto-substituted by their device).0.4.0-beta.10(StartOS).