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 2d3c576

Browse filesBrowse files
committed
Fix: WebServer: Digest authentication failed for some clients
Ports: esp8266/Arduino@4d3850e
1 parent a299ddc commit 2d3c576
Copy full SHA for 2d3c576

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+4
-3
lines changed

‎libraries/WebServer/src/WebServer.cpp

Copy file name to clipboardExpand all lines: libraries/WebServer/src/WebServer.cpp
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333

3434

3535
static const char AUTHORIZATION_HEADER[] = "Authorization";
36-
static const char qop_auth[] = "qop=\"auth\"";
36+
static const char qop_auth[] PROGMEM = "qop=auth";
37+
static const char qop_auth_quoted[] PROGMEM = "qop=\"auth\"";
3738
static const char WWW_Authenticate[] = "WWW-Authenticate";
3839
static const char Content_Length[] = "Content-Length";
3940

@@ -185,7 +186,7 @@ bool WebServer::authenticate(const char * username, const char * password){
185186
}
186187
// parameters for the RFC 2617 newer Digest
187188
String _nc,_cnonce;
188-
if(authReq.indexOf(FPSTR(qop_auth)) != -1) {
189+
if(authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) {
189190
_nc = _extractParam(authReq, F("nc="), ',');
190191
_cnonce = _extractParam(authReq, F("cnonce=\""),'\"');
191192
}
@@ -205,7 +206,7 @@ bool WebServer::authenticate(const char * username, const char * password){
205206
}
206207
log_v("Hash of GET:uri=%s", _H2.c_str());
207208
String _responsecheck = "";
208-
if(authReq.indexOf(FPSTR(qop_auth)) != -1) {
209+
if(authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) {
209210
_responsecheck = md5str(_H1 + ':' + _nonce + ':' + _nc + ':' + _cnonce + F(":auth:") + _H2);
210211
} else {
211212
_responsecheck = md5str(_H1 + ':' + _nonce + ':' + _H2);

0 commit comments

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