| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_ | 5 #ifndef CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_ |
| 6 #define CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_ | 6 #define CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 virtual void TpmClearStoredPassword() = 0; | 52 virtual void TpmClearStoredPassword() = 0; |
| 53 | 53 |
| 54 virtual bool InstallAttributesGet(const std::string& name, | 54 virtual bool InstallAttributesGet(const std::string& name, |
| 55 std::string* value) = 0; | 55 std::string* value) = 0; |
| 56 virtual bool InstallAttributesSet(const std::string& name, | 56 virtual bool InstallAttributesSet(const std::string& name, |
| 57 const std::string& value) = 0; | 57 const std::string& value) = 0; |
| 58 virtual bool InstallAttributesFinalize() = 0; | 58 virtual bool InstallAttributesFinalize() = 0; |
| 59 virtual bool InstallAttributesIsInvalid() = 0; | 59 virtual bool InstallAttributesIsInvalid() = 0; |
| 60 virtual bool InstallAttributesIsFirstInstall() = 0; | 60 virtual bool InstallAttributesIsFirstInstall() = 0; |
| 61 | 61 |
| 62 // Returns system hash in hex encoded ascii format. | 62 // Returns system hash in hex encoded ascii format. Note: this may return |
| 63 // an empty string (e.g. if cryptohome is not running). It is up to the |
| 64 // calling function to try again after a delay if desired. |
| 63 virtual std::string GetSystemSalt() = 0; | 65 virtual std::string GetSystemSalt() = 0; |
| 64 | 66 |
| 65 // Encrypts |token| with the system salt key (stable for the lifetime | 67 // Encrypts |token| with the system salt key (stable for the lifetime |
| 66 // of the device). Useful to avoid storing plain text in place like | 68 // of the device). Useful to avoid storing plain text in place like |
| 67 // Local State. | 69 // Local State. |
| 68 virtual std::string EncryptWithSystemSalt(const std::string& token) = 0; | 70 virtual std::string EncryptWithSystemSalt(const std::string& token) = 0; |
| 69 | 71 |
| 70 // Decrypts |token| with the system salt key (stable for the lifetime | 72 // Decrypts |token| with the system salt key (stable for the lifetime |
| 71 // of the device). | 73 // of the device). |
| 72 virtual std::string DecryptWithSystemSalt( | 74 virtual std::string DecryptWithSystemSalt( |
| 73 const std::string& encrypted_token_hex) = 0; | 75 const std::string& encrypted_token_hex) = 0; |
| 74 | 76 |
| 75 protected: | 77 protected: |
| 76 CryptohomeLibrary(); | 78 CryptohomeLibrary(); |
| 77 | 79 |
| 78 private: | 80 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(CryptohomeLibrary); | 81 DISALLOW_COPY_AND_ASSIGN(CryptohomeLibrary); |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 } // namespace chromeos | 84 } // namespace chromeos |
| 83 | 85 |
| 84 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_ | 86 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_LIBRARY_H_ |
| OLD | NEW |