Add backward compatibility to OEMCrypto_CopyBuffer
Merge from Widevine repository of http://go/wvgerrit/13912 This CL falls back to OEMCrypto_DecryptCTR if the oemcrypto library does not implement OEMCrypto_CopyBuffer. This allows devices with oem crypto version 9 to function as they previously did. Change-Id: Id3a4a94b1fd559f426ee260cfbf7077fa9101d8b
This commit is contained in:
@@ -1068,10 +1068,12 @@ OEMCryptoResult SessionContext::DecryptCTR(
|
||||
OEMCryptoBufferType buffer_type) {
|
||||
// If the data is clear, we do not need a current key selected.
|
||||
if (!is_encrypted) {
|
||||
if (buffer_type == OEMCrypto_BufferType_Direct)
|
||||
return OEMCrypto_ERROR_NOT_IMPLEMENTED;
|
||||
memcpy(reinterpret_cast<uint8_t*>(clear_data), cipher_data,
|
||||
cipher_data_length);
|
||||
if (buffer_type != OEMCrypto_BufferType_Direct){
|
||||
memcpy(reinterpret_cast<uint8_t*>(clear_data), cipher_data,
|
||||
cipher_data_length);
|
||||
return OEMCrypto_SUCCESS;
|
||||
}
|
||||
// For reference implementation, we quietly drop the clear direct video.
|
||||
return OEMCrypto_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user