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_NEGOTIATE_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 auth_library_.reset(auth_library); | 69 auth_library_.reset(auth_library); |
70 } | 70 } |
71 | 71 |
72 virtual int CreateAuthHandler( | 72 virtual int CreateAuthHandler( |
73 HttpAuthChallengeTokenizer* challenge, | 73 HttpAuthChallengeTokenizer* challenge, |
74 HttpAuth::Target target, | 74 HttpAuth::Target target, |
75 const GURL& origin, | 75 const GURL& origin, |
76 CreateReason reason, | 76 CreateReason reason, |
77 int digest_nonce_count, | 77 int digest_nonce_count, |
78 const BoundNetLog& net_log, | 78 const BoundNetLog& net_log, |
79 scoped_ptr<HttpAuthHandler>* handler) OVERRIDE; | 79 scoped_ptr<HttpAuthHandler>* handler) override; |
80 | 80 |
81 private: | 81 private: |
82 bool disable_cname_lookup_; | 82 bool disable_cname_lookup_; |
83 bool use_port_; | 83 bool use_port_; |
84 HostResolver* resolver_; | 84 HostResolver* resolver_; |
85 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
86 ULONG max_token_length_; | 86 ULONG max_token_length_; |
87 bool first_creation_; | 87 bool first_creation_; |
88 #endif | 88 #endif |
89 bool is_unsupported_; | 89 bool is_unsupported_; |
(...skipping 10 matching lines...) Expand all Loading... |
100 bool use_port); | 100 bool use_port); |
101 | 101 |
102 virtual ~HttpAuthHandlerNegotiate(); | 102 virtual ~HttpAuthHandlerNegotiate(); |
103 | 103 |
104 // These are public for unit tests | 104 // These are public for unit tests |
105 std::string CreateSPN(const AddressList& address_list, const GURL& orign); | 105 std::string CreateSPN(const AddressList& address_list, const GURL& orign); |
106 const std::string& spn() const { return spn_; } | 106 const std::string& spn() const { return spn_; } |
107 | 107 |
108 // HttpAuthHandler: | 108 // HttpAuthHandler: |
109 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( | 109 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( |
110 HttpAuthChallengeTokenizer* challenge) OVERRIDE; | 110 HttpAuthChallengeTokenizer* challenge) override; |
111 virtual bool NeedsIdentity() OVERRIDE; | 111 virtual bool NeedsIdentity() override; |
112 virtual bool AllowsDefaultCredentials() OVERRIDE; | 112 virtual bool AllowsDefaultCredentials() override; |
113 virtual bool AllowsExplicitCredentials() OVERRIDE; | 113 virtual bool AllowsExplicitCredentials() override; |
114 | 114 |
115 protected: | 115 protected: |
116 virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE; | 116 virtual bool Init(HttpAuthChallengeTokenizer* challenge) override; |
117 | 117 |
118 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 118 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
119 const HttpRequestInfo* request, | 119 const HttpRequestInfo* request, |
120 const CompletionCallback& callback, | 120 const CompletionCallback& callback, |
121 std::string* auth_token) OVERRIDE; | 121 std::string* auth_token) override; |
122 | 122 |
123 private: | 123 private: |
124 enum State { | 124 enum State { |
125 STATE_RESOLVE_CANONICAL_NAME, | 125 STATE_RESOLVE_CANONICAL_NAME, |
126 STATE_RESOLVE_CANONICAL_NAME_COMPLETE, | 126 STATE_RESOLVE_CANONICAL_NAME_COMPLETE, |
127 STATE_GENERATE_AUTH_TOKEN, | 127 STATE_GENERATE_AUTH_TOKEN, |
128 STATE_GENERATE_AUTH_TOKEN_COMPLETE, | 128 STATE_GENERATE_AUTH_TOKEN_COMPLETE, |
129 STATE_NONE, | 129 STATE_NONE, |
130 }; | 130 }; |
131 | 131 |
(...skipping 27 matching lines...) Expand all Loading... |
159 std::string* auth_token_; | 159 std::string* auth_token_; |
160 | 160 |
161 State next_state_; | 161 State next_state_; |
162 | 162 |
163 const URLSecurityManager* url_security_manager_; | 163 const URLSecurityManager* url_security_manager_; |
164 }; | 164 }; |
165 | 165 |
166 } // namespace net | 166 } // namespace net |
167 | 167 |
168 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 168 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
OLD | NEW |