Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1443)

Unified Diff: net/http/http_auth_handler_digest.cc

Issue 4825001: auth-int qop is ignored for Digest authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: new description Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_auth_handler_digest.h ('k') | net/http/http_auth_handler_digest_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_digest.cc
===================================================================
--- net/http/http_auth_handler_digest.cc (revision 63735)
+++ net/http/http_auth_handler_digest.cc (working copy)
@@ -18,8 +18,6 @@
#include "net/http/http_request_info.h"
#include "net/http/http_util.h"
-// TODO(eroman): support qop=auth-int
-
namespace net {
// Digest authentication is specified in RFC 2617.
@@ -65,25 +63,30 @@
}
// static
-std::string HttpAuthHandlerDigest::QopToString(int qop) {
+std::string HttpAuthHandlerDigest::QopToString(QualityOfProtection qop) {
switch (qop) {
+ case QOP_UNSPECIFIED:
+ return "";
case QOP_AUTH:
return "auth";
- case QOP_AUTH_INT:
- return "auth-int";
default:
+ NOTREACHED();
return "";
}
}
// static
-std::string HttpAuthHandlerDigest::AlgorithmToString(int algorithm) {
+std::string HttpAuthHandlerDigest::AlgorithmToString(
+ DigestAlgorithm algorithm) {
switch (algorithm) {
+ case ALGORITHM_UNSPECIFIED:
+ return "";
case ALGORITHM_MD5:
return "MD5";
case ALGORITHM_MD5_SESS:
return "MD5-sess";
default:
+ NOTREACHED();
return "";
}
}
@@ -91,7 +94,7 @@
HttpAuthHandlerDigest::HttpAuthHandlerDigest(int nonce_count)
: stale_(false),
algorithm_(ALGORITHM_UNSPECIFIED),
- qop_(0),
+ qop_(QOP_UNSPECIFIED),
nonce_count_(nonce_count) {
}
@@ -308,12 +311,13 @@
}
} else if (LowerCaseEqualsASCII(name, "qop")) {
// Parse the comma separated list of qops.
+ // auth is the only supported qop, and all other values are ignored.
HttpUtil::ValuesIterator qop_values(value.begin(), value.end(), ',');
+ qop_ = QOP_UNSPECIFIED;
while (qop_values.GetNext()) {
if (LowerCaseEqualsASCII(qop_values.value(), "auth")) {
- qop_ |= QOP_AUTH;
- } else if (LowerCaseEqualsASCII(qop_values.value(), "auth-int")) {
- qop_ |= QOP_AUTH_INT;
+ qop_ = QOP_AUTH;
+ break;
}
}
} else {
« no previous file with comments | « net/http/http_auth_handler_digest.h ('k') | net/http/http_auth_handler_digest_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698