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

Use sed instead of grep+cut to capture the passphrase #1680

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

warpdesign
Copy link
Contributor

Current method would crop any passphrase containing an = sign.

For eg. with this hostapd.conf:

...
wpa_passwphrase=Foo=Bar
...

the wpa_passphrase() function would would return Foo instead of Foo=Bar, incorrectly cropping the
passkey.

As a result, when editing the hotspot settings, the user may incorrectly update its passkey without even knowing it.
Luckily, mine was cropped to a too short string, so I noticed the error in the form.

I tested the new command with macOS & Linux (Debian) so I guess it should work with most Unix OS.

Also, I guess the problem can happen in other places, like maybe with the ssid (can it contain = signs?).

Current method would crop any passphrase containing an '=' sign.

For eg. wpa_passwphrase=Foo=Bar would return 'Foo' instead of 'Foo=Bar'.
@billz
Copy link
Member

billz commented Oct 22, 2024

@NL-TCH

@NL-TCH
Copy link
Contributor

NL-TCH commented Oct 22, 2024

good catch @warpdesign, thanks for the PR!

@billz good to merge from my side

@billz billz merged commit bf22668 into RaspAP:master Oct 22, 2024
3 checks passed
@NL-TCH
Copy link
Contributor

NL-TCH commented Oct 22, 2024

we might need to update other variables as well, now the "=" sign is nowhere allowed (for example in SSID-names and Interfaces))

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.

3 participants