diff --git a/libwvdrmengine/include/WVErrors.h b/libwvdrmengine/include/WVErrors.h index 50550d3c..f795b68e 100644 --- a/libwvdrmengine/include/WVErrors.h +++ b/libwvdrmengine/include/WVErrors.h @@ -16,8 +16,7 @@ enum { kErrorIncorrectBufferSize = ERROR_DRM_VENDOR_MIN, kErrorCDMGeneric = ERROR_DRM_VENDOR_MIN + 1, kErrorUnsupportedCrypto = ERROR_DRM_VENDOR_MIN + 2, - kErrorCannotGuaranteeSecurity = ERROR_DRM_VENDOR_MIN + 3, - kErrorExpectedUnencrypted = ERROR_DRM_VENDOR_MIN + 4, + kErrorExpectedUnencrypted = ERROR_DRM_VENDOR_MIN + 3, // Used by crypto test mode kErrorTestMode = ERROR_DRM_VENDOR_MAX, diff --git a/libwvdrmengine/mediacrypto/src/WVCryptoPlugin.cpp b/libwvdrmengine/mediacrypto/src/WVCryptoPlugin.cpp index a8ae4511..965fbdcd 100644 --- a/libwvdrmengine/mediacrypto/src/WVCryptoPlugin.cpp +++ b/libwvdrmengine/mediacrypto/src/WVCryptoPlugin.cpp @@ -76,23 +76,6 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE], return kErrorUnsupportedCrypto; } - // If the caller requested secure decrypt, verify that we can comply. - if (secure) { - CdmQueryMap status; - - CdmResponseType res = mCDM->QueryStatus(&status); - - if (!isCdmResponseTypeSuccess(res)) { - ALOGE("Error querying CDM status: %u", res); - errorDetailMsg->setTo("Unable to verify ability to decode securely."); - return kErrorCannotGuaranteeSecurity; - } else if (status[QUERY_KEY_SECURITY_LEVEL] != - QUERY_VALUE_SECURITY_LEVEL_L1) { - errorDetailMsg->setTo("Secure decode is not supported on this device."); - return kErrorCannotGuaranteeSecurity; - } - } - // Convert parameters to the form the CDM wishes to consume them in. const KeyId keyId(reinterpret_cast(key), KEY_ID_SIZE); const vector ivVector(iv, iv + KEY_IV_SIZE); diff --git a/libwvdrmengine/mediacrypto/test/WVCryptoPlugin_test.cpp b/libwvdrmengine/mediacrypto/test/WVCryptoPlugin_test.cpp index 936b2414..73eee75a 100644 --- a/libwvdrmengine/mediacrypto/test/WVCryptoPlugin_test.cpp +++ b/libwvdrmengine/mediacrypto/test/WVCryptoPlugin_test.cpp @@ -91,35 +91,6 @@ TEST_F(WVCryptoPluginTest, CorrectlyReportsSecureBuffers) { "WVCryptoPlugin incorrectly expects a secure audio decoder"; } -TEST_F(WVCryptoPluginTest, RejectsSecureDecodeOnL3) { - MockCDM cdm; - WVCryptoPlugin plugin(sessionId, kSessionIdSize, &cdm); - - CdmQueryMap l3Map; - l3Map[QUERY_KEY_SECURITY_LEVEL] = QUERY_VALUE_SECURITY_LEVEL_L3; - - // Decrypt should not be called because we specified an unsupported - // security level - EXPECT_CALL(cdm, Decrypt(_, _, _, _, _, _, _, _)) - .Times(0); - - EXPECT_CALL(cdm, QueryStatus(_)) - .WillOnce(DoAll(SetArgPointee<0>(l3Map), - Return(wvcdm::NO_ERROR))); - - AString errorDetailMessage; - - ssize_t res = plugin.decrypt(true, keyId, iv, CryptoPlugin::kMode_AES_CTR, - in, subSamples, kSubSampleCount, out, - &errorDetailMessage); - - EXPECT_LT(res, 0) << - "WVCryptoPlugin allowed decryption to proceed despite being asked for an " - "unsupported security level"; - EXPECT_GT(errorDetailMessage.size(), 0u) << - "WVCryptoPlugin did not report a detailed error message."; -} - TEST_F(WVCryptoPluginTest, AttemptsToDecrypt) { MockCDM cdm; WVCryptoPlugin plugin(sessionId, kSessionIdSize, &cdm);