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 30 matching lines...) Expand all Loading... |
41 Factory(); | 41 Factory(); |
42 virtual ~Factory(); | 42 virtual ~Factory(); |
43 | 43 |
44 virtual int CreateAuthHandler( | 44 virtual int CreateAuthHandler( |
45 HttpAuthChallengeTokenizer* challenge, | 45 HttpAuthChallengeTokenizer* challenge, |
46 HttpAuth::Target target, | 46 HttpAuth::Target target, |
47 const GURL& origin, | 47 const GURL& origin, |
48 CreateReason reason, | 48 CreateReason reason, |
49 int digest_nonce_count, | 49 int digest_nonce_count, |
50 const BoundNetLog& net_log, | 50 const BoundNetLog& net_log, |
51 scoped_ptr<HttpAuthHandler>* handler) OVERRIDE; | 51 scoped_ptr<HttpAuthHandler>* handler) override; |
52 #if defined(NTLM_SSPI) | 52 #if defined(NTLM_SSPI) |
53 // Set the SSPILibrary to use. Typically the only callers which need to use | 53 // Set the SSPILibrary to use. Typically the only callers which need to use |
54 // this are unit tests which pass in a mocked-out version of the SSPI | 54 // this are unit tests which pass in a mocked-out version of the SSPI |
55 // library. After the call |sspi_library| will be owned by this Factory and | 55 // library. After the call |sspi_library| will be owned by this Factory and |
56 // will be destroyed when the Factory is destroyed. | 56 // will be destroyed when the Factory is destroyed. |
57 void set_sspi_library(SSPILibrary* sspi_library) { | 57 void set_sspi_library(SSPILibrary* sspi_library) { |
58 sspi_library_.reset(sspi_library); | 58 sspi_library_.reset(sspi_library); |
59 } | 59 } |
60 #endif // defined(NTLM_SSPI) | 60 #endif // defined(NTLM_SSPI) |
61 private: | 61 private: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, ULONG max_token_length, |
104 URLSecurityManager* url_security_manager); | 104 URLSecurityManager* url_security_manager); |
105 #endif | 105 #endif |
106 | 106 |
107 virtual bool NeedsIdentity() OVERRIDE; | 107 virtual bool NeedsIdentity() override; |
108 | 108 |
109 virtual bool AllowsDefaultCredentials() OVERRIDE; | 109 virtual bool AllowsDefaultCredentials() override; |
110 | 110 |
111 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( | 111 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( |
112 HttpAuthChallengeTokenizer* challenge) OVERRIDE; | 112 HttpAuthChallengeTokenizer* challenge) override; |
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(HttpAuthChallengeTokenizer* tok) OVERRIDE; | 119 virtual bool Init(HttpAuthChallengeTokenizer* tok) override; |
120 | 120 |
121 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 121 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
122 const HttpRequestInfo* request, | 122 const HttpRequestInfo* request, |
123 const CompletionCallback& callback, | 123 const CompletionCallback& callback, |
124 std::string* auth_token) OVERRIDE; | 124 std::string* auth_token) override; |
125 | 125 |
126 private: | 126 private: |
127 virtual ~HttpAuthHandlerNTLM(); | 127 virtual ~HttpAuthHandlerNTLM(); |
128 | 128 |
129 #if defined(NTLM_PORTABLE) | 129 #if defined(NTLM_PORTABLE) |
130 // For unit tests to override the GenerateRandom and GetHostName functions. | 130 // For unit tests to override the GenerateRandom and GetHostName functions. |
131 // Returns the old function. | 131 // Returns the old function. |
132 static GenerateRandomProc SetGenerateRandomProc(GenerateRandomProc proc); | 132 static GenerateRandomProc SetGenerateRandomProc(GenerateRandomProc proc); |
133 static HostNameProc SetHostNameProc(HostNameProc proc); | 133 static HostNameProc SetHostNameProc(HostNameProc proc); |
134 #endif | 134 #endif |
(...skipping 29 matching lines...) Expand all Loading... |
164 std::string auth_data_; | 164 std::string auth_data_; |
165 | 165 |
166 #if defined(NTLM_SSPI) | 166 #if defined(NTLM_SSPI) |
167 URLSecurityManager* url_security_manager_; | 167 URLSecurityManager* url_security_manager_; |
168 #endif | 168 #endif |
169 }; | 169 }; |
170 | 170 |
171 } // namespace net | 171 } // namespace net |
172 | 172 |
173 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ | 173 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NTLM_H_ |
OLD | NEW |