License release does not use core message am: 760bf71908 am: 98ca694dcd am: 4c61d20ab1

Change-Id: I5d9a952587e16fe5a6cd12bcce8d20283c1b4e73
This commit is contained in:
Fred Gylys-Colwell
2020-05-14 22:22:28 +00:00
committed by Automerger Merge Worker
5 changed files with 25 additions and 10 deletions

View File

@@ -702,12 +702,13 @@ CdmResponseType CdmLicense::HandleKeyUpdateResponse(
return INVALID_LICENSE_TYPE; return INVALID_LICENSE_TYPE;
} }
// At this point of the license life-cycle (handling a renewal or // At this point of the license life-cycle (handling a renewal), we should
// release), we should already know if the license is v15 or not. // already know if the license is v15 or not. If license is v16, then a
// If license is v16, then there should be a |core_message| // renewal should have a |core_message| present; otherwise there might have
// present; otherwise there might have beeen some tampering with the // been some tampering with the request or response. On the other hand, a
// request or response. // release is processed without loading the license, so OEMCrypto does not
if (supports_core_messages() && // know if it is v15 or v16, and will not add a core message.
if (is_renewal && supports_core_messages() &&
(!signed_response.has_oemcrypto_core_message() || (!signed_response.has_oemcrypto_core_message() ||
signed_response.oemcrypto_core_message().empty())) { signed_response.oemcrypto_core_message().empty())) {
LOGE("Renewal response is missing |core_message| field"); LOGE("Renewal response is missing |core_message| field");
@@ -720,8 +721,9 @@ CdmResponseType CdmLicense::HandleKeyUpdateResponse(
} }
const std::string& signed_message = signed_response.msg(); const std::string& signed_message = signed_response.msg();
const std::string core_message = const std::string core_message =
supports_core_messages() ? signed_response.oemcrypto_core_message() signed_response.has_oemcrypto_core_message()
: std::string(); ? signed_response.oemcrypto_core_message()
: std::string();
const std::string& signature = signed_response.signature(); const std::string& signature = signed_response.signature();
License license; License license;

View File

@@ -562,6 +562,7 @@ void TestLicenseHolder::GenerateKeyRequest(
CdmAppParameterMap app_parameters; CdmAppParameterMap app_parameters;
CdmKeySetId key_set_id; CdmKeySetId key_set_id;
InitializationData init_data(init_data_type_string, key_id); InitializationData init_data(init_data_type_string, key_id);
if (g_cutoff >= LOG_DEBUG) init_data.DumpToLogs();
CdmKeyRequest key_request; CdmKeyRequest key_request;
CdmResponseType result = cdm_engine_->GenerateKeyRequest( CdmResponseType result = cdm_engine_->GenerateKeyRequest(
session_id_, key_set_id, init_data, kLicenseTypeStreaming, app_parameters, session_id_, key_set_id, init_data, kLicenseTypeStreaming, app_parameters,

View File

@@ -268,9 +268,13 @@ class WvCdmExtendedDurationTest : public WvCdmTestBase {
CdmResponseType *response) { CdmResponseType *response) {
CdmAppParameterMap app_parameters; CdmAppParameterMap app_parameters;
CdmKeyRequest key_request; CdmKeyRequest key_request;
const std::string init_data_type = "video/mp4";
if (g_cutoff >= LOG_DEBUG) {
InitializationData parsed_init_data(init_data_type, init_data);
parsed_init_data.DumpToLogs();
}
*response = decryptor_->GenerateKeyRequest( *response = decryptor_->GenerateKeyRequest(
session_id_, key_set_id_, "video/mp4", init_data, session_id_, key_set_id_, init_data_type, init_data,
license_type, app_parameters, nullptr, license_type, app_parameters, nullptr,
kDefaultCdmIdentifier, &key_request); kDefaultCdmIdentifier, &key_request);
if (*response == KEY_MESSAGE) { if (*response == KEY_MESSAGE) {

View File

@@ -326,6 +326,10 @@ class WvCdmFeatureTest : public WvCdmTestBase {
CdmKeyRequest key_request; CdmKeyRequest key_request;
std::string key_set_id; std::string key_set_id;
license_type_ = license_type; license_type_ = license_type;
if (g_cutoff >= LOG_DEBUG) {
InitializationData parsed_init_data(init_data_type, init_data);
parsed_init_data.DumpToLogs();
}
EXPECT_EQ( EXPECT_EQ(
expected_response, expected_response,
decryptor_.GenerateKeyRequest( decryptor_.GenerateKeyRequest(

View File

@@ -1776,6 +1776,10 @@ class WvCdmRequestLicenseTest : public WvCdmTestBase {
CdmKeyRequest key_request; CdmKeyRequest key_request;
std::string key_set_id; std::string key_set_id;
license_type_ = license_type; license_type_ = license_type;
if (g_cutoff >= LOG_DEBUG) {
InitializationData parsed_init_data(init_data_type, init_data);
parsed_init_data.DumpToLogs();
}
EXPECT_EQ( EXPECT_EQ(
expected_response, expected_response,
decryptor_->GenerateKeyRequest( decryptor_->GenerateKeyRequest(