Don't add offsets to ion handles
Fixes a secure buffer addressing offset error in the Widevine CENC drm engine. bug: 8667527 Merges the following from Widevine CDM repository: Allow specification of offset into secure buffer https://widevine-internal-review.googlesource.com/#/c/5100/ Update WVCryptoPlugin to Pass Output Offset as a Separate Parameter https://widevine-internal-review.googlesource.com/#/c/5120/ Add offset to secure data buffer in OEMCrypto DecryptCTR https://widevine-internal-review.googlesource.com/#/c/5110/ Change-Id: Ic3e4b35304c8fbae4aebe4c495285eb787e8c205
This commit is contained in:
@@ -118,7 +118,7 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
CdmResponseType res = mCDM->Decrypt(mSessionId, false, keyId,
|
||||
source + offset,
|
||||
subSample.mNumBytesOfClearData,
|
||||
ivVector, 0, dest + offset);
|
||||
ivVector, 0, dest, offset);
|
||||
|
||||
if (!isCdmResponseTypeSuccess(res)) {
|
||||
ALOGE("Decrypt error result in session %s during unencrypted block: %d",
|
||||
@@ -136,7 +136,8 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
CdmResponseType res = mCDM->Decrypt(mSessionId, true, keyId,
|
||||
source + offset,
|
||||
subSample.mNumBytesOfEncryptedData,
|
||||
ivVector, encrypted_offset % 16, dest + offset);
|
||||
ivVector, encrypted_offset % 16, dest,
|
||||
offset);
|
||||
|
||||
if (!isCdmResponseTypeSuccess(res)) {
|
||||
ALOGE("Decrypt error result in session %s during encrypted block: %d",
|
||||
|
||||
@@ -23,10 +23,10 @@ using namespace wvdrm;
|
||||
|
||||
class MockCDM : public WvContentDecryptionModule {
|
||||
public:
|
||||
MOCK_METHOD8(Decrypt, CdmResponseType(const CdmSessionId&, bool, const KeyId&,
|
||||
MOCK_METHOD9(Decrypt, CdmResponseType(const CdmSessionId&, bool, const KeyId&,
|
||||
const uint8_t*, size_t,
|
||||
const std::vector<uint8_t>&, size_t,
|
||||
void*));
|
||||
void*, size_t));
|
||||
|
||||
MOCK_METHOD1(QueryStatus, CdmResponseType(CdmQueryMap*));
|
||||
};
|
||||
@@ -130,22 +130,22 @@ TEST_F(WVCryptoPluginTest, AttemptsToDecrypt) {
|
||||
|
||||
EXPECT_CALL(cdm, Decrypt(ElementsAreArray(sessionId, kSessionIdSize), true,
|
||||
ElementsAreArray(keyId, KEY_ID_SIZE), in, 16,
|
||||
ElementsAreArray(iv, KEY_IV_SIZE), 0, out))
|
||||
ElementsAreArray(iv, KEY_IV_SIZE), 0, out, 0))
|
||||
.WillOnce(Return(wvcdm::NO_ERROR));
|
||||
|
||||
EXPECT_CALL(cdm, Decrypt(ElementsAreArray(sessionId, kSessionIdSize), false,
|
||||
ElementsAreArray(keyId, KEY_ID_SIZE), in + 16, 16,
|
||||
ElementsAreArray(iv, KEY_IV_SIZE), 0, out + 16))
|
||||
ElementsAreArray(iv, KEY_IV_SIZE), 0, out, 16))
|
||||
.WillOnce(Return(wvcdm::NO_ERROR));
|
||||
|
||||
EXPECT_CALL(cdm, Decrypt(ElementsAreArray(sessionId, kSessionIdSize), true,
|
||||
ElementsAreArray(keyId, KEY_ID_SIZE), in + 32, 24,
|
||||
ElementsAreArray(iv, KEY_IV_SIZE), 0, out + 32))
|
||||
ElementsAreArray(iv, KEY_IV_SIZE), 0, out, 32))
|
||||
.WillOnce(Return(wvcdm::NO_ERROR));
|
||||
|
||||
EXPECT_CALL(cdm, Decrypt(ElementsAreArray(sessionId, kSessionIdSize), true,
|
||||
ElementsAreArray(keyId, KEY_ID_SIZE), in + 56, 8,
|
||||
ElementsAreArray(iv, KEY_IV_SIZE), 8, out + 56))
|
||||
ElementsAreArray(iv, KEY_IV_SIZE), 8, out, 56))
|
||||
.WillOnce(Return(wvcdm::NO_ERROR));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user