Restructed reference root of trust (1/3 Keybox)

[ Merge of http://go/wvgerrit/115550 ]

This change is the first part of a three part change for restructing
the root of trust used by the reference implementation.

The API of the AuthenticationRoot class has been updated to reflect
the OEMCrypto functions that relate to the root of trust.  This
involves changing the keybox and DRM Cert methods and adding in new
stubs for OEM Certificates.

The WvKeybox now uses a RAII-like interface to ensure that keyboxes
are provisioned correctly or not at all.

Bug: 135283522
Test: oemcrypto_unittests ce_cdm_tests
Change-Id: I3f2baf29c1022e1806b6196fa6650d761785c626
This commit is contained in:
Alex Dale
2021-02-18 19:33:33 -08:00
parent 8c6ce2e4c9
commit e4ee4eb404
8 changed files with 524 additions and 199 deletions

View File

@@ -65,31 +65,40 @@ class CryptoEngine {
virtual bool Initialize();
bool ValidRootOfTrust() { return root_of_trust_.Validate(); }
bool ValidRootOfTrust() const { return root_of_trust_.IsValid(); }
bool InstallKeybox(const uint8_t* keybox, size_t keybox_length) {
OEMCryptoResult InstallKeybox(const uint8_t* keybox, size_t keybox_length) {
return root_of_trust_.InstallKeybox(keybox, keybox_length);
}
bool UseTestKeybox(const uint8_t* keybox_data, size_t keybox_length) {
return root_of_trust_.UseTestKeybox(keybox_data, keybox_length);
OEMCryptoResult InstallTestKeybox(const uint8_t* keybox_data,
size_t keybox_length) {
return root_of_trust_.InstallTestKeybox(keybox_data, keybox_length);
}
bool LoadTestRsaKey() { return root_of_trust_.LoadTestRsaKey(); }
OEMCryptoResult LoadTestRsaKey() { return root_of_trust_.LoadTestRsaKey(); }
KeyboxError ValidateKeybox() { return root_of_trust_.ValidateKeybox(); }
OEMCryptoResult IsKeyboxValid() const {
return root_of_trust_.IsKeyboxValid();
}
const std::vector<uint8_t>& DeviceRootKey() {
std::vector<uint8_t> DeviceRootKey() const {
return root_of_trust_.DeviceKey();
}
const std::vector<uint8_t>& DeviceRootId() {
OEMCryptoResult GetDeviceRootId(uint8_t* device_id,
size_t* device_id_length) const {
return root_of_trust_.GetDeviceId(device_id, device_id_length);
}
std::vector<uint8_t> DeviceRootId() const {
return root_of_trust_.DeviceId();
}
size_t DeviceRootTokenLength() { return root_of_trust_.DeviceTokenLength(); }
const uint8_t* DeviceRootToken() { return root_of_trust_.DeviceToken(); }
OEMCryptoResult GetRootKeyData(uint8_t* key_data,
size_t* key_data_length) const {
return root_of_trust_.GetKeyData(key_data, key_data_length);
}
virtual void Terminate();