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 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Sets the system library to use, thereby assuming ownership of | 56 // Sets the system library to use, thereby assuming ownership of |
57 // |auth_library|. | 57 // |auth_library|. |
58 void set_library(scoped_ptr<AuthLibrary> auth_provider) { | 58 void set_library(scoped_ptr<AuthLibrary> auth_provider) { |
59 auth_library_ = std::move(auth_provider); | 59 auth_library_ = std::move(auth_provider); |
60 } | 60 } |
61 #endif | 61 #endif |
62 | 62 |
63 // HttpAuthHandlerFactory overrides | 63 // HttpAuthHandlerFactory overrides |
64 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 64 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
65 HttpAuth::Target target, | 65 HttpAuth::Target target, |
| 66 const SSLInfo& ssl_info, |
66 const GURL& origin, | 67 const GURL& origin, |
67 CreateReason reason, | 68 CreateReason reason, |
68 int digest_nonce_count, | 69 int digest_nonce_count, |
69 const BoundNetLog& net_log, | 70 const BoundNetLog& net_log, |
70 scoped_ptr<HttpAuthHandler>* handler) override; | 71 scoped_ptr<HttpAuthHandler>* handler) override; |
71 | 72 |
72 private: | 73 private: |
73 HostResolver* resolver_; | 74 HostResolver* resolver_; |
74 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
75 ULONG max_token_length_; | 76 ULONG max_token_length_; |
(...skipping 21 matching lines...) Expand all Loading... |
97 const std::string& spn() const { return spn_; } | 98 const std::string& spn() const { return spn_; } |
98 | 99 |
99 // HttpAuthHandler: | 100 // HttpAuthHandler: |
100 HttpAuth::AuthorizationResult HandleAnotherChallenge( | 101 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
101 HttpAuthChallengeTokenizer* challenge) override; | 102 HttpAuthChallengeTokenizer* challenge) override; |
102 bool NeedsIdentity() override; | 103 bool NeedsIdentity() override; |
103 bool AllowsDefaultCredentials() override; | 104 bool AllowsDefaultCredentials() override; |
104 bool AllowsExplicitCredentials() override; | 105 bool AllowsExplicitCredentials() override; |
105 | 106 |
106 protected: | 107 protected: |
107 bool Init(HttpAuthChallengeTokenizer* challenge) override; | 108 bool Init(HttpAuthChallengeTokenizer* challenge, |
| 109 const SSLInfo& ssl_info) override; |
108 | 110 |
109 int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 111 int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
110 const HttpRequestInfo* request, | 112 const HttpRequestInfo* request, |
111 const CompletionCallback& callback, | 113 const CompletionCallback& callback, |
112 std::string* auth_token) override; | 114 std::string* auth_token) override; |
113 | 115 |
114 private: | 116 private: |
115 enum State { | 117 enum State { |
116 STATE_RESOLVE_CANONICAL_NAME, | 118 STATE_RESOLVE_CANONICAL_NAME, |
117 STATE_RESOLVE_CANONICAL_NAME_COMPLETE, | 119 STATE_RESOLVE_CANONICAL_NAME_COMPLETE, |
(...skipping 17 matching lines...) Expand all Loading... |
135 | 137 |
136 // Members which are needed for DNS lookup + SPN. | 138 // Members which are needed for DNS lookup + SPN. |
137 AddressList address_list_; | 139 AddressList address_list_; |
138 scoped_ptr<SingleRequestHostResolver> single_resolve_; | 140 scoped_ptr<SingleRequestHostResolver> single_resolve_; |
139 | 141 |
140 // Things which should be consistent after first call to GenerateAuthToken. | 142 // Things which should be consistent after first call to GenerateAuthToken. |
141 bool already_called_; | 143 bool already_called_; |
142 bool has_credentials_; | 144 bool has_credentials_; |
143 AuthCredentials credentials_; | 145 AuthCredentials credentials_; |
144 std::string spn_; | 146 std::string spn_; |
| 147 std::string channel_bindings_; |
145 | 148 |
146 // Things which vary each round. | 149 // Things which vary each round. |
147 CompletionCallback callback_; | 150 CompletionCallback callback_; |
148 std::string* auth_token_; | 151 std::string* auth_token_; |
149 | 152 |
150 State next_state_; | 153 State next_state_; |
151 | 154 |
152 const HttpAuthPreferences* http_auth_preferences_; | 155 const HttpAuthPreferences* http_auth_preferences_; |
153 }; | 156 }; |
154 | 157 |
155 } // namespace net | 158 } // namespace net |
156 | 159 |
157 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ | 160 #endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
OLD | NEW |