-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Modified ESP8266WebServer to allow for authentication with H(A1). #6020
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
Conversation
This branch was tested with the new example as well as with the HttpAdvancedAuth.ino and HttpBasicAuth.ino examples to make sure no existing functionality was disrupted. All three examples compiled and functioned as expected. |
I have only found one issue (#4392) that asked a related question about digest authentication, but this was closed as the question was about the security of the transmission, not about its storage. This issue was quickly closed. I have found two pull requests (#3328 and #4404) that address a similar issue with basic authentication. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me, with the prior comments. Not sure if it's going to give much more security (especially since raw user/real/passwords are still stored in 8266 flash...ugh), but I don't think it affects anything negatively.
libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
Outdated
Show resolved
Hide resolved
My goal for the example (HttpHashCredAuth.ino) was to show how to avoid this. The credentials are initialized to something generic, but once they are changed through the web interface, only the user name and hash of user/real/password should be in flash. What did I miss? |
-Expose HTTP Digest authentication with H1 hash as the argument -Preserved HTTP authentication with username/password arguments -Added a public static function for generating the H1 hash -Created an example of how to use this called HttpHashCredAuth.ino
Ah, did not catch you were only writing the hash in SPIFFS. Looks good to me, we'll see what CI thinks of it. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now!
Thanks for the contribution, @overtone1000! 2.5.2 just came out so we can start adding feature updates like this. |
I'm very appreciative of the work you all do on this project. This is my first ever PR, so thank you for helping me! |
Got the following error: |
@twinclouds, which version of the core are you using? This has been merged into the master branch but isn't yet part of the current release (2.5.2). If you need this feature now you'll need to use the current git version as described in the readme file in the root of this repositoty. |
RFC 2617 4.13 discusses storing credentials as the username and H(A1) rather than the username and password, but this isn't possible with the current implementation of Digest authentication in the ESP8266WebServer class because the authenticate function takes username and password as arguments. This limitation is addressed in this branch, which contains four modifications: