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

WiFiModule Allow PSK instead of password #870

Closed
MKGaru opened this issue Mar 13, 2022 · 9 comments
Closed

WiFiModule Allow PSK instead of password #870

MKGaru opened this issue Mar 13, 2022 · 9 comments

Comments

@MKGaru
Copy link

MKGaru commented Mar 13, 2022

Describe
WiFi Module Allow PSK instead of password

Why do you think this feature would be useful?
There is a slight security advantage as it avoids storing raw passwords.

Proposal change

if (c_strlen(str) > (sizeof(config.password) - 1))

if (espStrLen(str) > (sizeof(config.sta.password) - 1))

remove -1 both files.
(both source use memcpy, not strcpy , because maybe not required terminate null charactor)

I tried on esp32, it works.

ref.
http://jorisvr.nl/wpapsk.html
esp8266/Arduino/pull/1850

@phoddie
Copy link
Collaborator

phoddie commented Mar 15, 2022

Interesting. It is nice that the password wouldn't need to be stored, though the PSK value still allows log-in to the network, so that should still be secured in a real product.

It seems like the password and PSK are not quite the same. I'm not sure if there should be a different name in JavaScript to distinguish those (config.psk instead of config.password). If everyone else is already overloading password, maybe we should do the same.

@wilberforce
Copy link
Contributor

wilberforce commented Mar 15, 2022

How do you generate the PSK?

@wilberforce
Copy link
Contributor

wilberforce commented Mar 15, 2022

https://www.wireshark.org/tools/wpa-psk.html
pbkdf2.js might be useful - then the same ssid and password in the manifest could be used and they could be converted to the psk for use on the device.

@phoddie
Copy link
Collaborator

phoddie commented Oct 20, 2022

Sorry to be so slow The proposed change makes sense. Even macOS allows a 64 character password, so we should just always do that. This will be included in tomorrow's Moddable SDK update. Thank you!

@phoddie
Copy link
Collaborator

phoddie commented Oct 21, 2022

Closing as the proposed change has been applied.

@phoddie phoddie closed this as completed Oct 21, 2022
@MKGaru
Copy link
Author

MKGaru commented Oct 21, 2022

Closing as the proposed change has been applied.

Thank you so much!
By the way, you applied for access point ssid & password, but i think should be change sta mode too.

@phoddie
Copy link
Collaborator

phoddie commented Oct 22, 2022

😱

@phoddie
Copy link
Collaborator

phoddie commented Oct 24, 2022

I tried again. ;) Any better?

@MKGaru
Copy link
Author

MKGaru commented Oct 25, 2022

Excellent!
It's works.
Thank you for update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants