From 6c71aeaf95bb08b9ca04c379d868e1b2618ceb80 Mon Sep 17 00:00:00 2001 From: Edwin Wong Date: Fri, 19 May 2017 15:42:12 -0700 Subject: [PATCH] Revert conditional tests using a logical AND operator. Merge from http://go/wvgerrit/27480. Revert to the original test using a logical AND operator for is_encrypted and !CanDecryptContent tests. Test: GTS WidevineDashPolicyTests bug: 34258607 Change-Id: If42698aa77f6f49a79dedb11a15d3055d6b76ef2 --- libwvdrmengine/cdm/core/src/cdm_session.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libwvdrmengine/cdm/core/src/cdm_session.cpp b/libwvdrmengine/cdm/core/src/cdm_session.cpp index 2e7fcb60..27074247 100644 --- a/libwvdrmengine/cdm/core/src/cdm_session.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_session.cpp @@ -551,14 +551,13 @@ CdmResponseType CdmSession::Decrypt(const CdmDecryptionParameters& params) { // Playback may not begin until either the start time passes or the license // is updated, so we treat this Decrypt call as invalid. - if (params.is_encrypted) { - if (!policy_engine_->CanDecryptContent(*params.key_id)) { - if (policy_engine_->IsLicenseForFuture()) - return DECRYPT_NOT_READY; - if (!policy_engine_->IsSufficientOutputProtection(*params.key_id)) - return INSUFFICIENT_OUTPUT_PROTECTION; - return NEED_KEY; - } + if (params.is_encrypted && + !policy_engine_->CanDecryptContent(*params.key_id)) { + if (policy_engine_->IsLicenseForFuture()) + return DECRYPT_NOT_READY; + if (!policy_engine_->IsSufficientOutputProtection(*params.key_id)) + return INSUFFICIENT_OUTPUT_PROTECTION; + return NEED_KEY; } CdmResponseType status = crypto_session_->Decrypt(params);