Merge from Widevine repo of http://go/wvgerrit/10308
There was a memory leak in the oemcrypto RSA code.
Also, when saving the usage table, some session variables were
allocated twice. This results in session data being lost.
There were also some leaks and uninitialized values in oemcrypto_test.
I added some checks and profiling to the debug runtime for the
haystack. It will warn if a variable is left unencrypted or is
unencrypted twice. I also added the profile code.
Versions of L3 library:
android/level3/arm/libwvlevel3.a Level3 Library Apr 1 2015 11:40:06
android/level3/x86/libwvlevel3.a Level3 Library Apr 1 2015 12:44:32
b/19950814
Change-Id: Ic752e36c09fce121dcaf92f9209591e74f3eb070
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 is a merge of http://go/wvgerrit/13922 from the Widevine CDM
repository.)
I'm not sure why we chose to pass char* instead of std::string to the
helper functions in DeviceFiles, but it seems to require a lot of
gymnastics of the calling code for minimal gain.
Change-Id: Ie0cdec80ab77c94370648dd74249124aed6e8be1
(This is a merge of http://go/wvgerrit/13910/ from the Widevine CDM
repository.)
DeviceFiles has a lot of repeated code whenever it needs to check for
file existence or remove a file. When reading and writing files, it
has wrappers that handle this repeated burden. This change adds
wrappers for the other functionality used by DeviceFiles as well, to
reduce duplication.
Change-Id: If959b504672c1b907346d28f31648d8028de8bdf
(This is a merge of http://go/wvgerrit/13911/ from the Widevine CDM
repository.)
This wasn't causing problems anywhere yet, but the headers included by
file_store.h were not the headers it actually needed.
Change-Id: I89e6fd30efc8837ba44ce6cfd6d7a7b77db7197a
Copy from Widevine repository of http://go/wvgerrit/13841
This CL adds a nonblocking CopyBuffer to OEMCrypto, its unit tests,
and plumbs it up to the cdm CryptoSession and CdmEngine.
b/19543782
Change-Id: I4c88bd2f8d7f67ecccb549c1934b7c0da15a8429
Merge from Widevine repo http://go/wvgerrit/13818
This CL adds the ability to query OEMCrypto about the key control
block and duration of a key that has been loaded. There are unit
tests and implementation in the level 3 and reference implementation.
b/18503541
Change-Id: I8e40d90a3c64c1ce030af6fef9e98c8eac0df1a5
Merge from Widevine repo if http://go/wvgerrit/13781
This CL adds several unit tests that are specifically designed to test
features that are required for Android CDM but not other platforms.
Once this CL has been merged, future CLs will modify the main
oemcrypto test file so that some tests are skipped if their features
are not implemented.
Change-Id: I55b8cbb9c13d2db88bd4f56bba31a4aab3306067
This is a merge of http://go/wvgerrit/13751 from the widevine
repository.
The CryptoSession had an enumeration for HDCP levels that was copied
from OEMCryptoCENC.h by hand. Since that header is included, there is
no need to have two enumerations.
b/16303994
Change-Id: Ief16ba62163776f9ca80375f3638ef4c7770e742
Also pass session_id and event_listener to PolicyEngine to make it easier
to dispatch events from PolicyEngine.
Bug: 19771437
Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13816/
Change-Id: I5723cb371cb3c43c945051af3402b09069ba5859
(This is a merge of http://go/wvgerrit/13761 from the Widevine
repository.)
This cleans up our includes to be in Google Style Guide order and in
alphabetic order, for the parts of the code that are expected to
follow Google Style.
This also converts places in our code that were including C headers
in the C++ style (i.e. <cstring> instead of <string.h>) to use C style
instead. This is because, although it was not causing problems for us
yet, on Android these actually include different headers. (<cstring>
is provided by libcxx, while <string.h> is provided by Bionic)
Lastly, this change puts all headers that do not come from within our
project in <brackets> instead of "quotes," which was not being done
consistently.
This change is explicitly NOT trying to standardize the spacing of our
header includes. I have tried to respect, in each file, the spacing
style already present.
Change-Id: If3dc06532ab9b68010285d64518ef21dce3d6354
It's hard to correlate test failures with the tests that
were running when looking in the logcat. This change adds
the current test name in the log for each test to make it
more clear.
Merge of go/wvgerrit/#/c/13847/ from the widevine cdm repo
b/19822500
Change-Id: Idd37a22f7063d9d686d3ead567954b86fb0fa70f
Remove renewal related expectations from WvCdmStreamingPstTest.
Also clean up the code in cdm_extended_duration_test.cpp.
Bug: 19534907
Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13842/
Change-Id: I89f9aafd80c8867af541b29bc8a6778f53a8b7e6
Change anti_rollback_hardware_present field name in ClientCapabilities
message to indicate the field is for usage table rollback prevention.
Merge from go/wvgerrit/13817.
bug: 19869828
Change-Id: I982bfe484aa39a54d0c3a9ae60dd9e46351385d9
This CL allows the framework CLs to compile. The stubs need to
be implemented properly in the DRM plugin and CDM.
bug: 19771299
Change-Id: I9e4b107370a4d73851ee28bcb9ab6087fdffeb13
The return type of GetResponse() has been changed from int to bool a while back.
Fix the return type in unit tests that were still expecting int as the return type.
Also log the response message if there is an error in the http response.
Merged from go/wvgerrit/13783.
bug: 19822500
Change-Id: Ie52df0e19744a847690b788680f59915b0b6b534
Merge of http://go/wvgerrit/13750 in the Widevine repo.
(titled: Add HDCP Capacity to the static adpater)
Updates CryptoSession to use get the HDCP capability from the
oemcrypto with requested security level.
Change-Id: I2338a3f33d0fbe9fe43eb6bf1fe92bf5402f62d6
This is a merge of http://go/wvgerrit/13752
Replace the mock's macro with a memcmp because that is
even cleaner.
Change-Id: Ie402689ca9e14a67736db7eea928204f067427ac
This is a merge of http://go/wvgerrit/13701 and http://go/wvgerrit/13780.
I added a new set of engine properties for the mock oemcrypto. This
set pretends to be level 1. This allows the widevine build bot to test
the dual security level path: a level 1 liboemcrypto.so and a fall
back to L3.
I also adjusted the failing test in oemcrypto_test.cpp. A correct fix
requires us to rewrite some of the oemcrypto mock code so that it
returns real error codes instead of just 'false' on error.
Change-Id: I9cdbfc23c87ad2fb6068eac1394ce4c5b6a32dae
This is a merge of http://go/wvgerrit/13693 in the Widevine
repository.
This adds level 3 and mock implementation and unit tests for the
OEMCrypto function OEMCrypto_ForceDeleteUsageEntry. It also plumbs
this function up into CdmEngine, CdmSession, and CryptoSession so that
deleting all usage information for a given app id will now delete the
entries in OEMCrypto, too.
b/18194071
Change-Id: Iaea4034a507b323878657215784edfe95876386a
This is a merge of http://go/wvgerrit/13710
The oemcrypto adapter loads a version 8, 9 or 10 library and adds
backwards compatibility for version 8 or 9.
The only function whose signature has changed from v9 to v10 is
OEMCrypto_GetHDCPCability. This CL adds backwards compatibility for
that function.
Level 3 libraries are now:
level3/arm/libwvlevel3.a Level3 Library Mar 17 2015 14:33:34
level3/x86/libwvlevel3.a Level3 Library Mar 17 2015 14:30:23
b/19785099 L1 Widevine missing/broken on master (Fugu)
b/19789909 L1 Widevine missing on master (AAY75B)
Change-Id: I9bd716f5cdffaf1bfbdfcd8ed067af3f5d0ac9ba
This is a cherry pick of http://go/wvgerrit/13665
Added a few static casts and removed some unused parameters.
Change-Id: I4f2d1c26580a188de429defc8d1d22757f4c6917