| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/chromeos/login/google_authenticator.h" | 5 #include "chrome/browser/chromeos/login/google_authenticator.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 void GoogleAuthenticator::ResyncEncryptedData( | 335 void GoogleAuthenticator::ResyncEncryptedData( |
| 336 const GaiaAuthConsumer::ClientLoginResult& credentials) { | 336 const GaiaAuthConsumer::ClientLoginResult& credentials) { |
| 337 | 337 |
| 338 if (CrosLibrary::Get()->GetCryptohomeLibrary()->Remove(username_)) { | 338 if (CrosLibrary::Get()->GetCryptohomeLibrary()->Remove(username_)) { |
| 339 OnLoginSuccess(credentials, false); | 339 OnLoginSuccess(credentials, false); |
| 340 } else { | 340 } else { |
| 341 OnLoginFailure(LoginFailure(LoginFailure::DATA_REMOVAL_FAILED)); | 341 OnLoginFailure(LoginFailure(LoginFailure::DATA_REMOVAL_FAILED)); |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 | 344 |
| 345 void GoogleAuthenticator::RetryAuth(Profile* profile, |
| 346 const std::string& username, |
| 347 const std::string& password, |
| 348 const std::string& login_token, |
| 349 const std::string& login_captcha) { |
| 350 NOTIMPLEMENTED(); |
| 351 } |
| 352 |
| 345 void GoogleAuthenticator::LoadSystemSalt() { | 353 void GoogleAuthenticator::LoadSystemSalt() { |
| 346 if (!system_salt_.empty()) | 354 if (!system_salt_.empty()) |
| 347 return; | 355 return; |
| 348 system_salt_ = CrosLibrary::Get()->GetCryptohomeLibrary()->GetSystemSalt(); | 356 system_salt_ = CrosLibrary::Get()->GetCryptohomeLibrary()->GetSystemSalt(); |
| 349 CHECK(!system_salt_.empty()); | 357 CHECK(!system_salt_.empty()); |
| 350 CHECK_EQ(system_salt_.size() % 2, 0U); | 358 CHECK_EQ(system_salt_.size() % 2, 0U); |
| 351 } | 359 } |
| 352 | 360 |
| 353 void GoogleAuthenticator::LoadLocalaccount(const std::string& filename) { | 361 void GoogleAuthenticator::LoadLocalaccount(const std::string& filename) { |
| 354 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); | 362 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 const unsigned int len) { | 440 const unsigned int len) { |
| 433 if (len < 2*binary_len) | 441 if (len < 2*binary_len) |
| 434 return false; | 442 return false; |
| 435 memset(hex_string, 0, len); | 443 memset(hex_string, 0, len); |
| 436 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) | 444 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) |
| 437 snprintf(hex_string + j, len - j, "%02x", binary[i]); | 445 snprintf(hex_string + j, len - j, "%02x", binary[i]); |
| 438 return true; | 446 return true; |
| 439 } | 447 } |
| 440 | 448 |
| 441 } // namespace chromeos | 449 } // namespace chromeos |
| OLD | NEW |