Skip to content
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

interpret hex sequences in ssid station names #918

Merged
merged 2 commits into from
May 31, 2021

Conversation

glaszig
Copy link
Contributor

@glaszig glaszig commented May 30, 2021

resolves #917

before:
Bildschirmfoto 2021-05-30 um 17 46 16

after:
Bildschirmfoto 2021-05-30 um 17 46 48

@glaszig
Copy link
Contributor Author

glaszig commented May 30, 2021

this also fixes rasp ap exclusion: in the list of nearby stations raspap's own hostapd is not shown.

continue;
}

$ssid = trim($arrNetwork[4]);
// filter SSID string: anything invisible in 7bit ASCII or quotes -> ignore network
if (preg_match('[\x00-\x1f\x7f-\xff\'\`\´\"]', $ssid)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've read the comment but what is this actually doing? can we get rid of this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean exclude raspap ssid, $ap_ssid is defined here:

// get the name of the AP. Should be excluded from nearby networks
exec('cat '.RASPI_HOSTAPD_CONFIG.' | sed -rn "s/ssid=(.*)\s*$/\1/p" ', $ap_ssid);
$ap_ssid = $ap_ssid[0];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean line 78-79. this "invisibility" filter. is this filtering hidden ssid?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, \x00-\x1f are the first 32 unprintable 7bit ASCII control codes. \x7f = delete and the rest are extended ASCII ISO Latin-1 printable characters.

The latter shouldn't be excluded as the IEEE 802.11 standard allows SSIDs with 0-32 octets of an unspecified or utf-8 encoding. So for example råsþi÷wêbgüî is a valid SSID.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed with a4d5cc1, thanks

@billz
Copy link
Member

billz commented May 31, 2021

@glaszig nice addition, thanks

@billz billz merged commit 2233636 into RaspAP:master May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wpa_supplicant scan_results with unicode names
2 participants