[ Merge of http://go/wvgerrit/73044 ]
The tests currently get copied to /data/bin. Changes in location
of system libraries causes test failures when tests are unable to
find dependent dynamic libraries.
Bug: 123879070
Test: WV unit/integration tests
Change-Id: I86edbe33b4753238fcf8b84243ac6e6c058ea145
Merge from Widevine repo of http://go/wvgerrit/72392
This adds the ability of the reference code to set the maximum output
buffer size error discussed in the Recoverable Errors section of
http://go/wvdelta15
Bug: http://b/120572363 Add Recoverable Errors (mod mock)
Change-Id: I688caca22929e29b3548c3f7d1df5de5bd37bfa1
Merge from Widevine repo of http://go/wvgerrit/72388
The unreleased oemcrypto test code has been modifed to keep a
singleton for the life of the process. In order to do that, several
functions in the reference code have been made virtual, and some
initialization and termination has been moved from the constructor and
destructor to Initialize and Terminate.
Bug: http://b/120572363 Add Recoverable Errors (mod mock)
Test: unit tests
Change-Id: I300559195567a537c0700167514be0ea42363695
Merge from Widevine repo of http://go/wvgerrit/72386
This CL changes reference and testbed OEMCyrpto only.
Updates the logging of the key control block for testing by adding new
bits to log and cleaning up the format.
Also, update access to entitlement keys so that they can also have
their key control block logged in tests.
Test: reference and test code only.
Bug: http://b/113594182 Full Decrypt Path Testing - Top Level
Bug: http://b/68648263 Log Key Control Block
Change-Id: I259d6f29eceb9f097640aa50f43443e308797f69
This reverts commit 408509efdc.
Reason for revert: just kidding. We want to run the tests on
old devices, too.
Change-Id: I920fa825380638122f638e057bcfbe98b5f7b301
Merge from Widevine repo of http://go/wvgerrit/69563
This CL also disables unit tests that depend on the old test keybox when run
against OEMCrypto v13 or earlier.
Unit tests that require a particular API level have been
removed. This requirement for Android is tested in GTS tests.
Bug: 119316243
Test: unit tests
Change-Id: I9a13dbaee1693ecea906fd0184a8e2590dc5beed
(This is a merge of http://go/wvgerrit/70303)
This adds a platform.h file to abstract some of the differences
between Windows and POSIX platforms. This includes ntohl, setenv,
and ssize_t.
Bug: 122953649
Test: Android Unit Tests
Change-Id: I3235f3f284b53d24d7365ff3f4a06dcd9b403697
[ Merge of http://go/wvgerrit/70203 ]
The earlier property_get() method had a limitation on property length.
Properties of some new devices exceed that length. An error message
is returned rather than a truncated string. Replace its use with
android::base::GetProperty() which does not have a length limitation.
Bug: 115358798
Test: WV unit/integration tests
Change-Id: I46ce9a7e77bcd031225d0082f83c57d484fe5405
Bug: b/119881112
Merge of http://go/wvgerrit/68983
Test: Android + Linux tests for ref and L3
This CL removes tests from OEMCrypto that test shared license
functionality and code in the ref and L3 that handle shared licenses.
Change-Id: Ia11510d8db3fa6e471a4ebbdb371fd76b0812984
Merge of http://go/wvgerrit/68986
Bug: b/120797208
Test: Android + Linux unit tests
OEMCrypto v15.1 introduced changes to full decrypt path testing.
This CL reflects those changes for the Level 3 code, including
removing InitializeDecryptHash and changes to error reporting.
Change-Id: I09cec6743524d326cb1a6c3ba4dd1764dbefff5f
Merge from Widevine repo of http://go/wvgerrit/68464
The Full Decrypt Path Testing design has changed to remove
OEMCrypto_InitializeDecryptHash. This CL updates the unit tests and
reference code.
Bug: 120795057
Test: unit tests
Change-Id: Iee28fa9034dc21cee81c5b894c192e260375eeee
Merge from Widevine repo of http://go/wvgerrit/68184
Please add comments to the original documents at http://go/oemcrypto
or http://go/wvdelta15.
Some unit tests will need to be updated. Those will be in a separate CL.
bug: 120795057 Full Decrypt Path Testing - change design
bug: 119688262 Full Decryption Path Test update section in go/wvdelta15
bug: 117898271 Corrections to Documentation
bug: 119881959 Remove shared license from documentation.
bug: 80540710 Document double call to OEMCrypto_DeactivateUsageEntry
Test: documentation and comment change only
Change-Id: I1ef35e15207d3dabea8329a1f05518370ec099e6
(This is a merge of http://go/wvgerrit/69165)
This printf() in the OEMCrypto Unit Tests was causing two log messages
to run together in the log.
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: I5a981e201de347fc8fbdc50a94c7227f944f9e8c
Merge of http://go/wvgerrit/68187
This adds a unit test to verify that OEMCrypto_DeactivateUsageEntry
may be called several times without an error or changing the entry's
state.
Bug: 80540710
Test: unit tests
Change-Id: I594594bfde75c3e38a3b9efc51a667613a5da6ed
Bug: b/70299597
Merge of http://go/wvgerrit/67304
Test: Android, CE CDM, and Linux tests
There's a few different things that can go wrong in the L3
initialization, with seeding and device key failures among others. They
should be recorded in metrics to track. Along the same lines, since
multiple errors can happen in conjunction, metrics needs to change to
add more fields for errors. This CL also adds the
hidl_metrics_adapter_unittest to the Android test scripts.
Change-Id: Ie5bcf81bbe294a1136c58410f90087a13b3d911d
[ Merge of http://go/wvgerrit/67985 ]
Now that we can use C++11, we should use the cross-platform types for
clocks instead of the platform-specific versions.
Test: WV unit/integration tests.
Change-Id: I50318e3d1caf9e814f33f497f83c19c9f3c154a1
[ Merge of http://go/wvgerrit/67984 ]
Getting the address of the first element is invalid when the size is
0. Calling data() is valid when the size is zero so long as we
don't use the resulting pointer. This is important when we pass the
pointer to low-level functions like memcpy.
Also, MSVC is stricter about this and doesn't allow indexing the 0-th
element when it is empty. But GCC/Clang seem to be fine with it so
long as the object isn't used.
Test: WV unit/integration tests
Change-Id: Ic5d11da41dd3a185a63f86a6ea91e9b954fd699a
[ Merge of http://go/wvgerrit/67923 ]
Before, all symbols were being exported in the dynamic library. Now
only the public symbols are. This no longer has the unit tests load
the dynamic library, so we lose testing the dynamic integration; but
the unit tests use a lot of internals, even the top-level CDM ones.
Bug: 69271232
Bug: 69548115
Test: WV unit/integration tests
Change-Id: I62919937277ec785aca1f8b36b28caa2f9d8f3ea
[ Merge of http://go/wvgerrit/67884 ]
Now that we can use C++11, we should use the cross-platform std::mutex
type, not the custom pthread version.
Bug: 111850982
Test: WV unit/integration tests
Change-Id: If2fde2836826c5184609e6b1f3a6511206bd4594
* changes:
Changes to adapter + gyp to support v15
Add full decrypt path testing functionality to Level 3
Update pointers to substrings in Level 3
Update level 3 reference API for v15
Bug: b/117558570
Test: Android, CE CDM, and Linux tests
Merge of http://go/wvgerrit/67566
This CL adds changes to support the Level 3 upgrade to v15 with both the
dynamic and static adapters. It also rearranges the wvcrc.cpp files so
that the tests have their own copy and Level 3 can just use the one in
ref/src.
Change-Id: Ieee2859601881aa1800622454e6ce0345eb94aa7
Bug: b/117558570
Merge of http://go/wvgerrit/67565
This CL adds the methods and functionalities needed to compute and
verify hashes as part of decrypt as part of v15.
Change-Id: Ic0626b204571b5f748a6c913ab378fa353ab45d0
Bug: b/117558570
Merge of http://go/wvgerrit/67564
This CL updates LoadKeys, LoadEntitlementKeys, and RefreshKeys to use
OEMCrypto_Substrings of the provided message.
Change-Id: I47f7ef958adfb0a78c54db2e27b5c0a636ddad49
Bug: b/117558570
Merge of http://go/wvgerrit/67563
This CL adds certificate validation, a resource rating, sandbox
functions, build info, modifications to CopyBuffer, and an API
version update.
Change-Id: Id84a33f3553220a659ff628ceb99ab0dbb0ae7b4
(This is a merge of http://go/wvgerrit/66625)
Google C++ Style dictates that methods which override base class or
interface methods should be declared "override" but not "virtual". Since
our codebase has not had access to "override" until now, many of our
classes do not follow this rule. I've updated as many places as I could
find to follow Google C++ Style, which should hopefully help us catch
errors better in the future.
Bug: 111851141
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: Ic23e2e482e967256da306791532b5fec7b81b2f2
Bug: b/119276649
Merge from: http://go/wvgerrit/66367
Test: Android, CE CDM, Linux unit tests
The FileSystem interface as it exists expects an Open for a file and
then a Close when finished. However, the Close doesn't delete the file
itself and depending on the platform, the underlying impl_ as well,
leading to a memory leak. To fix this leak as well as harden against
future memory issues, this change refactors the interface to shift away
from raw pointers and towards smart pointers.
Change-Id: I7a7132ea95cd3775796a540f510b698f4f27dd24
Merge from Widevine repo of http://go/wvgerrit/66865
This CL updates the comments for the code that uses
InstallKeyboxOrCert to install a keybox or oem cert at runtime. There
is also a new unit test for the device id. There are not many unit
tests because we don't want to accidentally overwrite the production
keybox or cert on a device when running tests.
bug: 111725154
test: unit tests
Change-Id: Ide9b3d4732f3f96a723a128907babe7e59c02ffc
Merge from Widevine repo of http://go/wvgerrit/66708
This adds a unit test to verify that LoadKeys still works if the message is not
word alligned.
Test: unit tests on desktop and taimen (x86 and arm)
Bug: 68783727
Change-Id: Ib081a2c21af710b294772513c2c777ef1ac0daf0
Merge from Widevine repo of http://go/wvgerrit/66711
This addresses review comments for the OEMCrypto v15 CLs, as documented in
b/119685652.
Test: unit tests
Bug: 119685652
Change-Id: I0e7ce13dd80335eb1a12240df5c1df2c34ba4298
Merge from master branch of Widevine repo of http://go/wvgerrit/66081
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/65962
This CL changes function names in the v14 level 3 libraries to work with
the dynamic adapter. I also excluded several OEMCrypto unit tests from
running with a v14 oemcrypto because they require error code changes
introduced in v15.
Bug: 117888897 Fix backwards compatibility
Bug: 119313532 Integration test failing
Test: unit tests on taimen. Play Movies, ExoPlayer, Netflix play on taimen.
Some unit tests do not pass because Taimen uses a v13 oemcrypto. Most pass.
Change-Id: Ib8eb8a89591fdba3055064c4bdf90523b01309a8
Merge from master branch of Widevine repo of http://go/wvgerrit/66080
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64002
This CL updates OEMCrypto reference code and unit tests to support full decrypt
path testing.
Test: unit tests
Test: tested as part of http://go/ag/5501993
Bug: 34078913
Change-Id: Ia67374599d6619698a336f41513068ad04294e7f
Merge from master branch of Widevine repo of http://go/wvgerrit/66079
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/65662
This CL forces OEMCrypto_Initialize to be called before OEMCrypto_GetRandom is
called in the reference code.
Bug: 34847139
Test: tested as part of http://go/ag/5501993
Change-Id: Ibb94e2fdc11cdb43c2c7bd2a3379f87b0155479a
Merge from master branch of Widevine repo of http://go/wvgerrit/66078
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64022
This CL updates OEMCrypto ref code, unit tests, and core code for
setting the sandbox id before initializing OEMCrypto.
Test: unit tests only
Test: tested as part of http://go/ag/5501993
Bug: 115834255
Change-Id: Id9831680fe4db1c69413815931cae4bc80df0c01
Merge from master branch of Widevine repo of http://go/wvgerrit/66077
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64562
Bug: b/78357351
b/62058202 addressed issues with the Level 3 OEMCrypto in guarding
against rollback. This change does something similar for the ref, so
that OEMCrypto vendors have rollback-prevention code they can refer to.
Test: linux/ce cdm unit tests
Test: tested as part of http://go/ag/5501993
Change-Id: I76128c5def2615ecbdbe94e3af1fec4a025be8c1
Merge from master branch of Widevine repo of http://go/wvgerrit/66076
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64743http://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
Merge from master branch of Widevine repo of http://go/wvgerrit/66075
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64702
Bug: 118172995
Tests OEMCrypto_LoadKeys when given a KeyObject with NULL KeyControl or
KeyControl iv.
Test: tested as part of http://go/ag/5501993
Change-Id: I1a5d26b1e2ff395fbd5ef7769af1165222c1877e
Merge from master branch of Widevine repo of http://go/wvgerrit/66073
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64083
As part of the update to v15, LoadKeys, RefreshKeys, and
LoadEntitledContentKeys should all use offsets and lengths into the
message rather than a pointer for its parameters. The CDM, tests,
adapters, and OEMCrypto implementations are changed to reflect this.
Test: tested as part of http://go/ag/5501993
Bug: 115874964
Change-Id: I981fa322dec7c565066fd163ca5775dbff71fccf
Merge from master branch of Widevine repo of http://go/wvgerrit/66072
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/63764
This adds the function OEMCrypto_ResourceRatingTier to the oemcrypto referenece
code, dynamic adapter, and unit tests.
Bug: 117110800
Test: tested as part of http://go/ag/5501993
Change-Id: Idf47af405f0c69601108b75c788a97b30abdb39d
Merge from master branch of Widevine repo of http://go/wvgerrit/66071
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/63842
OEMCrypto tests log the HDCP value. This CL updates those logs to include logs
for HDCP 2.3.
Test: unit tests
Test: tested as part of http://go/ag/5501993
Bug: 78773763
Change-Id: I7a3003e081c3c848b5d595ac241a0b546dacb747
Merge from master branch of Widevine repo of http://go/wvgerrit/66070
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/63662
To make the threading model more clear, CopyBuffer is now a session function.
This means we need to pass in which session the current thread locks.
Test: unit tests.
Test: tested as part of http://go/ag/5501993
Bug: 113680369
Change-Id: I2fdd2cfcaab99f3793950b3845941463675f5e4c
Merge from master branch of Widevine repo of http://go/wvgerrit/66067
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/63002
The OEMCryptoCENC.h comments are now generated from the doc. This corrects
several years of drift caused by small changes to the doc that were not copied
to the header.
Test: tested as part of http://go/ag/5501993
Bug: 111939411
Change-Id: I56ab9c6cf280bc72b39f6ddafc26cf21f6074c98
Merge from master branch of Widevine repo of http://go/wvgerrit/66066
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/63628
The error code OEMCrypto_KEY_NOT_LOADED is redundant with
OEMCrypto_ERROR_NO_CONTENT_KEY and OEMCrypto_KEY_NOT_ENTITLED. The
function LoadEntitledContentKey should return KEY_NOT_ENTITLED if it
does not find the corresponding entitlement key in its key table. All
other functions that do not find a key id in the key table should
return OEMCrypto_ERROR_NO_CONTENT_KEY. This includes QueryKeyControl,
SelectKey, and RefreshKeys.
Test: unit tests
Test: tested as part of http://go/ag/5501993
Bug: 115574797
Change-Id: Ida2111f32e331b99f3f0c77fa404a42654d0870c