Fix for b/8594163 [SelectContentKey(): No key matches key id]

...when playing clear parts of encrypted content.

Change-Id: I5fb027d22212f07b43deced2da77c98cb3800e7f
This commit is contained in:
Jeff Tinker
2013-04-11 14:14:55 -07:00
parent 3711ca87ae
commit 2f980d7d7e
4 changed files with 109 additions and 14 deletions

View File

@@ -856,6 +856,12 @@ bool CryptoEngine::DecryptCTR(SessionContext* session,
void* clear_data,
BufferType buffer_type) {
if (! is_encrypted) {
memcpy(reinterpret_cast<uint8_t*>(clear_data),
&cipher_data[0], cipher_data.size());
return true;
}
// Check there is a content key
if (session->current_content_key() == NULL) {
LOGE("[DecryptCTR(): OEMCrypto_ERROR_NO_CONTENT_KEY]");
@@ -902,12 +908,6 @@ bool CryptoEngine::DecryptCTR(SessionContext* session,
return true;
}
if (! is_encrypted) {
memcpy(reinterpret_cast<uint8_t*>(clear_data),
&cipher_data[0], cipher_data.size());
return true;
}
// Local copy (will be modified).
uint8_t aes_iv[AES_BLOCK_SIZE];
if (static_cast<int>(iv.size()) != AES_BLOCK_SIZE) {