| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Code for handling HTTP NTLM authentication. | 38 // Code for handling HTTP NTLM authentication. |
| 39 class NET_EXPORT_PRIVATE HttpAuthHandlerNTLM : public HttpAuthHandler { | 39 class NET_EXPORT_PRIVATE HttpAuthHandlerNTLM : public HttpAuthHandler { |
| 40 public: | 40 public: |
| 41 class Factory : public HttpAuthHandlerFactory { | 41 class Factory : public HttpAuthHandlerFactory { |
| 42 public: | 42 public: |
| 43 Factory(); | 43 Factory(); |
| 44 ~Factory() override; | 44 ~Factory() override; |
| 45 | 45 |
| 46 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 46 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
| 47 HttpAuth::Target target, | 47 HttpAuth::Target target, |
| 48 const SSLInfo& ssl_info, |
| 48 const GURL& origin, | 49 const GURL& origin, |
| 49 CreateReason reason, | 50 CreateReason reason, |
| 50 int digest_nonce_count, | 51 int digest_nonce_count, |
| 51 const BoundNetLog& net_log, | 52 const BoundNetLog& net_log, |
| 52 scoped_ptr<HttpAuthHandler>* handler) override; | 53 scoped_ptr<HttpAuthHandler>* handler) override; |
| 53 #if defined(NTLM_SSPI) | 54 #if defined(NTLM_SSPI) |
| 54 // Set the SSPILibrary to use. Typically the only callers which need to use | 55 // Set the SSPILibrary to use. Typically the only callers which need to use |
| 55 // this are unit tests which pass in a mocked-out version of the SSPI | 56 // this are unit tests which pass in a mocked-out version of the SSPI |
| 56 // library. After the call |sspi_library| will be owned by this Factory and | 57 // library. After the call |sspi_library| will be owned by this Factory and |
| 57 // will be destroyed when the Factory is destroyed. | 58 // will be destroyed when the Factory is destroyed. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 bool AllowsDefaultCredentials() override; | 111 bool AllowsDefaultCredentials() override; |
| 111 | 112 |
| 112 HttpAuth::AuthorizationResult HandleAnotherChallenge( | 113 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 113 HttpAuthChallengeTokenizer* challenge) override; | 114 HttpAuthChallengeTokenizer* challenge) override; |
| 114 | 115 |
| 115 protected: | 116 protected: |
| 116 // This function acquires a credentials handle in the SSPI implementation. | 117 // This function acquires a credentials handle in the SSPI implementation. |
| 117 // It does nothing in the portable implementation. | 118 // It does nothing in the portable implementation. |
| 118 int InitializeBeforeFirstChallenge(); | 119 int InitializeBeforeFirstChallenge(); |
| 119 | 120 |
| 120 bool Init(HttpAuthChallengeTokenizer* tok) override; | 121 bool Init(HttpAuthChallengeTokenizer* tok, const SSLInfo& ssl_info) override; |
| 121 | 122 |
| 122 int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 123 int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
| 123 const HttpRequestInfo* request, | 124 const HttpRequestInfo* request, |
| 124 const CompletionCallback& callback, | 125 const CompletionCallback& callback, |
| 125 std::string* auth_token) override; | 126 std::string* auth_token) override; |
| 126 | 127 |
| 127 private: | 128 private: |
| 128 ~HttpAuthHandlerNTLM() override; | 129 ~HttpAuthHandlerNTLM() override; |
| 129 | 130 |
| 130 #if defined(NTLM_PORTABLE) | 131 #if defined(NTLM_PORTABLE) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 152 HttpAuthSSPI auth_sspi_; | 153 HttpAuthSSPI auth_sspi_; |
| 153 #endif | 154 #endif |
| 154 | 155 |
| 155 #if defined(NTLM_PORTABLE) | 156 #if defined(NTLM_PORTABLE) |
| 156 static GenerateRandomProc generate_random_proc_; | 157 static GenerateRandomProc generate_random_proc_; |
| 157 static HostNameProc get_host_name_proc_; | 158 static HostNameProc get_host_name_proc_; |
| 158 #endif | 159 #endif |
| 159 | 160 |
| 160 base::string16 domain_; | 161 base::string16 domain_; |
| 161 AuthCredentials credentials_; | 162 AuthCredentials credentials_; |
| 163 std::string channel_bindings_; |
| 162 | 164 |
| 163 // The base64-encoded string following "NTLM" in the "WWW-Authenticate" or | 165 // The base64-encoded string following "NTLM" in the "WWW-Authenticate" or |
| 164 // "Proxy-Authenticate" response header. | 166 // "Proxy-Authenticate" response header. |
| 165 std::string auth_data_; | 167 std::string auth_data_; |
| 166 | 168 |
| 167 #if defined(NTLM_SSPI) | 169 #if defined(NTLM_SSPI) |
| 168 const HttpAuthPreferences* http_auth_preferences_; | 170 const HttpAuthPreferences* http_auth_preferences_; |
| 169 #endif | 171 #endif |
| 170 }; | 172 }; |
| 171 | 173 |
| 172 } // namespace net | 174 } // namespace net |
| 173 | 175 |
| 174 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ | 176 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ |
| OLD | NEW |