Don't Validate Crypto Mode for Unencrypted Decrypt

(This is a merge of http://go/wvgerrit/17661)

Because Widevine core always has a decrypt mode set, even on unencrypted
calls where we potentially do not know the crypto mode, it will reject
unencrypted decrypt calls for sessions that have been flagged as
AES-CBC, since the crypto mode defaults to AES-CTR.

The fix is to not validate the crypto mode on unencrypted decrypt calls,
as the data won't be getting decrypted anyway.

Bug: 28423928
Change-Id: If848834dd498ca96983a2b69d448b8d81d50e0a4
This commit is contained in:
John "Juce" Bruce
2016-04-27 12:20:18 -07:00
parent ecfd61e803
commit 6d2822f6c6

View File

@@ -678,7 +678,7 @@ CdmResponseType CryptoSession::Decrypt(const CdmDecryptionParameters& params) {
params.encrypt_buffer, params.encrypt_length,
&buffer_descriptor, params.subsample_flags);
}
if (params.cipher_mode != cipher_mode_) {
if (params.is_encrypted && params.cipher_mode != cipher_mode_) {
return INCORRECT_CRYPTO_MODE;
}
if (params.is_encrypted || sts == OEMCrypto_ERROR_NOT_IMPLEMENTED) {