Fix IV handling for pattern encryption.
(This is a merge of modmaker@'s change from the Widevine repo, http://go/wvgerrit/48880) When using pattern encryption, WVCryptoPlugin needs to increment the IV after each subsample. It should increment it based on the number of actually encrypted samples (i.e. ignore clear data caused by subsamples or pattern encryption). In the common encryption spec, section 9.6.1 states: If the last Block pattern in a Subsample is incomplete, the partial pattern SHALL be followed until truncated by the BytesOfProtectedData size and any partial crypt_byte_block SHALL remain unencrypted. This fixes the counting of encrypted blocks to account for partial patterns. This also makes it more efficient by removing the loop. Bug: 111001481 Test: build_and_run_all_unit_tests Test: Widevine GTS Tests Change-Id: Ibd2bf10f64461b9bce10ef07453096fe4a4f6376
This commit is contained in:
@@ -72,8 +72,6 @@ struct WVCryptoPlugin : public ICryptoPlugin {
|
||||
Status_V1_2 attemptDecrypt(
|
||||
const wvcdm::CdmDecryptionParameters& params,
|
||||
bool haveEncryptedSubsamples, std::string* errorDetailMsg);
|
||||
static wvcdm::CdmResponseType countEncryptedBlocksInPatternedRange(
|
||||
size_t range, const Pattern& pattern, uint64_t* result);
|
||||
static void incrementIV(uint64_t increaseBy, std::vector<uint8_t>* ivPtr);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user