Add certificate information to offline licenses

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

Offline licenses will now store the DRM certificate information. This
allows for expired certificates to be deleted and replaced without
losing the ability to use offline licenses.

Bug: 169740403
Test: WV unit/integration tests
      DeviceFilesTest.RetrieveLicenses
      DeviceFilesTest.StoreLicenses
Change-Id: Ic0de6328d32e0000d1b58c81019e6c2227278cc4
This commit is contained in:
Rahul Frias
2021-03-19 23:26:54 -07:00
parent f6b4d140f4
commit 57ebb70fe7
5 changed files with 391 additions and 38 deletions

View File

@@ -1042,6 +1042,7 @@ CdmResponseType CdmSession::StoreLicense() {
bool CdmSession::StoreLicense(DeviceFiles::LicenseState state,
int* error_detail) {
DeviceFiles::ResponseType error_detail_alt = DeviceFiles::kNoError;
std::string drm_certificate;
DeviceFiles::CdmLicenseData license_data{
key_set_id_,
state,
@@ -1056,7 +1057,9 @@ bool CdmSession::StoreLicense(DeviceFiles::LicenseState state,
policy_engine_->GetGracePeriodEndTime(),
app_parameters_,
usage_entry_,
usage_entry_number_};
usage_entry_number_,
drm_certificate,
CryptoWrappedKey()};
bool result = file_handle_->StoreLicense(license_data, &error_detail_alt);
if (error_detail != nullptr) {