Android-cuttlefish cvd tool
|
#include <tpm_storage.h>
Public Member Functions | |
TpmStorage (TpmResourceManager &resource_manager, const std::string &index_file) | |
Result< bool > | HasKey (const std::string &key) const override |
Result< ManagedStorageData > | Read (const std::string &key) const override |
Result< void > | Write (const std::string &key, const StorageData &data) override |
bool | Exists () const override |
![]() | |
virtual Result< bool > | HasKey (const std::string &key) const =0 |
virtual Result< ManagedStorageData > | Read (const std::string &key) const =0 |
virtual Result< void > | Write (const std::string &key, const StorageData &data)=0 |
virtual bool | Exists () const =0 |
virtual | ~Storage ()=default |
Private Member Functions | |
Result< std::optional< TPM2_HANDLE > > | GetHandle (const std::string &key) const |
TPM2_HANDLE | GenerateRandomHandle () |
Result< void > | Allocate (const std::string &key, uint16_t size) |
Private Attributes | |
TpmResourceManager & | resource_manager_ |
std::string | index_file_ |
Json::Value | index_ |
std::string | path_ |
Manager for data stored inside the TPM with an index outside of the TPM. The contents of the data cannot be corrupted or decrypted by accessing the index, but the index can be corrupted by an attacker.
As the actual data is stored inside the TPM, a replay attack can be used to restore deleted index entries or hide revert to before an index entry was added, but not change the contents that an index points to if it still exists.
This class is not thread-safe, and should be synchronized externally if it is going to be used from multiple threads.
cuttlefish::secure_env::TpmStorage::TpmStorage | ( | TpmResourceManager & | resource_manager, |
const std::string & | index_file | ||
) |
|
private |
|
overridevirtual |
Implements cuttlefish::secure_env::Storage.
|
private |
|
private |
|
overridevirtual |
Implements cuttlefish::secure_env::Storage.
|
overridevirtual |
Implements cuttlefish::secure_env::Storage.
|
overridevirtual |
Implements cuttlefish::secure_env::Storage.
|
private |
|
private |
|
private |
|
private |