| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_FAKE_FAKE_CRYPTOHOME_LIBRARY_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_FAKE_FAKE_CRYPTOHOME_LIBRARY_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | |
| 11 | |
| 12 namespace chromeos { | |
| 13 | |
| 14 class FakeCryptohomeLibrary : public CryptohomeLibrary { | |
| 15 public: | |
| 16 FakeCryptohomeLibrary() { | |
| 17 // The salt must be non-empty and an even length. | |
| 18 salt_.push_back(0); | |
| 19 salt_.push_back(0); | |
| 20 } | |
| 21 | |
| 22 virtual ~FakeCryptohomeLibrary() {} | |
| 23 virtual bool Mount(const std::string& user_email, | |
| 24 const std::string& passhash, | |
| 25 int* error_code) { | |
| 26 return true; | |
| 27 } | |
| 28 | |
| 29 virtual bool MountForBwsi(int* error_code) { | |
| 30 return true; | |
| 31 } | |
| 32 | |
| 33 virtual bool CheckKey(const std::string& user_email, | |
| 34 const std::string& passhash) { | |
| 35 return true; | |
| 36 } | |
| 37 | |
| 38 virtual bool MigrateKey(const std::string& user_email, | |
| 39 const std::string& old_hash, | |
| 40 const std::string& new_hash) { | |
| 41 return true; | |
| 42 } | |
| 43 | |
| 44 virtual bool Remove(const std::string& user_email) { | |
| 45 return true; | |
| 46 } | |
| 47 | |
| 48 virtual bool IsMounted() { | |
| 49 return true; | |
| 50 } | |
| 51 | |
| 52 virtual CryptohomeBlob GetSystemSalt() { | |
| 53 return salt_; | |
| 54 } | |
| 55 | |
| 56 private: | |
| 57 CryptohomeBlob salt_; | |
| 58 }; | |
| 59 | |
| 60 } // namespace chromeos | |
| 61 | |
| 62 #endif // CHROME_BROWSER_CHROMEOS_CROS_FAKE_FAKE_CRYPTOHOME_LIBRARY_H_ | |
| OLD | NEW |