Treat the (0,0) Pattern as 'cbcs'
(This is a merge of http://go/wvgerrit/94928.) In OEMCrypto v16, we dropped support for 'cens' and 'cbc1'. However, we did not redefine the pattern (0,0) to be a valid pattern for 'cbcs', even though it was no longer being used to signal 'cbc1'. Instead, we made the CDM reject CTR with a pattern ('cens') and CBC with a (0,0) pattern ('cbc1') to mirror the behavior of OEMCrypto v16. However, some apps have been using 'cbc1' mode to decrypt audio in 'cbcs' content. This is normally not possible but is possible for a subset of content. Furthermore, it is easy to do by accident because of the way most packagers package 'cbcs' audio and the special significance Widevine has historically given the (0,0) pattern. This patch updates the CDM to not reject CBC with a (0,0) pattern but instead treat it as 'cbcs' content. To decrypt it correctly, the pattern is treated specially inside the CDM core and converted to the recommended equivalent pattern — (10,0) — before passing the content to OEMCrypto. For more specifics, please see the design doc: http://go/vclfg Bug: 150219982 Test: ExoPlayer Demo App 'cbcs' Content Test: GTS 'cbcs' Content Change-Id: I334ff15db5f7b7d62040a036ba6d17515c3caee4
This commit is contained in:
@@ -1468,6 +1468,13 @@ CdmResponseType CryptoSession::Decrypt(
|
||||
// Convert the pattern descriptor
|
||||
OEMCrypto_CENCEncryptPatternDesc oec_pattern{params.pattern.encrypt_blocks,
|
||||
params.pattern.skip_blocks};
|
||||
// TODO(b/146581957): Remove this workaround once OEMCrypto treats (0,0) as
|
||||
// 'cbcs' instead of 'cbc1'.
|
||||
if (params.cipher_mode == kCipherModeCbc && oec_pattern.encrypt == 0 &&
|
||||
oec_pattern.skip == 0) {
|
||||
// (10, 0) is the preferred pattern for decrypting every block in 'cbcs'
|
||||
oec_pattern.encrypt = 10;
|
||||
}
|
||||
|
||||
// Check if a key needs to be selected
|
||||
if (is_any_sample_protected) {
|
||||
|
||||
Reference in New Issue
Block a user