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

Side by Side Diff: net/http/http_auth_handler_negotiate.cc

Issue 7748033: Don't try to use explicit credentials with schemes that don't support it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unit test Created 9 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_auth_handler_negotiate.h ('k') | net/http/http_auth_sspi_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_auth_handler_negotiate.h" 5 #include "net/http/http_auth_handler_negotiate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 bool HttpAuthHandlerNegotiate::AllowsDefaultCredentials() { 177 bool HttpAuthHandlerNegotiate::AllowsDefaultCredentials() {
178 if (target_ == HttpAuth::AUTH_PROXY) 178 if (target_ == HttpAuth::AUTH_PROXY)
179 return true; 179 return true;
180 if (!url_security_manager_) 180 if (!url_security_manager_)
181 return false; 181 return false;
182 return url_security_manager_->CanUseDefaultCredentials(origin_); 182 return url_security_manager_->CanUseDefaultCredentials(origin_);
183 } 183 }
184 184
185 bool HttpAuthHandlerNegotiate::AllowsExplicitCredentials() {
186 return auth_system_.AllowsExplicitCredentials();
187 }
188
185 // The Negotiate challenge header looks like: 189 // The Negotiate challenge header looks like:
186 // WWW-Authenticate: NEGOTIATE auth-data 190 // WWW-Authenticate: NEGOTIATE auth-data
187 bool HttpAuthHandlerNegotiate::Init(HttpAuth::ChallengeTokenizer* challenge) { 191 bool HttpAuthHandlerNegotiate::Init(HttpAuth::ChallengeTokenizer* challenge) {
188 #if defined(OS_POSIX) 192 #if defined(OS_POSIX)
189 if (!auth_system_.Init()) { 193 if (!auth_system_.Init()) {
190 VLOG(1) << "can't initialize GSSAPI library"; 194 VLOG(1) << "can't initialize GSSAPI library";
191 return false; 195 return false;
192 } 196 }
193 // GSSAPI does not provide a way to enter username/password to 197 // GSSAPI does not provide a way to enter username/password to
194 // obtain a TGT. If the default credentials are not allowed for 198 // obtain a TGT. If the default credentials are not allowed for
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 bool HttpAuthHandlerNegotiate::CanDelegate() const { 334 bool HttpAuthHandlerNegotiate::CanDelegate() const {
331 // TODO(cbentzel): Should delegation be allowed on proxies? 335 // TODO(cbentzel): Should delegation be allowed on proxies?
332 if (target_ == HttpAuth::AUTH_PROXY) 336 if (target_ == HttpAuth::AUTH_PROXY)
333 return false; 337 return false;
334 if (!url_security_manager_) 338 if (!url_security_manager_)
335 return false; 339 return false;
336 return url_security_manager_->CanDelegate(origin_); 340 return url_security_manager_->CanDelegate(origin_);
337 } 341 }
338 342
339 } // namespace net 343 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_negotiate.h ('k') | net/http/http_auth_sspi_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698