| 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 #ifndef CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // Asks cryptohomed to try to find the cryptohome for |user_email| and then | 42 // Asks cryptohomed to try to find the cryptohome for |user_email| and then |
| 43 // nuke it. | 43 // nuke it. |
| 44 virtual bool Remove(const std::string& user_email) = 0; | 44 virtual bool Remove(const std::string& user_email) = 0; |
| 45 | 45 |
| 46 // Asks cryptohomed if a drive is currently mounted. | 46 // Asks cryptohomed if a drive is currently mounted. |
| 47 virtual bool IsMounted() = 0; | 47 virtual bool IsMounted() = 0; |
| 48 | 48 |
| 49 // Asks cryptohomed for the system salt. | 49 // Asks cryptohomed for the system salt. |
| 50 virtual CryptohomeBlob GetSystemSalt() = 0; | 50 virtual CryptohomeBlob GetSystemSalt() = 0; |
| 51 | 51 |
| 52 }; | 52 // Get library implementation. |
| 53 | 53 static CryptohomeLibrary* GetImpl(bool stub); |
| 54 // This class handles the interaction with the ChromeOS cryptohome library APIs. | |
| 55 class CryptohomeLibraryImpl : public CryptohomeLibrary { | |
| 56 public: | |
| 57 CryptohomeLibraryImpl() {} | |
| 58 virtual ~CryptohomeLibraryImpl() {} | |
| 59 | |
| 60 // CryptohomeLibrary overrides. | |
| 61 virtual bool Mount(const std::string& user_email, | |
| 62 const std::string& passhash, | |
| 63 int* error_code); | |
| 64 | |
| 65 virtual bool MountForBwsi(int* error_code); | |
| 66 | |
| 67 virtual bool CheckKey(const std::string& user_email, | |
| 68 const std::string& passhash); | |
| 69 | |
| 70 virtual bool MigrateKey(const std::string& user_email, | |
| 71 const std::string& old_hash, | |
| 72 const std::string& new_hash); | |
| 73 | |
| 74 virtual bool Remove(const std::string& user_email); | |
| 75 | |
| 76 virtual bool IsMounted(); | |
| 77 | |
| 78 virtual CryptohomeBlob GetSystemSalt(); | |
| 79 | |
| 80 private: | |
| 81 DISALLOW_COPY_AND_ASSIGN(CryptohomeLibraryImpl); | |
| 82 }; | 54 }; |
| 83 | 55 |
| 84 } // namespace chromeos | 56 } // namespace chromeos |
| 85 | 57 |
| 86 #endif // CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ | 58 #endif // CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
| OLD | NEW |