From 36968de6717786e87cab65067ef746fe7336c2fe Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Sat, 30 May 2020 20:50:53 -0700 Subject: [PATCH] Do not verify decrypt hash when no key selected Merge from Widevine repo of http://go/wvgerrit/101143 This CL removes the check for a decrypt hash error when CopyBuffer is used instead of DecryptCenc because a key was not selected. We also remove the attempt to check the decrypt hash when there are multiple buffers, because that is not well defined behavior. Bug: 155185867 Bug: 155192141 Test: ran unit tests on taimen and on v16 reference oemcrypto Change-Id: I640e904e256f0913ca606bb5db891430b23f44a3 --- libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index 02e4e838..59708cf6 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -2203,10 +2203,11 @@ class OEMCryptoSessionTestsDecryptTests void TestDecryptCENC() { OEMCryptoResult sts; + // OEMCrypto only supports providing a decrypt hash for one sample. + if (samples_.size() > 1) verify_crc_ = false; + // If supported, check the decrypt hashes. if (verify_crc_) { - // OEMCrypto only supports providing a decrypt hash for the first sample - // in the sample array. const TestSample& sample = samples_[0]; uint32_t hash = @@ -2261,7 +2262,7 @@ class OEMCryptoSessionTestsDecryptTests } } } - if (global_features.supports_crc) { + if (verify_crc_) { uint32_t frame; ASSERT_EQ(OEMCrypto_GetHashErrorCode(session_.session_id(), &frame), OEMCrypto_SUCCESS);