| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 private: | 93 private: |
| 94 GenerateRandomProc old_random_proc_; | 94 GenerateRandomProc old_random_proc_; |
| 95 HostNameProc old_host_name_proc_; | 95 HostNameProc old_host_name_proc_; |
| 96 }; | 96 }; |
| 97 #endif | 97 #endif |
| 98 | 98 |
| 99 #if defined(NTLM_PORTABLE) | 99 #if defined(NTLM_PORTABLE) |
| 100 HttpAuthHandlerNTLM(); | 100 HttpAuthHandlerNTLM(); |
| 101 #endif | 101 #endif |
| 102 #if defined(NTLM_SSPI) | 102 #if defined(NTLM_SSPI) |
| 103 HttpAuthHandlerNTLM(SSPILibrary* sspi_library, ULONG max_token_length, | 103 HttpAuthHandlerNTLM(SSPILibrary* sspi_library, |
| 104 ULONG max_token_length, |
| 104 URLSecurityManager* url_security_manager); | 105 URLSecurityManager* url_security_manager); |
| 105 #endif | 106 #endif |
| 106 | 107 |
| 107 virtual bool NeedsIdentity() OVERRIDE; | 108 virtual bool NeedsIdentity() OVERRIDE; |
| 108 | 109 |
| 109 virtual bool AllowsDefaultCredentials() OVERRIDE; | 110 virtual bool AllowsDefaultCredentials() OVERRIDE; |
| 110 | 111 |
| 111 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( | 112 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 112 HttpAuthChallengeTokenizer* challenge) OVERRIDE; | 113 HttpAuthChallengeTokenizer* challenge) OVERRIDE; |
| 113 | 114 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 127 virtual ~HttpAuthHandlerNTLM(); | 128 virtual ~HttpAuthHandlerNTLM(); |
| 128 | 129 |
| 129 #if defined(NTLM_PORTABLE) | 130 #if defined(NTLM_PORTABLE) |
| 130 // For unit tests to override the GenerateRandom and GetHostName functions. | 131 // For unit tests to override the GenerateRandom and GetHostName functions. |
| 131 // Returns the old function. | 132 // Returns the old function. |
| 132 static GenerateRandomProc SetGenerateRandomProc(GenerateRandomProc proc); | 133 static GenerateRandomProc SetGenerateRandomProc(GenerateRandomProc proc); |
| 133 static HostNameProc SetHostNameProc(HostNameProc proc); | 134 static HostNameProc SetHostNameProc(HostNameProc proc); |
| 134 #endif | 135 #endif |
| 135 | 136 |
| 136 // Parse the challenge, saving the results into this instance. | 137 // Parse the challenge, saving the results into this instance. |
| 137 HttpAuth::AuthorizationResult ParseChallenge( | 138 HttpAuth::AuthorizationResult ParseChallenge(HttpAuthChallengeTokenizer* tok, |
| 138 HttpAuthChallengeTokenizer* tok, bool initial_challenge); | 139 bool initial_challenge); |
| 139 | 140 |
| 140 // 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 |
| 141 // token to be sent to the server. | 142 // token to be sent to the server. |
| 142 int GetNextToken(const void* in_token, | 143 int GetNextToken(const void* in_token, |
| 143 uint32 in_token_len, | 144 uint32 in_token_len, |
| 144 void** out_token, | 145 void** out_token, |
| 145 uint32* out_token_len); | 146 uint32* out_token_len); |
| 146 | 147 |
| 147 // Create an NTLM SPN to identify the |origin| server. | 148 // Create an NTLM SPN to identify the |origin| server. |
| 148 static std::string CreateSPN(const GURL& origin); | 149 static std::string CreateSPN(const GURL& origin); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 164 std::string auth_data_; | 165 std::string auth_data_; |
| 165 | 166 |
| 166 #if defined(NTLM_SSPI) | 167 #if defined(NTLM_SSPI) |
| 167 URLSecurityManager* url_security_manager_; | 168 URLSecurityManager* url_security_manager_; |
| 168 #endif | 169 #endif |
| 169 }; | 170 }; |
| 170 | 171 |
| 171 } // namespace net | 172 } // namespace net |
| 172 | 173 |
| 173 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ | 174 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ |
| OLD | NEW |