esp-idf-svc icon indicating copy to clipboard operation
esp-idf-svc copied to clipboard

Fix WPS regression and cred conversion

Open torkleyy opened this issue 1 year ago • 2 comments

Fixes #337 Also fixes the conversion of ssid/password in the config to no longer assume 0 termination - this lead to problems when routers send a 64 byte access token to us instead of a password

torkleyy avatar Mar 05 '24 07:03 torkleyy

Fixes #337 Also fixes the conversion of ssid/password in the config to no longer assume 0 termination - this lead to problems when routers send a 64 byte access token to us instead of a password

@torkleyy For my understanding could you elaborate on the access token case you've mentioned?

ivmarkov avatar Mar 06 '24 05:03 ivmarkov

I'm not quite sure how it works, but some routers will send 64-byte access tokens instead of the passphrase. Until now, the code assumed that ssid / password are always 0-terminated, but it's actually possible for them to use the maximum length of 32/64.

I had no success actually connecting to the Wifi using that token on the esp (it does work on other devices). I ended up setting CONFIG_ESP_WIFI_WPS_PASSPHRASE to receive the passphrase instead.

torkleyy avatar Mar 06 '24 06:03 torkleyy

I've delayed merging this for way too long, and now it has a conflict. :( @torkleyy if you don't have time or will to resolve the conflicts in this PR, I'll understand and will do over the weekend.

(BTW: I've finally checked the (under-documented) ESP IDF Wifi API, and I confirm you are likely correct in the weird behavior w.r.t. SSID (and likely password) in that is is a null-terminated string except when it is full length).

ivmarkov avatar May 09 '24 19:05 ivmarkov

BTW, I'm worried that we might have other places to fix: specifically, the reverse conversion of native SSID into heapless::String SSID. But these we can of course fix later.

ivmarkov avatar May 09 '24 19:05 ivmarkov

@ivmarkov rebased.

torkleyy avatar May 16 '24 12:05 torkleyy

Thank you!

ivmarkov avatar May 16 '24 12:05 ivmarkov