EVerest / everest-core

Apache License 2.0
98 stars 72 forks source link

Setup module support for a wider range of SSID values #760

Closed james-ctc closed 1 month ago

james-ctc commented 3 months ago

Describe the problem

The Setup module provides an API to manage Wi-Fi networks. You can scan to see what networks are available and attempt to connect. Problems occur when a SSID includes values outside of the standard 7-bit ASCII printable character range (with potential issues with leading and trailing white space). character values outside 32..126 are escaped \n \r \xfe etc. These are then further escaped over the JSON API. Attempting to connect to a network using the scanned network information fails when there are any escaped characters in the SSID. e.g. everest_api/setup/var/wifi_info would show an SSID as "ssid":"Plusnet\\xe2\\x82\\xac123" however everest_api/setup/cmd/add_network requires "ssid":"Plusnet€123".

Additional issues can occur where different character encoding is used since some characters exist in extended ASCII as well as having UTF-8 multi-byte values.

EVerest Domain

Other

Affected EVerest Module

Setup modue

Describe your solution

It is recommended to change the Setup module API to use a hex string as the SSID representation. This removes all the character and encoding issues and would support the full range of allowable SSIDs according to the Wi-Fi standard. (note there may be SSID values that are not supported by the Linux Wi-Fi code such as wpa_supplicant/hostapd ...)

Applications would need to convert the SSID into a displayable value where needed.

It is recommended to use a programmatic API to wpa_supplicant (rather than wpa_cli) to further remove issues with parameter escaping.

Additional context

No response

corneliusclaussen commented 1 month ago

Closing as the PR has been merged