Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4d3850e

Browse filesBrowse files
author
Lukas Ostendorf
committed
Fix: some clients were not able to authenticate using DIGEST_AUTH
1 parent 0fd86a0 commit 4d3850e
Copy full SHA for 4d3850e

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎libraries/ESP8266WebServer/src/ESP8266WebServer.cpp

Copy file name to clipboardExpand all lines: libraries/ESP8266WebServer/src/ESP8266WebServer.cpp
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
static const char AUTHORIZATION_HEADER[] PROGMEM = "Authorization";
4040
static const char qop_auth[] PROGMEM = "qop=auth";
41+
static const char qop_auth_quoted[] PROGMEM = "qop=\"auth\"";
4142
static const char WWW_Authenticate[] PROGMEM = "WWW-Authenticate";
4243
static const char Content_Length[] PROGMEM = "Content-Length";
4344

@@ -165,7 +166,7 @@ bool ESP8266WebServer::authenticate(const char * username, const char * password
165166
}
166167
// parameters for the RFC 2617 newer Digest
167168
String _nc,_cnonce;
168-
if(authReq.indexOf(FPSTR(qop_auth)) != -1) {
169+
if(authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) {
169170
_nc = _extractParam(authReq, F("nc="), ',');
170171
_cnonce = _extractParam(authReq, F("cnonce=\""));
171172
}
@@ -195,7 +196,7 @@ bool ESP8266WebServer::authenticate(const char * username, const char * password
195196
DEBUG_OUTPUT.println("Hash of GET:uri=" + _H2);
196197
#endif
197198
md5.begin();
198-
if(authReq.indexOf(FPSTR(qop_auth)) != -1) {
199+
if(authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) {
199200
md5.add(_H1 + ':' + _nonce + ':' + _nc + ':' + _cnonce + F(":auth:") + _H2);
200201
} else {
201202
md5.add(_H1 + ':' + _nonce + ':' + _H2);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.