| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( | 111 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 112 HttpAuth::ChallengeTokenizer* challenge); | 112 HttpAuth::ChallengeTokenizer* challenge); |
| 113 | 113 |
| 114 protected: | 114 protected: |
| 115 // This function acquires a credentials handle in the SSPI implementation. | 115 // This function acquires a credentials handle in the SSPI implementation. |
| 116 // It does nothing in the portable implementation. | 116 // It does nothing in the portable implementation. |
| 117 int InitializeBeforeFirstChallenge(); | 117 int InitializeBeforeFirstChallenge(); |
| 118 | 118 |
| 119 virtual bool Init(HttpAuth::ChallengeTokenizer* tok); | 119 virtual bool Init(HttpAuth::ChallengeTokenizer* tok); |
| 120 | 120 |
| 121 virtual int GenerateAuthTokenImpl(const string16* username, | 121 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
| 122 const string16* password, | |
| 123 const HttpRequestInfo* request, | 122 const HttpRequestInfo* request, |
| 124 OldCompletionCallback* callback, | 123 OldCompletionCallback* callback, |
| 125 std::string* auth_token); | 124 std::string* auth_token); |
| 126 | 125 |
| 127 private: | 126 private: |
| 128 virtual ~HttpAuthHandlerNTLM(); | 127 virtual ~HttpAuthHandlerNTLM(); |
| 129 | 128 |
| 130 #if defined(NTLM_PORTABLE) | 129 #if defined(NTLM_PORTABLE) |
| 131 // For unit tests to override the GenerateRandom and GetHostName functions. | 130 // For unit tests to override the GenerateRandom and GetHostName functions. |
| 132 // Returns the old function. | 131 // Returns the old function. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 151 #if defined(NTLM_SSPI) | 150 #if defined(NTLM_SSPI) |
| 152 HttpAuthSSPI auth_sspi_; | 151 HttpAuthSSPI auth_sspi_; |
| 153 #endif | 152 #endif |
| 154 | 153 |
| 155 #if defined(NTLM_PORTABLE) | 154 #if defined(NTLM_PORTABLE) |
| 156 static GenerateRandomProc generate_random_proc_; | 155 static GenerateRandomProc generate_random_proc_; |
| 157 static HostNameProc get_host_name_proc_; | 156 static HostNameProc get_host_name_proc_; |
| 158 #endif | 157 #endif |
| 159 | 158 |
| 160 string16 domain_; | 159 string16 domain_; |
| 161 string16 username_; | 160 AuthCredentials credentials_; |
| 162 string16 password_; | |
| 163 | 161 |
| 164 // The base64-encoded string following "NTLM" in the "WWW-Authenticate" or | 162 // The base64-encoded string following "NTLM" in the "WWW-Authenticate" or |
| 165 // "Proxy-Authenticate" response header. | 163 // "Proxy-Authenticate" response header. |
| 166 std::string auth_data_; | 164 std::string auth_data_; |
| 167 | 165 |
| 168 #if defined(NTLM_SSPI) | 166 #if defined(NTLM_SSPI) |
| 169 URLSecurityManager* url_security_manager_; | 167 URLSecurityManager* url_security_manager_; |
| 170 #endif | 168 #endif |
| 171 }; | 169 }; |
| 172 | 170 |
| 173 } // namespace net | 171 } // namespace net |
| 174 | 172 |
| 175 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ | 173 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ |
| OLD | NEW |