summaryrefslogtreecommitdiffstats
path: root/net/http/http_auth_cache.h
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 13:41:36 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 13:41:36 +0000
commitc4857e0589febfab0adcd6fa8d88b2f6530b82c6 (patch)
treeb8a65128610743cfd646deb4a40ef96e6972bf60 /net/http/http_auth_cache.h
parentb16b2a9d2f8107b6803c990cebf92f910ae238d5 (diff)
downloadchromium_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.h')
-rw-r--r--net/http/http_auth_cache.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h
index 3716646..764a563 100644
--- a/net/http/http_auth_cache.h
+++ b/net/http/http_auth_cache.h
@@ -80,6 +80,16 @@ class HttpAuthCache {
const string16& username,
const string16& password);
+ // Updates a stale digest entry on server |origin| for realm |realm| and
+ // scheme |scheme|. The cached auth challenge is replaced with
+ // |auth_challenge| and the nonce count is reset.
+ // |UpdateStaleChallenge()| returns true if a matching entry exists in the
+ // cache, false otherwise.
+ bool UpdateStaleChallenge(const GURL& origin,
+ const std::string& realm,
+ const std::string& scheme,
+ const std::string& auth_challenge);
+
// Prevent unbounded memory growth. These are safeguards for abuse; it is
// not expected that the limits will be reached in ordinary usage.
// This also defines the worst-case lookup times (which grow linearly
@@ -128,6 +138,8 @@ class HttpAuthCache::Entry {
return ++nonce_count_;
}
+ void UpdateStaleChallenge(const std::string& auth_challenge);
+
private:
friend class HttpAuthCache;
FRIEND_TEST_ALL_PREFIXES(HttpAuthCacheTest, AddPath);