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/bind.h" | 10 #include "base/bind.h" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 std::string GoogleAuthenticator::EncryptToken(const std::string& unused) { | 401 std::string GoogleAuthenticator::EncryptToken(const std::string& unused) { |
402 NOTIMPLEMENTED(); | 402 NOTIMPLEMENTED(); |
403 return std::string(); | 403 return std::string(); |
404 } | 404 } |
405 | 405 |
406 std::string GoogleAuthenticator::DecryptToken(const std::string& unused) { | 406 std::string GoogleAuthenticator::DecryptToken(const std::string& unused) { |
407 NOTIMPLEMENTED(); | 407 NOTIMPLEMENTED(); |
408 return std::string(); | 408 return std::string(); |
409 } | 409 } |
410 | 410 |
411 std::string GoogleAuthenticator::DecryptLegacyToken(const std::string& unused) { | |
412 NOTIMPLEMENTED(); | |
413 return std::string(); | |
414 } | |
415 | |
416 | |
417 void GoogleAuthenticator::LoadSystemSalt() { | 411 void GoogleAuthenticator::LoadSystemSalt() { |
418 if (!system_salt_.empty()) | 412 if (!system_salt_.empty()) |
419 return; | 413 return; |
420 system_salt_ = CrosLibrary::Get()->GetCryptohomeLibrary()->GetSystemSalt(); | 414 system_salt_ = CrosLibrary::Get()->GetCryptohomeLibrary()->GetSystemSalt(); |
421 CHECK(!system_salt_.empty()); | 415 CHECK(!system_salt_.empty()); |
422 CHECK_EQ(system_salt_.size() % 2, 0U); | 416 CHECK_EQ(system_salt_.size() % 2, 0U); |
423 } | 417 } |
424 | 418 |
425 void GoogleAuthenticator::LoadLocalaccount(const std::string& filename) { | 419 void GoogleAuthenticator::LoadLocalaccount(const std::string& filename) { |
426 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 420 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 const unsigned int len) { | 488 const unsigned int len) { |
495 if (len < 2*binary_len) | 489 if (len < 2*binary_len) |
496 return false; | 490 return false; |
497 memset(hex_string, 0, len); | 491 memset(hex_string, 0, len); |
498 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) | 492 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) |
499 snprintf(hex_string + j, len - j, "%02x", binary[i]); | 493 snprintf(hex_string + j, len - j, "%02x", binary[i]); |
500 return true; | 494 return true; |
501 } | 495 } |
502 | 496 |
503 } // namespace chromeos | 497 } // namespace chromeos |
OLD | NEW |