Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: chrome/browser/chromeos/login/parallel_authenticator.h

Issue 7584026: Encrypted OAuth1 all access token and secret with system salt for now, will replace this with use... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 // TODO(zelidrag): http://crosbug.com/18905. Replace this with a key from
243 // Returns false if |hex_string| is too small, true otherwise. 245 // nssdb instead.
244 static bool BinaryToHex(const std::vector<unsigned char>& binary, 246 std::string UserSupplementalKeyAsAscii();
245 const unsigned int binary_len,
246 char* hex_string,
247 const unsigned int len);
248 247
249 // Signal login completion status for cases when a new user is added via 248 // Signal login completion status for cases when a new user is added via
250 // an external authentication provider (i.e. GAIA extension). 249 // an external authentication provider (i.e. GAIA extension).
251 void ResolveLoginCompletionStatus(); 250 void ResolveLoginCompletionStatus();
252 251
253 // Name of a file, next to chrome, that contains a local account username. 252 // Name of a file, next to chrome, that contains a local account username.
254 static const char kLocalaccountFile[]; 253 static const char kLocalaccountFile[];
255 254
256 // Milliseconds until we timeout our attempt to hit ClientLogin. 255 // Milliseconds until we timeout our attempt to hit ClientLogin.
257 static const int kClientLoginTimeoutMs; 256 static const int kClientLoginTimeoutMs;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadLocalaccount); 297 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadLocalaccount);
299 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, 298 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest,
300 ReadLocalaccountTrailingWS); 299 ReadLocalaccountTrailingWS);
301 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadNoLocalaccount); 300 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadNoLocalaccount);
302 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); 301 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator);
303 }; 302 };
304 303
305 } // namespace chromeos 304 } // namespace chromeos
306 305
307 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ 306 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/mock_authenticator.h ('k') | chrome/browser/chromeos/login/parallel_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698