| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 #elif defined(OS_ANDROID) | 85 #elif defined(OS_ANDROID) |
| 86 if (is_unsupported_ || !http_auth_preferences() || | 86 if (is_unsupported_ || !http_auth_preferences() || |
| 87 http_auth_preferences()->AuthAndroidNegotiateAccountType().empty() || | 87 http_auth_preferences()->AuthAndroidNegotiateAccountType().empty() || |
| 88 reason == CREATE_PREEMPTIVE) | 88 reason == CREATE_PREEMPTIVE) |
| 89 return ERR_UNSUPPORTED_AUTH_SCHEME; | 89 return ERR_UNSUPPORTED_AUTH_SCHEME; |
| 90 // TODO(cbentzel): Move towards model of parsing in the factory | 90 // TODO(cbentzel): Move towards model of parsing in the factory |
| 91 // method and only constructing when valid. | 91 // method and only constructing when valid. |
| 92 std::unique_ptr<HttpAuthHandler> tmp_handler( | 92 std::unique_ptr<HttpAuthHandler> tmp_handler( |
| 93 new HttpAuthHandlerNegotiate(http_auth_preferences(), resolver_)); | 93 new HttpAuthHandlerNegotiate(http_auth_preferences(), resolver_)); |
| 94 #elif defined(OS_POSIX) | 94 #elif defined(OS_POSIX) |
| 95 if (is_unsupported_) | 95 bool allow_gssapi_library_load = true; |
| 96 #if defined(OS_CHROMEOS) |
| 97 allow_gssapi_library_load = http_auth_preferences() && |
| 98 http_auth_preferences()->AllowGssapiLibraryLoad(); |
| 99 #endif |
| 100 if (is_unsupported_ || !allow_gssapi_library_load) |
| 96 return ERR_UNSUPPORTED_AUTH_SCHEME; | 101 return ERR_UNSUPPORTED_AUTH_SCHEME; |
| 97 if (!auth_library_->Init()) { | 102 if (!auth_library_->Init()) { |
| 98 is_unsupported_ = true; | 103 is_unsupported_ = true; |
| 99 return ERR_UNSUPPORTED_AUTH_SCHEME; | 104 return ERR_UNSUPPORTED_AUTH_SCHEME; |
| 100 } | 105 } |
| 101 // TODO(ahendrickson): Move towards model of parsing in the factory | 106 // TODO(ahendrickson): Move towards model of parsing in the factory |
| 102 // method and only constructing when valid. | 107 // method and only constructing when valid. |
| 103 std::unique_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNegotiate( | 108 std::unique_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNegotiate( |
| 104 auth_library_.get(), http_auth_preferences(), resolver_)); | 109 auth_library_.get(), http_auth_preferences(), resolver_)); |
| 105 #endif | 110 #endif |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 bool HttpAuthHandlerNegotiate::CanDelegate() const { | 372 bool HttpAuthHandlerNegotiate::CanDelegate() const { |
| 368 // TODO(cbentzel): Should delegation be allowed on proxies? | 373 // TODO(cbentzel): Should delegation be allowed on proxies? |
| 369 if (target_ == HttpAuth::AUTH_PROXY) | 374 if (target_ == HttpAuth::AUTH_PROXY) |
| 370 return false; | 375 return false; |
| 371 if (!http_auth_preferences_) | 376 if (!http_auth_preferences_) |
| 372 return false; | 377 return false; |
| 373 return http_auth_preferences_->CanDelegate(origin_); | 378 return http_auth_preferences_->CanDelegate(origin_); |
| 374 } | 379 } |
| 375 | 380 |
| 376 } // namespace net | 381 } // namespace net |
| OLD | NEW |