jeelabs / esp-link

esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer
Other
2.82k stars 720 forks source link

MQTT username flash config should be longer #450

Open tclarke opened 5 years ago

tclarke commented 5 years ago

The MQTT username and password fields are 32 bytes in the flash config. This is too short for some providers (notably flespi.io). Suggest changing these to 64 bytes for providers which use a SHA1 or similar hash to generate a user token or password.

uzi18 commented 5 years ago

duplicate of #356?

tclarke commented 5 years ago

@uzi18 No it isn't. #356 is a problem with the len check such that the maximum length you can set is 1 less than the real maximum length. This issue doubles the allowed length of the field.

uzi18 commented 5 years ago

@tclarke please check this test firmware from #356, I think it is already fixed there

tclarke commented 5 years ago

@uzi18 That only appears to change the length of mqtt_password, not mqtt_username

uzi18 commented 5 years ago

@tclarke need to check if I'm able to compile sources once again, with fix for you.

uzi18 commented 5 years ago

@tclarke mqtt_username is 32 chars mqtt_password is 70 chars where did you get so long username and how long is it (example please)? my build env still works :)

tclarke commented 5 years ago

flespi.io uses login tokens in the username field for access control. These are 64 bytes long, probably based on a SHA-256 random hash.

uzi18 commented 5 years ago

esp-link-v3.2.47.alpha.5-ga0d3bb3-dirty-Lucjan.tgz.zip

@tclarke you can try this one

uzi18 commented 5 years ago

@tclarke any feedback?

tclarke commented 5 years ago

It's working. Thanks!

uzi18 commented 5 years ago

sure it work, thanks!

uddhavdave commented 3 years ago

Hi @tclarke ! i flashed the firmware mentioned by @uzi18, but i am still not able to set the username via esp-link webpage. It gives me the same error. How did you manage to make it work?

uzi18 commented 3 years ago

Check different issues commented by me to find latest builds. @alphabeta1212 Are you able to use secure paste site to check your login and password fields on my own? Maybe you can paste also screenshot with error?

uddhavdave commented 3 years ago

Hi @uzi18 , I had flashed 3.2.47 and was getting this error: image

Using flespi token