| 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 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void set_host_resolver(HostResolver* host_resolver); | 64 void set_host_resolver(HostResolver* host_resolver); |
| 65 | 65 |
| 66 // Sets the system library to use, thereby assuming ownership of | 66 // Sets the system library to use, thereby assuming ownership of |
| 67 // |auth_library|. | 67 // |auth_library|. |
| 68 void set_library(AuthLibrary* auth_library) { | 68 void set_library(AuthLibrary* auth_library) { |
| 69 auth_library_.reset(auth_library); | 69 auth_library_.reset(auth_library); |
| 70 } | 70 } |
| 71 | 71 |
| 72 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 72 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
| 73 HttpAuth::Target target, | 73 HttpAuth::Target target, |
| 74 const GURL& origin, | 74 const url::Origin& origin, |
| 75 CreateReason reason, | 75 CreateReason reason, |
| 76 int digest_nonce_count, | 76 int digest_nonce_count, |
| 77 const BoundNetLog& net_log, | 77 const BoundNetLog& net_log, |
| 78 scoped_ptr<HttpAuthHandler>* handler) override; | 78 scoped_ptr<HttpAuthHandler>* handler) override; |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 bool disable_cname_lookup_; | 81 bool disable_cname_lookup_; |
| 82 bool use_port_; | 82 bool use_port_; |
| 83 HostResolver* resolver_; | 83 HostResolver* resolver_; |
| 84 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
| 85 ULONG max_token_length_; | 85 ULONG max_token_length_; |
| 86 bool first_creation_; | 86 bool first_creation_; |
| 87 #endif | 87 #endif |
| 88 bool is_unsupported_; | 88 bool is_unsupported_; |
| 89 scoped_ptr<AuthLibrary> auth_library_; | 89 scoped_ptr<AuthLibrary> auth_library_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 HttpAuthHandlerNegotiate(AuthLibrary* sspi_library, | 92 HttpAuthHandlerNegotiate(AuthLibrary* sspi_library, |
| 93 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
| 94 ULONG max_token_length, | 94 ULONG max_token_length, |
| 95 #endif | 95 #endif |
| 96 URLSecurityManager* url_security_manager, | 96 URLSecurityManager* url_security_manager, |
| 97 HostResolver* host_resolver, | 97 HostResolver* host_resolver, |
| 98 bool disable_cname_lookup, | 98 bool disable_cname_lookup, |
| 99 bool use_port); | 99 bool use_port); |
| 100 | 100 |
| 101 ~HttpAuthHandlerNegotiate() override; | 101 ~HttpAuthHandlerNegotiate() override; |
| 102 | 102 |
| 103 // These are public for unit tests | 103 // These are public for unit tests |
| 104 std::string CreateSPN(const AddressList& address_list, const GURL& orign); | 104 std::string CreateSPN(const AddressList& address_list, |
| 105 const url::Origin& orign); |
| 105 const std::string& spn() const { return spn_; } | 106 const std::string& spn() const { return spn_; } |
| 106 | 107 |
| 107 // HttpAuthHandler: | 108 // HttpAuthHandler: |
| 108 HttpAuth::AuthorizationResult HandleAnotherChallenge( | 109 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 109 HttpAuthChallengeTokenizer* challenge) override; | 110 HttpAuthChallengeTokenizer* challenge) override; |
| 110 bool NeedsIdentity() override; | 111 bool NeedsIdentity() override; |
| 111 bool AllowsDefaultCredentials() override; | 112 bool AllowsDefaultCredentials() override; |
| 112 bool AllowsExplicitCredentials() override; | 113 bool AllowsExplicitCredentials() override; |
| 113 | 114 |
| 114 protected: | 115 protected: |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 std::string* auth_token_; | 159 std::string* auth_token_; |
| 159 | 160 |
| 160 State next_state_; | 161 State next_state_; |
| 161 | 162 |
| 162 const URLSecurityManager* url_security_manager_; | 163 const URLSecurityManager* url_security_manager_; |
| 163 }; | 164 }; |
| 164 | 165 |
| 165 } // namespace net | 166 } // namespace net |
| 166 | 167 |
| 167 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 168 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| OLD | NEW |