Delete secure stops by key set ID.

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

Similar to the issue with updating secure stops by PST (see
http://go/wvgerrit/165597), when deleting different secure stops with
the same PST results in unintended behavior.  This CL changes how the
CDM identifies which secure stop to delete from storaged based on the
key set ID rather than the PST.

Bug: 263316107
Test: device_files_unittest
Test: GTS MediaDrmParameterizedTests and MediaDrmStressTest
Change-Id: Ic3843a1435f252f052c7189423c211c28ed74eaa
This commit is contained in:
Alex Dale
2023-02-07 22:32:24 -08:00
parent 080bfc7414
commit 2c05c65138
6 changed files with 16 additions and 23 deletions

View File

@@ -1685,7 +1685,7 @@ CdmResponseType CdmEngine::RemoveAllUsageInfo(
}
if (!handle.DeleteUsageInfo(DeviceFiles::GetUsageInfoFileName(app_id),
usage_data[0].provider_session_token)) {
usage_data[0].key_set_id)) {
LOGW("Failed to delete usage info");
break;
}
@@ -1737,25 +1737,17 @@ CdmResponseType CdmEngine::RemoveUsageInfo(
new CdmSession(file_system_, metrics_->AddSession()));
usage_session_->Init(usage_property_set_.get());
CdmKeyMessage license_request;
CdmKeyResponse license_response;
UsageEntry usage_entry;
UsageEntryIndex usage_entry_index;
std::string drm_certificate;
CryptoWrappedKey wrapped_private_key;
if (!handle.RetrieveUsageInfo(
DeviceFiles::GetUsageInfoFileName(app_id), provider_session_token,
&license_request, &license_response, &usage_entry,
&usage_entry_index, &drm_certificate, &wrapped_private_key)) {
DeviceFiles::CdmUsageData usage_data;
if (!handle.RetrieveUsageInfo(DeviceFiles::GetUsageInfoFileName(app_id),
provider_session_token, &usage_data)) {
// Try other security level
continue;
}
if (usage_session_->SupportsUsageTable()) {
status = usage_session_->DeleteUsageEntry(usage_entry_index);
status = usage_session_->DeleteUsageEntry(usage_data.usage_entry_index);
if (!handle.DeleteUsageInfo(DeviceFiles::GetUsageInfoFileName(app_id),
provider_session_token)) {
usage_data.key_set_id)) {
status = CdmResponseType(REMOVE_USAGE_INFO_ERROR_1);
}
usage_session_.reset();