Merge "Start rental clock when nonce-free offline license loaded" into rvc-d1-dev am: d24b3d4bd2

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12184965

Change-Id: Idb4570f166748606d74618bce155aaba81c5f9d3
This commit is contained in:
TreeHugger Robot
2020-07-21 10:39:10 +00:00
committed by Automerger Merge Worker

View File

@@ -286,6 +286,15 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id,
key_response_, &provider_session_token) ||
usage_table_header_ == nullptr) {
provider_session_token.clear();
// TODO(b/161023174): remove this code in v17.
std::string fake_message("empty message");
std::string core_message;
std::string license_request_signature;
// Sign a fake message so that OEMCrypto will start the rental clock. The
// signature and generated core message are ignored.
CdmResponseType status = crypto_session_->PrepareAndSignLicenseRequest(
fake_message, &core_message, &license_request_signature);
if (status != NO_ERROR) return status;
} else if (!VerifyOfflineUsageEntry()) {
LOGE("License usage entry is invalid, cannot restore");
return LICENSE_USAGE_ENTRY_MISSING;