| 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 #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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 std::string GoogleAuthenticator::EncryptToken(const std::string& unused) { | 415 std::string GoogleAuthenticator::EncryptToken(const std::string& unused) { |
| 416 NOTIMPLEMENTED(); | 416 NOTIMPLEMENTED(); |
| 417 return std::string(); | 417 return std::string(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 std::string GoogleAuthenticator::DecryptToken(const std::string& unused) { | 420 std::string GoogleAuthenticator::DecryptToken(const std::string& unused) { |
| 421 NOTIMPLEMENTED(); | 421 NOTIMPLEMENTED(); |
| 422 return std::string(); | 422 return std::string(); |
| 423 } | 423 } |
| 424 | 424 |
| 425 std::string GoogleAuthenticator::DecryptLegacyToken(const std::string& unused) { |
| 426 NOTIMPLEMENTED(); |
| 427 return std::string(); |
| 428 } |
| 429 |
| 425 | 430 |
| 426 void GoogleAuthenticator::LoadSystemSalt() { | 431 void GoogleAuthenticator::LoadSystemSalt() { |
| 427 if (!system_salt_.empty()) | 432 if (!system_salt_.empty()) |
| 428 return; | 433 return; |
| 429 system_salt_ = CrosLibrary::Get()->GetCryptohomeLibrary()->GetSystemSalt(); | 434 system_salt_ = CrosLibrary::Get()->GetCryptohomeLibrary()->GetSystemSalt(); |
| 430 CHECK(!system_salt_.empty()); | 435 CHECK(!system_salt_.empty()); |
| 431 CHECK_EQ(system_salt_.size() % 2, 0U); | 436 CHECK_EQ(system_salt_.size() % 2, 0U); |
| 432 } | 437 } |
| 433 | 438 |
| 434 void GoogleAuthenticator::LoadLocalaccount(const std::string& filename) { | 439 void GoogleAuthenticator::LoadLocalaccount(const std::string& filename) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 const unsigned int len) { | 508 const unsigned int len) { |
| 504 if (len < 2*binary_len) | 509 if (len < 2*binary_len) |
| 505 return false; | 510 return false; |
| 506 memset(hex_string, 0, len); | 511 memset(hex_string, 0, len); |
| 507 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) | 512 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) |
| 508 snprintf(hex_string + j, len - j, "%02x", binary[i]); | 513 snprintf(hex_string + j, len - j, "%02x", binary[i]); |
| 509 return true; | 514 return true; |
| 510 } | 515 } |
| 511 | 516 |
| 512 } // namespace chromeos | 517 } // namespace chromeos |
| OLD | NEW |