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 CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 const GaiaAuthConsumer::ClientLoginResult& credentials) OVERRIDE; | 140 const GaiaAuthConsumer::ClientLoginResult& credentials) OVERRIDE; |
141 virtual void ResyncEncryptedData( | 141 virtual void ResyncEncryptedData( |
142 const GaiaAuthConsumer::ClientLoginResult& credentials) OVERRIDE; | 142 const GaiaAuthConsumer::ClientLoginResult& credentials) OVERRIDE; |
143 virtual void RetryAuth(Profile* profile, | 143 virtual void RetryAuth(Profile* profile, |
144 const std::string& username, | 144 const std::string& username, |
145 const std::string& password, | 145 const std::string& password, |
146 const std::string& login_token, | 146 const std::string& login_token, |
147 const std::string& login_captcha) OVERRIDE; | 147 const std::string& login_captcha) OVERRIDE; |
148 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, | 148 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, |
149 const std::string& oauth1_secret) OVERRIDE; | 149 const std::string& oauth1_secret) OVERRIDE; |
150 virtual std::string EncryptToken(const std::string& token) OVERRIDE; | |
151 virtual std::string DecryptToken(const std::string& encrypted_token) OVERRIDE; | |
150 | 152 |
151 // AuthAttemptStateResolver overrides. | 153 // AuthAttemptStateResolver overrides. |
152 // Attempts to make a decision and call back |consumer_| based on | 154 // Attempts to make a decision and call back |consumer_| based on |
153 // the state we have gathered at the time of call. If a decision | 155 // the state we have gathered at the time of call. If a decision |
154 // can't be made, defers until the next time this is called. | 156 // can't be made, defers until the next time this is called. |
155 // When a decision is made, will call back to |consumer_| on the UI thread. | 157 // When a decision is made, will call back to |consumer_| on the UI thread. |
156 // | 158 // |
157 // Must be called on the IO thread. | 159 // Must be called on the IO thread. |
158 virtual void Resolve() OVERRIDE; | 160 virtual void Resolve() OVERRIDE; |
159 | 161 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 | 233 |
232 // Records OAuth1 access token verification failure for |user_account|. | 234 // Records OAuth1 access token verification failure for |user_account|. |
233 void RecordOAuthCheckFailure(const std::string& user_account); | 235 void RecordOAuthCheckFailure(const std::string& user_account); |
234 | 236 |
235 // Stores a hash of |password|, salted with the ascii of |system_salt_|. | 237 // Stores a hash of |password|, salted with the ascii of |system_salt_|. |
236 std::string HashPassword(const std::string& password); | 238 std::string HashPassword(const std::string& password); |
237 | 239 |
238 // Returns the ascii encoding of the system salt. | 240 // Returns the ascii encoding of the system salt. |
239 std::string SaltAsAscii(); | 241 std::string SaltAsAscii(); |
240 | 242 |
241 // Converts the binary data |binary| into an ascii hex string and stores | 243 // Returns the ascii encoding of user supplemental key. |
242 // it in |hex_string|. Not guaranteed to be NULL-terminated. | 244 std::string UserSupplementalKeyAsAscii(); |
Chris Masone
2011/08/09 04:19:32
It'd be good to file an issue for converting this
| |
243 // Returns false if |hex_string| is too small, true otherwise. | |
244 static bool BinaryToHex(const std::vector<unsigned char>& binary, | |
245 const unsigned int binary_len, | |
246 char* hex_string, | |
247 const unsigned int len); | |
248 | 245 |
249 // Signal login completion status for cases when a new user is added via | 246 // Signal login completion status for cases when a new user is added via |
250 // an external authentication provider (i.e. GAIA extension). | 247 // an external authentication provider (i.e. GAIA extension). |
251 void ResolveLoginCompletionStatus(); | 248 void ResolveLoginCompletionStatus(); |
252 | 249 |
253 // Name of a file, next to chrome, that contains a local account username. | 250 // Name of a file, next to chrome, that contains a local account username. |
254 static const char kLocalaccountFile[]; | 251 static const char kLocalaccountFile[]; |
255 | 252 |
256 // Milliseconds until we timeout our attempt to hit ClientLogin. | 253 // Milliseconds until we timeout our attempt to hit ClientLogin. |
257 static const int kClientLoginTimeoutMs; | 254 static const int kClientLoginTimeoutMs; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadLocalaccount); | 295 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadLocalaccount); |
299 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, | 296 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, |
300 ReadLocalaccountTrailingWS); | 297 ReadLocalaccountTrailingWS); |
301 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadNoLocalaccount); | 298 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadNoLocalaccount); |
302 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); | 299 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); |
303 }; | 300 }; |
304 | 301 |
305 } // namespace chromeos | 302 } // namespace chromeos |
306 | 303 |
307 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 304 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
OLD | NEW |