| OLD | NEW |
| 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 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "net/base/address_list.h" | 12 #include "net/base/address_list.h" |
| 13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
| 14 #include "net/dns/host_resolver.h" |
| 14 #include "net/http/http_auth_handler.h" | 15 #include "net/http/http_auth_handler.h" |
| 15 #include "net/http/http_auth_handler_factory.h" | 16 #include "net/http/http_auth_handler_factory.h" |
| 16 | 17 |
| 17 #if defined(OS_ANDROID) | 18 #if defined(OS_ANDROID) |
| 18 #include "net/android/http_auth_negotiate_android.h" | 19 #include "net/android/http_auth_negotiate_android.h" |
| 19 #elif defined(OS_WIN) | 20 #elif defined(OS_WIN) |
| 20 #include "net/http/http_auth_sspi_win.h" | 21 #include "net/http/http_auth_sspi_win.h" |
| 21 #elif defined(OS_POSIX) | 22 #elif defined(OS_POSIX) |
| 22 #include "net/http/http_auth_gssapi_posix.h" | 23 #include "net/http/http_auth_gssapi_posix.h" |
| 23 #endif | 24 #endif |
| 24 | 25 |
| 25 namespace net { | 26 namespace net { |
| 26 | 27 |
| 27 class HttpAuthPreferences; | 28 class HttpAuthPreferences; |
| 28 class HostResolver; | |
| 29 class SingleRequestHostResolver; | |
| 30 | 29 |
| 31 // Handler for WWW-Authenticate: Negotiate protocol. | 30 // Handler for WWW-Authenticate: Negotiate protocol. |
| 32 // | 31 // |
| 33 // See http://tools.ietf.org/html/rfc4178 and http://tools.ietf.org/html/rfc4559 | 32 // See http://tools.ietf.org/html/rfc4178 and http://tools.ietf.org/html/rfc4559 |
| 34 // for more information about the protocol. | 33 // for more information about the protocol. |
| 35 | 34 |
| 36 class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { | 35 class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { |
| 37 public: | 36 public: |
| 38 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
| 39 typedef net::android::HttpAuthNegotiateAndroid AuthSystem; | 38 typedef net::android::HttpAuthNegotiateAndroid AuthSystem; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 int DoResolveCanonicalNameComplete(int rv); | 129 int DoResolveCanonicalNameComplete(int rv); |
| 131 int DoGenerateAuthToken(); | 130 int DoGenerateAuthToken(); |
| 132 int DoGenerateAuthTokenComplete(int rv); | 131 int DoGenerateAuthTokenComplete(int rv); |
| 133 bool CanDelegate() const; | 132 bool CanDelegate() const; |
| 134 | 133 |
| 135 AuthSystem auth_system_; | 134 AuthSystem auth_system_; |
| 136 HostResolver* const resolver_; | 135 HostResolver* const resolver_; |
| 137 | 136 |
| 138 // Members which are needed for DNS lookup + SPN. | 137 // Members which are needed for DNS lookup + SPN. |
| 139 AddressList address_list_; | 138 AddressList address_list_; |
| 140 std::unique_ptr<SingleRequestHostResolver> single_resolve_; | 139 std::unique_ptr<net::HostResolver::Request> request_; |
| 141 | 140 |
| 142 // Things which should be consistent after first call to GenerateAuthToken. | 141 // Things which should be consistent after first call to GenerateAuthToken. |
| 143 bool already_called_; | 142 bool already_called_; |
| 144 bool has_credentials_; | 143 bool has_credentials_; |
| 145 AuthCredentials credentials_; | 144 AuthCredentials credentials_; |
| 146 std::string spn_; | 145 std::string spn_; |
| 147 std::string channel_bindings_; | 146 std::string channel_bindings_; |
| 148 | 147 |
| 149 // Things which vary each round. | 148 // Things which vary each round. |
| 150 CompletionCallback callback_; | 149 CompletionCallback callback_; |
| 151 std::string* auth_token_; | 150 std::string* auth_token_; |
| 152 | 151 |
| 153 State next_state_; | 152 State next_state_; |
| 154 | 153 |
| 155 const HttpAuthPreferences* http_auth_preferences_; | 154 const HttpAuthPreferences* http_auth_preferences_; |
| 156 }; | 155 }; |
| 157 | 156 |
| 158 } // namespace net | 157 } // namespace net |
| 159 | 158 |
| 160 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 159 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| OLD | NEW |