diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 13:41:36 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 13:41:36 +0000 |
commit | c4857e0589febfab0adcd6fa8d88b2f6530b82c6 (patch) | |
tree | b8a65128610743cfd646deb4a40ef96e6972bf60 /net/http/http_auth_cache.cc | |
parent | b16b2a9d2f8107b6803c990cebf92f910ae238d5 (diff) | |
download | chromium_src-c4857e0589febfab0adcd6fa8d88b2f6530b82c6.zip chromium_src-c4857e0589febfab0adcd6fa8d88b2f6530b82c6.tar.gz chromium_src-c4857e0589febfab0adcd6fa8d88b2f6530b82c6.tar.bz2 |
Don't evict username/password when handling "stale" digest authentication challenges.
Stale challenges indicate that the cached nonce (and associated nonce_count) are no longer valid.
BUG=53353
TEST=Use a digest authentication Squid proxy with default settings (which complain about stale nonce's). Ensure that there are no username/password prompts after getting a stale challenge. Also, net_unittests.
Review URL: http://codereview.chromium.org/3421005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59643 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_cache.cc')
-rw-r--r-- | net/http/http_auth_cache.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/http/http_auth_cache.cc b/net/http/http_auth_cache.cc index 5b1a275..7423115 100644 --- a/net/http/http_auth_cache.cc +++ b/net/http/http_auth_cache.cc @@ -166,6 +166,12 @@ bool HttpAuthCache::Entry::HasEnclosingPath(const std::string& dir) { return false; } +void HttpAuthCache::Entry::UpdateStaleChallenge( + const std::string& auth_challenge) { + auth_challenge_ = auth_challenge; + nonce_count_ = 1; +} + bool HttpAuthCache::Remove(const GURL& origin, const std::string& realm, const std::string& scheme, @@ -184,4 +190,15 @@ bool HttpAuthCache::Remove(const GURL& origin, return false; } +bool HttpAuthCache::UpdateStaleChallenge(const GURL& origin, + const std::string& realm, + const std::string& scheme, + const std::string& auth_challenge) { + HttpAuthCache::Entry* entry = Lookup(origin, realm, scheme); + if (!entry) + return false; + entry->UpdateStaleChallenge(auth_challenge); + return true; +} + } // namespace net |