Search for keys in shared sessions only when content is encrypted
Also return NEED_KEY rather than KEY_ERROR if keys are not found. Merge of https://widevine-internal-review.googlesource.com/#/c/8250 from the widevine cdm repo. b/11375092 Change-Id: Ibc629e8b4018f43f5f9528258563a2af79bdfb4b
This commit is contained in:
@@ -119,11 +119,12 @@ CdmResponseType WvContentDecryptionModule::Decrypt(
|
||||
const CdmSessionId& session_id,
|
||||
const CdmDecryptionParameters& parameters) {
|
||||
CdmSessionId id = session_id;
|
||||
if (Properties::GetSessionSharingId(session_id) != 0) {
|
||||
if (parameters.is_encrypted &&
|
||||
Properties::GetSessionSharingId(session_id) != 0) {
|
||||
bool status = cdm_engine_->FindSessionForKey(*parameters.key_id, &id);
|
||||
if (!status) {
|
||||
LOGE("WvContentDecryptionModule::Decrypt: unable to find session");
|
||||
return KEY_ERROR;
|
||||
return NEED_KEY;
|
||||
}
|
||||
}
|
||||
return cdm_engine_->Decrypt(id, parameters);
|
||||
|
||||
Reference in New Issue
Block a user