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

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

Issue 4560001: Support specifying the GSSAPI library that will be used. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: address comments; port to ToT Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 HttpAuthHandlerNegotiate::Factory::Factory() 270 HttpAuthHandlerNegotiate::Factory::Factory()
271 : disable_cname_lookup_(false), 271 : disable_cname_lookup_(false),
272 use_port_(false), 272 use_port_(false),
273 #if defined(OS_WIN) 273 #if defined(OS_WIN)
274 max_token_length_(0), 274 max_token_length_(0),
275 first_creation_(true), 275 first_creation_(true),
276 is_unsupported_(false), 276 is_unsupported_(false),
277 auth_library_(SSPILibrary::GetDefault()) { 277 auth_library_(SSPILibrary::GetDefault()) {
278 #elif defined(OS_POSIX) 278 #elif defined(OS_POSIX)
279 auth_library_(GSSAPILibrary::GetDefault()) { 279 auth_library_(NULL) {
280 #endif 280 #endif
281 } 281 }
282 282
283 HttpAuthHandlerNegotiate::Factory::~Factory() { 283 HttpAuthHandlerNegotiate::Factory::~Factory() {
284 } 284 }
285 285
286 void HttpAuthHandlerNegotiate::Factory::set_host_resolver( 286 void HttpAuthHandlerNegotiate::Factory::set_host_resolver(
287 HostResolver* resolver) { 287 HostResolver* resolver) {
288 resolver_ = resolver; 288 resolver_ = resolver;
289 } 289 }
(...skipping 13 matching lines...) Expand all
303 int rv = DetermineMaxTokenLength(auth_library_, NEGOSSP_NAME, 303 int rv = DetermineMaxTokenLength(auth_library_, NEGOSSP_NAME,
304 &max_token_length_); 304 &max_token_length_);
305 if (rv == ERR_UNSUPPORTED_AUTH_SCHEME) 305 if (rv == ERR_UNSUPPORTED_AUTH_SCHEME)
306 is_unsupported_ = true; 306 is_unsupported_ = true;
307 if (rv != OK) 307 if (rv != OK)
308 return rv; 308 return rv;
309 } 309 }
310 // TODO(cbentzel): Move towards model of parsing in the factory 310 // TODO(cbentzel): Move towards model of parsing in the factory
311 // method and only constructing when valid. 311 // method and only constructing when valid.
312 scoped_ptr<HttpAuthHandler> tmp_handler( 312 scoped_ptr<HttpAuthHandler> tmp_handler(
313 new HttpAuthHandlerNegotiate(auth_library_, max_token_length_, 313 new HttpAuthHandlerNegotiate(auth_library_.get(), max_token_length_,
314 url_security_manager(), resolver_, 314 url_security_manager(), resolver_,
315 disable_cname_lookup_, use_port_)); 315 disable_cname_lookup_, use_port_));
316 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) 316 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log))
317 return ERR_INVALID_RESPONSE; 317 return ERR_INVALID_RESPONSE;
318 handler->swap(tmp_handler); 318 handler->swap(tmp_handler);
319 return OK; 319 return OK;
320 #elif defined(OS_POSIX) 320 #elif defined(OS_POSIX)
321 // TODO(ahendrickson): Move towards model of parsing in the factory 321 // TODO(ahendrickson): Move towards model of parsing in the factory
322 // method and only constructing when valid. 322 // method and only constructing when valid.
323 scoped_ptr<HttpAuthHandler> tmp_handler( 323 scoped_ptr<HttpAuthHandler> tmp_handler(
324 new HttpAuthHandlerNegotiate(auth_library_, url_security_manager(), 324 new HttpAuthHandlerNegotiate(auth_library_.get(), url_security_manager(),
325 resolver_, disable_cname_lookup_, 325 resolver_, disable_cname_lookup_,
326 use_port_)); 326 use_port_));
327 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) 327 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log))
328 return ERR_INVALID_RESPONSE; 328 return ERR_INVALID_RESPONSE;
329 handler->swap(tmp_handler); 329 handler->swap(tmp_handler);
330 return OK; 330 return OK;
331 #endif 331 #endif
332 } 332 }
333 333
334 } // namespace net 334 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698