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_NTLM_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ |
6 #define NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 // This contains the portable and the SSPI implementations for NTLM. | 10 // This contains the portable and the SSPI implementations for NTLM. |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Code for handling HTTP NTLM authentication. | 36 // Code for handling HTTP NTLM authentication. |
37 class NET_EXPORT_PRIVATE HttpAuthHandlerNTLM : public HttpAuthHandler { | 37 class NET_EXPORT_PRIVATE HttpAuthHandlerNTLM : public HttpAuthHandler { |
38 public: | 38 public: |
39 class Factory : public HttpAuthHandlerFactory { | 39 class Factory : public HttpAuthHandlerFactory { |
40 public: | 40 public: |
41 Factory(); | 41 Factory(); |
42 ~Factory() override; | 42 ~Factory() override; |
43 | 43 |
44 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 44 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
45 HttpAuth::Target target, | 45 HttpAuth::Target target, |
46 const GURL& origin, | 46 const url::Origin& origin, |
47 CreateReason reason, | 47 CreateReason reason, |
48 int digest_nonce_count, | 48 int digest_nonce_count, |
49 const BoundNetLog& net_log, | 49 const BoundNetLog& net_log, |
50 scoped_ptr<HttpAuthHandler>* handler) override; | 50 scoped_ptr<HttpAuthHandler>* handler) override; |
51 #if defined(NTLM_SSPI) | 51 #if defined(NTLM_SSPI) |
52 // Set the SSPILibrary to use. Typically the only callers which need to use | 52 // Set the SSPILibrary to use. Typically the only callers which need to use |
53 // this are unit tests which pass in a mocked-out version of the SSPI | 53 // this are unit tests which pass in a mocked-out version of the SSPI |
54 // library. After the call |sspi_library| will be owned by this Factory and | 54 // library. After the call |sspi_library| will be owned by this Factory and |
55 // will be destroyed when the Factory is destroyed. | 55 // will be destroyed when the Factory is destroyed. |
56 void set_sspi_library(SSPILibrary* sspi_library) { | 56 void set_sspi_library(SSPILibrary* sspi_library) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 HttpAuthChallengeTokenizer* tok, bool initial_challenge); | 137 HttpAuthChallengeTokenizer* tok, bool initial_challenge); |
138 | 138 |
139 // Given an input token received from the server, generate the next output | 139 // Given an input token received from the server, generate the next output |
140 // token to be sent to the server. | 140 // token to be sent to the server. |
141 int GetNextToken(const void* in_token, | 141 int GetNextToken(const void* in_token, |
142 uint32 in_token_len, | 142 uint32 in_token_len, |
143 void** out_token, | 143 void** out_token, |
144 uint32* out_token_len); | 144 uint32* out_token_len); |
145 | 145 |
146 // Create an NTLM SPN to identify the |origin| server. | 146 // Create an NTLM SPN to identify the |origin| server. |
147 static std::string CreateSPN(const GURL& origin); | 147 static std::string CreateSPN(const url::Origin& origin); |
148 | 148 |
149 #if defined(NTLM_SSPI) | 149 #if defined(NTLM_SSPI) |
150 HttpAuthSSPI auth_sspi_; | 150 HttpAuthSSPI auth_sspi_; |
151 #endif | 151 #endif |
152 | 152 |
153 #if defined(NTLM_PORTABLE) | 153 #if defined(NTLM_PORTABLE) |
154 static GenerateRandomProc generate_random_proc_; | 154 static GenerateRandomProc generate_random_proc_; |
155 static HostNameProc get_host_name_proc_; | 155 static HostNameProc get_host_name_proc_; |
156 #endif | 156 #endif |
157 | 157 |
158 base::string16 domain_; | 158 base::string16 domain_; |
159 AuthCredentials credentials_; | 159 AuthCredentials credentials_; |
160 | 160 |
161 // The base64-encoded string following "NTLM" in the "WWW-Authenticate" or | 161 // The base64-encoded string following "NTLM" in the "WWW-Authenticate" or |
162 // "Proxy-Authenticate" response header. | 162 // "Proxy-Authenticate" response header. |
163 std::string auth_data_; | 163 std::string auth_data_; |
164 | 164 |
165 #if defined(NTLM_SSPI) | 165 #if defined(NTLM_SSPI) |
166 URLSecurityManager* url_security_manager_; | 166 URLSecurityManager* url_security_manager_; |
167 #endif | 167 #endif |
168 }; | 168 }; |
169 | 169 |
170 } // namespace net | 170 } // namespace net |
171 | 171 |
172 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ | 172 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ |
OLD | NEW |