diff options
author | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 20:22:30 +0000 |
---|---|---|
committer | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 20:22:30 +0000 |
commit | b4955e7d58c7bb329b6dddc6f33199fe17c7bfa1 (patch) | |
tree | 0685b539d6b9b4e438f82d27422d859c35bfb816 /net/http/http_auth_handler_negotiate_win.cc | |
parent | 3a06fa5487850ef494aea79f5b46a97d06d31a4f (diff) | |
download | chromium_src-b4955e7d58c7bb329b6dddc6f33199fe17c7bfa1.zip chromium_src-b4955e7d58c7bb329b6dddc6f33199fe17c7bfa1.tar.gz chromium_src-b4955e7d58c7bb329b6dddc6f33199fe17c7bfa1.tar.bz2 |
Refactored to pass the URLSecurityManager via the HttpAuthFactory class to the HttpNetworkSession.
Fixed a bug where the command-line whitelist was not being propagated down to the URLSecurityManager.
BUG=29596
TEST=None
Review URL: http://codereview.chromium.org/1634005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_handler_negotiate_win.cc')
-rw-r--r-- | net/http/http_auth_handler_negotiate_win.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/net/http/http_auth_handler_negotiate_win.cc b/net/http/http_auth_handler_negotiate_win.cc index 6c6e767..4be5923 100644 --- a/net/http/http_auth_handler_negotiate_win.cc +++ b/net/http/http_auth_handler_negotiate_win.cc @@ -9,19 +9,23 @@ #include "net/base/host_resolver.h" #include "net/base/net_errors.h" #include "net/http/http_auth_filter.h" +#include "net/http/url_security_manager.h" namespace net { -HttpAuthHandlerNegotiate::HttpAuthHandlerNegotiate(SSPILibrary* library, - ULONG max_token_length, - bool disable_cname_lookup, - bool use_port) +HttpAuthHandlerNegotiate::HttpAuthHandlerNegotiate( + SSPILibrary* library, + ULONG max_token_length, + const URLSecurityManager* url_security_manager, + bool disable_cname_lookup, + bool use_port) : auth_sspi_(library, "Negotiate", NEGOSSP_NAME, max_token_length), user_callback_(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(resolve_cname_callback_( this, &HttpAuthHandlerNegotiate::OnResolveCanonicalName)), disable_cname_lookup_(disable_cname_lookup), - use_port_(use_port) { + use_port_(use_port), + url_security_manager_(url_security_manager) { } HttpAuthHandlerNegotiate::~HttpAuthHandlerNegotiate() { @@ -60,8 +64,12 @@ bool HttpAuthHandlerNegotiate::IsFinalRound() { return auth_sspi_.IsFinalRound(); } -bool HttpAuthHandlerNegotiate::SupportsDefaultCredentials() { - return true; +bool HttpAuthHandlerNegotiate::AllowsDefaultCredentials() { + if (target_ == HttpAuth::AUTH_PROXY) + return true; + if (!url_security_manager_) + return false; + return url_security_manager_->CanUseDefaultCredentials(origin_); } bool HttpAuthHandlerNegotiate::NeedsCanonicalName() { @@ -202,6 +210,7 @@ int HttpAuthHandlerNegotiate::Factory::CreateAuthHandler( // method and only constructing when valid. scoped_refptr<HttpAuthHandler> tmp_handler( new HttpAuthHandlerNegotiate(sspi_library_, max_token_length_, + url_security_manager(), disable_cname_lookup_, use_port_)); if (!tmp_handler->InitFromChallenge(challenge, target, origin)) return ERR_INVALID_RESPONSE; |