Replace OEMCrypto_LoadDeviceRSAKey with OEMCrypto_LoadDRMPrivateKey
Merge from Widevine repo of http://go/wvgerrit/96783 This CL updates the reference code, unit tests, and adapter to use the new v16 function OEMCrypto_LoadDRMPrivateKey. This is just an API change to allow ECC support in the future. The reference code does not yet support ECC certificates, and the CDM code assumes that all certificates have an RSA key. Bug: 152558018 Test: unit tests on taimen and w/v16 mod mock. Change-Id: I0793b416513b81b3d74849f0b58dbdc91f075ac6
This commit is contained in:
@@ -1201,7 +1201,7 @@ CdmResponseType CryptoSession::LoadEntitledContentKeys(
|
||||
CdmResponseType CryptoSession::LoadCertificatePrivateKey(
|
||||
const std::string& wrapped_key) {
|
||||
// TODO(b/141655126): Getting the OEM Cert no longer loads the private key.
|
||||
// Call OEMCrypto_GetOEMPublicCertificate before OEMCrypto_LoadDeviceRSAKey
|
||||
// Call OEMCrypto_GetOEMPublicCertificate before OEMCrypto_LoadDRMPrivateKey
|
||||
// so it caches the OEMCrypto Public Key and then throw away result
|
||||
std::string temp_buffer(CERTIFICATE_DATA_SIZE, '\0');
|
||||
size_t buf_size = temp_buffer.size();
|
||||
@@ -1216,10 +1216,11 @@ CdmResponseType CryptoSession::LoadCertificatePrivateKey(
|
||||
metrics_->oemcrypto_get_oem_public_certificate_.Increment(sts);
|
||||
|
||||
LOGV("Loading device RSA key: id = %u", oec_session_id_);
|
||||
// TODO(b/140813486): determine if cert is RSA or ECC.
|
||||
WithOecSessionLock(
|
||||
"LoadCertificatePrivateKey() calling OEMCrypto_LoadDeviceRSAKey()", [&] {
|
||||
M_TIME(sts = OEMCrypto_LoadDeviceRSAKey(
|
||||
oec_session_id_,
|
||||
"LoadCertificatePrivateKey() calling OEMCrypto_LoadDRMPrivateKey()", [&] {
|
||||
M_TIME(sts = OEMCrypto_LoadDRMPrivateKey(
|
||||
oec_session_id_, OEMCrypto_RSA_Private_Key,
|
||||
reinterpret_cast<const uint8_t*>(wrapped_key.data()),
|
||||
wrapped_key.size()),
|
||||
metrics_, oemcrypto_load_device_rsa_key_, sts);
|
||||
|
||||
Reference in New Issue
Block a user