Update OEMCrypto calls to use substrings (addendum)

Merge from master branch of Widevine repo of http://go/wvgerrit/66076
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64743

http://go/wvgerrit/64083 had some refactorings that weren't completely
accurate or slightly changed the meaning of some tests. This CL is an
addendum to that CL to fix those refactorings.

Test: tested as part of http://go/ag/5501993
Bug: 115874964

Change-Id: I37766a4c34de737eb9ca94ef781805435ee30dfd
This commit is contained in:
Srujan Gaddam
2018-11-12 14:19:29 -08:00
committed by Fred Gylys-Colwell
parent 4d5e0f961b
commit b7e4b56934
2 changed files with 29 additions and 24 deletions

View File

@@ -401,7 +401,10 @@ void Session::LoadEntitledContentKeys(OEMCryptoResult expected_sts) {
reinterpret_cast<const uint8_t*>(
encrypted_entitled_message_.data() +
encrypted_entitled_key_array[i].content_key_data.offset);
memcpy(&iv[0], encrypted_content_key_data, 16);
memcpy(&iv[0],
message_ptr() +
encrypted_entitled_key_array[i].content_key_data_iv.offset,
16);
AES_cbc_encrypt(content_key_data,
const_cast<uint8_t*>(encrypted_content_key_data),
encrypted_entitled_key_array[i].content_key_data.length,