esp-link icon indicating copy to clipboard operation
esp-link copied to clipboard

MQTT username flash config should be longer

Open tclarke opened this issue 5 years ago • 14 comments

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.

tclarke avatar Jun 25 '19 17:06 tclarke

duplicate of #356?

uzi18 avatar Jun 25 '19 17:06 uzi18

@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.

tclarke avatar Jun 25 '19 18:06 tclarke

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

uzi18 avatar Jun 25 '19 19:06 uzi18

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

tclarke avatar Jun 25 '19 19:06 tclarke

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

uzi18 avatar Jun 25 '19 19:06 uzi18

@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 :)

uzi18 avatar Jun 26 '19 07:06 uzi18

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.

tclarke avatar Jun 26 '19 15:06 tclarke

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

@tclarke you can try this one

uzi18 avatar Jun 26 '19 22:06 uzi18

@tclarke any feedback?

uzi18 avatar Jun 27 '19 14:06 uzi18

It's working. Thanks!

tclarke avatar Jun 27 '19 14:06 tclarke

sure it work, thanks!

uzi18 avatar Jun 27 '19 14:06 uzi18

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?

uddhavdave avatar Mar 18 '21 17:03 uddhavdave

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?

uzi18 avatar Mar 18 '21 17:03 uzi18

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

Using flespi token

uddhavdave avatar Mar 18 '21 17:03 uddhavdave