diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 15:18:12 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 15:18:12 +0000 |
commit | 3c32c5f717bea6e39acaf5f6fd1bcdc9e33ec9d6 (patch) | |
tree | 692232f5006fdc0a2ab8dd20970048961b82c98b /net/http/http_auth_handler_digest.cc | |
parent | 0ed9468567ab680c92db9ac6660f484cbd5cad2c (diff) | |
download | chromium_src-3c32c5f717bea6e39acaf5f6fd1bcdc9e33ec9d6.zip chromium_src-3c32c5f717bea6e39acaf5f6fd1bcdc9e33ec9d6.tar.gz chromium_src-3c32c5f717bea6e39acaf5f6fd1bcdc9e33ec9d6.tar.bz2 |
Digest Authentication: Test that "nc" is incremented for same "nonce".
If the client generates multiple Authorization headers for the same server (or proxy) authenticate header the "nc" (nonce-count) field should be incremented. This tends to happen when preemptive Authentication headers are sent using the previous Authenticate challenge.
BUG=NONE
TEST=net_unittests --gtest_filter="HttpNetworkTransactionTest.DigestPreAuthNonceCount"
Review URL: http://codereview.chromium.org/2112007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47514 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_handler_digest.cc')
-rw-r--r-- | net/http/http_auth_handler_digest.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc index f7aea5b..107cfcf 100644 --- a/net/http/http_auth_handler_digest.cc +++ b/net/http/http_auth_handler_digest.cc @@ -45,10 +45,15 @@ namespace net { //=====================+==========================================+ +//static +bool HttpAuthHandlerDigest::fixed_cnonce_ = false; + // static std::string HttpAuthHandlerDigest::GenerateNonce() { // This is how mozilla generates their cnonce -- a 16 digit hex string. static const char domain[] = "0123456789abcdef"; + if (fixed_cnonce_) + return std::string(domain); std::string cnonce; cnonce.reserve(16); for (int i = 0; i < 16; ++i) |