Fix Entitlement Licenses am: 4444ba3b47
Change-Id: Ib438a6659f401e59cf58671dbac3f2cc865a5b0e
This commit is contained in:
@@ -135,7 +135,8 @@ class CryptoSession {
|
||||
// V16 licenses.
|
||||
virtual CdmResponseType LoadLicense(const std::string& signed_message,
|
||||
const std::string& core_message,
|
||||
const std::string& signature);
|
||||
const std::string& signature,
|
||||
CdmLicenseKeyType key_type);
|
||||
|
||||
// Renewal request/responses
|
||||
virtual CdmResponseType PrepareAndSignRenewalRequest(
|
||||
|
||||
@@ -952,11 +952,17 @@ CdmResponseType CryptoSession::LoadKeys(
|
||||
|
||||
CdmResponseType CryptoSession::LoadLicense(const std::string& signed_message,
|
||||
const std::string& core_message,
|
||||
const std::string& signature) {
|
||||
const std::string& signature,
|
||||
CdmLicenseKeyType key_type) {
|
||||
LOGV("Loading license: id = %u", oec_session_id_);
|
||||
const std::string combined_message = core_message + signed_message;
|
||||
OEMCryptoResult sts;
|
||||
WithOecSessionLock("LoadLicense", [&] {
|
||||
if (key_type == kLicenseKeyTypeEntitlement &&
|
||||
key_session_->Type() != KeySession::kEntitlement) {
|
||||
key_session_.reset(new EntitlementKeySession(oec_session_id_, metrics_));
|
||||
}
|
||||
|
||||
M_TIME(sts = OEMCrypto_LoadLicense(
|
||||
oec_session_id_,
|
||||
reinterpret_cast<const uint8_t*>(combined_message.data()),
|
||||
|
||||
@@ -1099,7 +1099,8 @@ CdmResponseType CdmLicense::HandleContentKeyResponse(
|
||||
}
|
||||
CdmResponseType resp;
|
||||
if (supports_core_messages()) {
|
||||
resp = crypto_session_->LoadLicense(msg, core_message, signature);
|
||||
resp = crypto_session_->LoadLicense(msg, core_message, signature,
|
||||
kLicenseKeyTypeContent);
|
||||
} else {
|
||||
resp = crypto_session_->LoadKeys(
|
||||
msg, signature, mac_key_iv, mac_key, key_array, provider_session_token_,
|
||||
@@ -1128,7 +1129,8 @@ CdmResponseType CdmLicense::HandleEntitlementKeyResponse(
|
||||
}
|
||||
CdmResponseType resp;
|
||||
if (supports_core_messages()) {
|
||||
resp = crypto_session_->LoadLicense(msg, core_message, signature);
|
||||
resp = crypto_session_->LoadLicense(msg, core_message, signature,
|
||||
kLicenseKeyTypeEntitlement);
|
||||
} else {
|
||||
resp = crypto_session_->LoadKeys(
|
||||
msg, signature, mac_key_iv, mac_key, key_array, provider_session_token_,
|
||||
|
||||
Reference in New Issue
Block a user