Correct offline license handling
[ Merge of http://go/wvgerrit/28261 ] Licenses (offline, secure stops) that contain provider session tokens are handled securely using usage tables. A recent fix did not correctly handle offline licenses that do not contain a provider session token and are not handled by the TEE. b/62340248 Test: WV Unit/integration tests, GtsMediaTestCases Change-Id: Ia1331fea9deff44dd1d93219b37f5bea4b8ee168
This commit is contained in:
@@ -212,7 +212,14 @@ CdmResponseType CdmSession::RestoreOfflineSession(
|
||||
return GET_RELEASED_LICENSE_ERROR;
|
||||
}
|
||||
|
||||
if (usage_support_type_ == kUsageEntrySupport) {
|
||||
std::string provider_session_token;
|
||||
if (!license_parser_->ExtractProviderSessionToken(
|
||||
key_response_, &provider_session_token)) {
|
||||
provider_session_token.clear();
|
||||
}
|
||||
|
||||
if (usage_support_type_ == kUsageEntrySupport &&
|
||||
provider_session_token.size() > 0) {
|
||||
CdmResponseType sts = usage_table_header_->LoadEntry(crypto_session_.get(),
|
||||
usage_entry_,
|
||||
usage_entry_number_);
|
||||
@@ -236,7 +243,8 @@ CdmResponseType CdmSession::RestoreOfflineSession(
|
||||
}
|
||||
}
|
||||
|
||||
if (usage_support_type_ == kUsageEntrySupport) {
|
||||
if (usage_support_type_ == kUsageEntrySupport &&
|
||||
provider_session_token.size() > 0) {
|
||||
CdmResponseType sts =
|
||||
usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_);
|
||||
if (sts != NO_ERROR) {
|
||||
@@ -459,8 +467,10 @@ CdmResponseType CdmSession::AddKey(const CdmKeyResponse& key_response) {
|
||||
key_response_ = key_response;
|
||||
|
||||
if (is_offline_ || has_provider_session_token()) {
|
||||
if (usage_support_type_ == kUsageEntrySupport)
|
||||
if (has_provider_session_token() &&
|
||||
usage_support_type_ == kUsageEntrySupport) {
|
||||
usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_);
|
||||
}
|
||||
|
||||
if (!is_offline_)
|
||||
usage_provider_session_token_ =
|
||||
|
||||
Reference in New Issue
Block a user