[DO NOT MERGE] Revert "Restructed reference root of trust (3/3 OEM Cert)"
This reverts commit 9f7e2c4413.
Reason for revert: Feature missed deadline
Bug: 135283522
Change-Id: I63eb0431762fd13c64bef926fb1e64b6edacb156
This commit is contained in:
@@ -24,15 +24,6 @@ class Prov30CryptoEngine : public CryptoEngine {
|
||||
explicit Prov30CryptoEngine(std::unique_ptr<wvcdm::FileSystem>&& file_system)
|
||||
: CryptoEngine(std::move(file_system)) {}
|
||||
|
||||
bool Initialize() override {
|
||||
if (!CryptoEngine::Initialize()) {
|
||||
return false;
|
||||
}
|
||||
const OEMCryptoResult result = InstallOemCertificate(
|
||||
kOEMPrivateKey, kOEMPrivateKeySize, kOEMPublicCert, kOEMPublicCertSize);
|
||||
return result == OEMCrypto_SUCCESS;
|
||||
}
|
||||
|
||||
bool config_local_display_only() { return true; }
|
||||
|
||||
// Returns the max HDCP version supported.
|
||||
@@ -56,6 +47,31 @@ class Prov30CryptoEngine : public CryptoEngine {
|
||||
return OEMCrypto_OEMCertificate;
|
||||
}
|
||||
|
||||
OEMCryptoResult get_oem_certificate(SessionContext* session,
|
||||
uint8_t* public_cert,
|
||||
size_t* public_cert_length) {
|
||||
if (kOEMPublicCertSize == 0) {
|
||||
return OEMCrypto_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
if (public_cert_length == nullptr) {
|
||||
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
||||
}
|
||||
if (*public_cert_length < kOEMPublicCertSize) {
|
||||
*public_cert_length = kOEMPublicCertSize;
|
||||
return OEMCrypto_ERROR_SHORT_BUFFER;
|
||||
}
|
||||
*public_cert_length = kOEMPublicCertSize;
|
||||
if (public_cert == nullptr) {
|
||||
return OEMCrypto_ERROR_SHORT_BUFFER;
|
||||
}
|
||||
memcpy(public_cert, kOEMPublicCert, kOEMPublicCertSize);
|
||||
if (!session->LoadRsaDrmKey(kOEMPrivateKey, kOEMPrivateKeySize)) {
|
||||
LOGE("Private RSA Key did not load correctly.");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
}
|
||||
return OEMCrypto_SUCCESS;
|
||||
}
|
||||
|
||||
// Returns "L3" for a software only library. L1 is for hardware protected
|
||||
// keys and data paths. L2 is for hardware protected keys but no data path
|
||||
// protection.
|
||||
|
||||
Reference in New Issue
Block a user