OLD | NEW |
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 #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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Returns true on success. | 138 // Returns true on success. |
139 bool ParseChallenge(HttpAuth::ChallengeTokenizer* tok); | 139 bool ParseChallenge(HttpAuth::ChallengeTokenizer* tok); |
140 | 140 |
141 // Given an input token received from the server, generate the next output | 141 // Given an input token received from the server, generate the next output |
142 // token to be sent to the server. | 142 // token to be sent to the server. |
143 int GetNextToken(const void* in_token, | 143 int GetNextToken(const void* in_token, |
144 uint32 in_token_len, | 144 uint32 in_token_len, |
145 void** out_token, | 145 void** out_token, |
146 uint32* out_token_len); | 146 uint32* out_token_len); |
147 | 147 |
| 148 // Create an NTLM SPN to identify the |origin| server. |
| 149 static std::wstring CreateSPN(const GURL& origin); |
| 150 |
148 #if defined(NTLM_SSPI) | 151 #if defined(NTLM_SSPI) |
149 HttpAuthSSPI auth_sspi_; | 152 HttpAuthSSPI auth_sspi_; |
150 #endif | 153 #endif |
151 | 154 |
152 #if defined(NTLM_PORTABLE) | 155 #if defined(NTLM_PORTABLE) |
153 static GenerateRandomProc generate_random_proc_; | 156 static GenerateRandomProc generate_random_proc_; |
154 static HostNameProc get_host_name_proc_; | 157 static HostNameProc get_host_name_proc_; |
155 #endif | 158 #endif |
156 | 159 |
157 string16 domain_; | 160 string16 domain_; |
158 string16 username_; | 161 string16 username_; |
159 string16 password_; | 162 string16 password_; |
160 | 163 |
161 // The base64-encoded string following "NTLM" in the "WWW-Authenticate" or | 164 // The base64-encoded string following "NTLM" in the "WWW-Authenticate" or |
162 // "Proxy-Authenticate" response header. | 165 // "Proxy-Authenticate" response header. |
163 std::string auth_data_; | 166 std::string auth_data_; |
164 }; | 167 }; |
165 | 168 |
166 } // namespace net | 169 } // namespace net |
167 | 170 |
168 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ | 171 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ |
OLD | NEW |