Optimize Status Queries in WVCryptoPlugin By Deleting Them
Removes the status query from WVCryptoPlugin's decrypt method. It was not providing any additional security since it was not cryptographically secure, and querying status is an expensive operation on some devices. It should not be done on a frequent basis, such as in every decrypt call. Bug: 8667365 Merge of https://widevine-internal-review.googlesource.com/#/c/5121/ from widevine CDM repository to android repository. Change-Id: Id9a877c5655cb8dbee7e97f983d43ec2ab6acc6e
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user