Merge from Widevine repo of http://go/wvgerrit/24241
The CL also only modifies existing tests so that they will pass
with an old version of OEMCrypto, or it filters out the tests so
that they do not run. This positions us so that we can more
easily verify how much backwards compatibility we expect to work.
bug: 35877886
Change-Id: Iadc06672d7f9cef75800662ff83389c504a3fd04
(This is a merge of go/wvgerrit/23686)
This patch removes the makefile lines that previously prevented the
Widevine DRM Plugin from being built as 64-bit on Android. 64-bit
builds are now fully supported.
Only one piece of CDM code has had to change. Due to a bug in
libprotobuf before v3.0, int64 values from protobufs are technically a
different type from int64_t values in code on some 64-bit
architectures. Both have the same in-memory representation at runtime
but are seen as distinct types by the compiler. The compiler will
automatically convert in most places, but template instantiation is
not one of them, so a few places that passed a Protobuf int64 directly
into a template had to be modified.
Please note that tweaks to the mediadrmserver (not covered by this
patch) are needed in order for it to run as 64-bit and load 64-bit DRM
Plugins. Please also note that, as we have no 64-bit L1 OEMCrypto on
any devices, using the 64-bit mediadrmserver and Widevine library will
make your device fall back to L3 for the time being.
Bug: 18949752
Test: OEMCrypto unit tests
Test: Widevine unit tests
Test: Google Play (on Marlin)
Test: Widevine GTS Tests (on Marlin)
Change-Id: Ib6cdf2dd1ff75a1c473cacdc5e22397caa0a656c
Merge from Widevine repo of http://go/wvgerrit/23581
This CL adds some unit tests to oemcrypto to verify that DecryptCENC
and the generic encrypt and decrypt functions behave correctly when
the input and output buffer is the same. i.e. decrypt in place.
The mock and haystack are also updated to pass the tests.
b/34080119
Change-Id: Ie295bdaddbb8058bebb36f6dab092d307f249ecd
Merge from Widevine repo of http://go/wvgerrit/24043
This CL simplifies the way the oemcrypto dynamic adapter handles
backwards compatibility while looking up old function pointers.
It also puts in guards for functions that do not have pointers.
Current Level 3 libraries merged from http://go/wvgerrit/23686/
level3/arm64/libwvlevel3.a Level3 Library 7283 Feb 15 2017 13:39:10
level3/mips64/libwvlevel3.a Level3 Library 7285 Feb 15 2017 13:51:12
level3/arm/libwvlevel3.a Level3 Library 4445 Feb 15 2017 14:20:04
level3/x86_64/libwvlevel3.a Level3 Library 7284 Feb 15 2017 13:43:04
level3/x86/libwvlevel3.a Level3 Library 4464 Feb 15 2017 14:14:55
level3/mips/libwvlevel3.a Level3 Library 4465 Feb 15 2017 14:10:04
Test: OEMCrypto Unit tests pass on bullhead, fugu, and all
six emulators. A bullhead was crippled to use L3 only, and
Play Movies worked OK. ExoPlayer tests were also run on the
bullhead. L1 was re-installed on the bullhead, and Play Movies and
ExoPlayer tests were repeated with no problems.
Bug: 18949752
Bug: 31458046
Change-Id: I8668fde1ce8a045c71bf33c566f3ff86e11821c5
Merge from Widevine repo of http://go/wvgerrit/24305
This CL adds a pdf of the document "Widevine L1 Provisiong Models"
to the source directory so we can share with partners.
bug: 35880276
Change-Id: I60ea958b2e4cefc783c692ad78784b7071f59e2e
Merge from Widevine repo of http://go/wvgerrit/24205
This adds a single retry to each call into cdm_engine that uses a
nonce. This should prevent spurious tests failing because they
accidentally generated a nonce flood.
bug: 35879493
Change-Id: I99a5f2063f04befb74361ff44c4ce8e34f41e89d
Merge from Widevine repo of http://go/wvgerrit/24042
This CL adjusts the tolerance in tests that check the license_received
time. This was periodically failing because a nonce flood might delay
the test by 1 second, which was being rounded up to 2. The tolerance
is now 3. The time is explicily used when it is available. Some
extra logging is also added to the mock.
bug:31458046
Change-Id: I450880cb3cd8bd5ef66cba13b94dd963d2663d9a
Merge from Widevine repo of http://go/wvgerrit/23482
Now that the documentation has been approved, it's time to
copy text from http://go/oemcrypto to OEMCryptoCENC.h
This also has all the little tweaks to the documents that have been
requested over the past couple of weeks.
b/31458046
Change-Id: I5b865031eb7945005c06bf1b00ecfaaedcad15f4
This CL removes some unused variables, and changes some integers to
unsigned integers. On some platforms, we were getting compiler errors
and unit test failures.
Merge from Widevine repo of http://go/wvgerrit/23840
Use unsigned integer literals
Merge from Widevine repo of http://go/wvgerrit/23767
Fix Gyp Files
Merge from Widevine repo of http://go/wvgerrit/23500
Remove unused variables
bug: 31458046
Change-Id: I4dfec95ae49187262552fbbf322f3310ab777826
Merge from Widevine repo of http://go/wvgerrit/23842
This CL updates the android make files and test scripts to include the
two new unit test suites in metrics/test.
Change-Id: Ie31bdc3ae3709ab116d2a340ee5b55c7c12d1d33
Merge from Widevine repo of http://go/wvgerrit/23865
This adds the following tests to the oemcrypto usage tables suite:
Forbid shrinking the usage table over open sessions.
Shrinking usage table must make it smaller, not larger.
Forbid creation of new usage table while open sessions using old.
Change-Id: Ia97a3f4d3ef53417c4f8c98f8ed6ef9ea06d7fad
[ Merge of http://go/wvgerrit/24022 ]
b/34327459
Test: Verified by unit, integration tests on angler
Change-Id: Idb17dc472dddbdad217c35bdaa3fb20ae8152371
[ Merge of http://go/wvgerrit/23980 ]
In OEMCrypto version 13, usage information is updated by calls to
OEMCrypto_UpdateUsageEntry. In previous versions calls were made to
OEMCrypto_UpdateUsageTable instead. Both need to be supported as the
OEMCrypto version may vary by device.
This consolidates calls to OEMCrypto_UpdateUsageTable so that they
can be disabled if OEMCrypto version >= 13. No functional changes other
than disabling by OEMCrypto version were introduced in this section.
Helper routines have been added to device files as well.
b/34327459
Test: Verified by unit, integration tests on angler
Change-Id: If5d4bbbe7589e7cc1094999ba21f727eb6c92c3b
[ Merge of http://go/wvgerrit/23820 ]
The UsageTableHeader class is a singleton that CDM sessions will share.
A separate object will be created for each security level. The class
synchronizes access to usage table header and associated data-structures
and controls when they are read in or written out to non-secure persistent
storage. Upgrades from a fixed size usage table (supported by previous
versions of the OEMCrypto API v9-12) are handled by this class.
b/34327459
Test: Verified by unit/integration tests on angler
Change-Id: Ifc5996985e76bc260c01e55bc12aab1248389a80
[ Merge of http://go/wvgerrit/23742 ]
In OEMCrypto V13, usage table header and usage entries are stored in
persistent non-secure storage and loaded and unloaded from the TEE.
Information needs to be maintained to assist finding the associated license
or usage information. This information has been revised for usage information
to use key set id and usage info file name rather than provider session
token and app id.
The app id is stored in a hashed form (usage info file name) and was not
extractable during the upgrade process to OEMCrypto V13. Due to this
DeviceFiles UsageInfo routines have switched to use usage info file name
rather than app id as a key.
b/34327459
Test: Verified by unit/integration tests on angler
Change-Id: I95aa0435d0955c61fc45b951f5b5d44de2ba5cfc
[ Merge of http://go/wvgerrit/23741 ]
Usage entries and usage entry numbers need to be stored with license
and usage information, to facilitate loading usage entries when offline
licenses/usage information are restored or prepared for release.
b/34327459
Test: Validated by running unit/integration tests on angler.
Change-Id: I0949fc4cec8a50be0a7700b659dc12bb82ac6f73
[ Merge of http://go/wvgerrit/23522 ]
A helper method has been added to CryptoSession to determine whether the
TEE supports usage tables, usage table headers+entries or does not
provide any support for persistent licenses.
In addition
* CryptoSession now supports deletion of multiple
usage entries rather than a single one.
* Typedefs have been added for usage table headers and entries
b/34327459
Test: Verified by unit/integration tests on angler.
Change-Id: I634d3b7b81ce94d1deccd2a7aaf26b9efde414a8
[ Merge of http://go/wvgerrit/23600 ]
This adds a new entry to IStorage:: -
bool list(std::vector<std::string> file_names)
It returns the name of each file in the (origin-specific) file system.
b/34628115
Uses the current file system (origin-specific) bound to the CDM. Returns
the list of stored licenses (key_set_ids) in vector output parameter.
Test: verified by unittests on angler.
Change-Id: I988556b27c2a4b75f52b59bcd78cfeaddd649acd
[ Merge of http://go/wvgerrit/23533 ]
Prior to this CL libcdm_protos was included as LOCAL_WHOLE_STATIC_LIBRARIES
b/34393411
Test: Ran unittests and streaming/offline playback using playmovies.
Change-Id: I4cdea8620693ee7660c71e44d08122acd07843a2
Merge from Widevine repo of http://go/wvgerrit/23436
This change is just comment changes: minor rewording and grammar
fixes.
Change-Id: I4cb2ef77715623fdb2567f5b504ffaceb937a480
Merge from widevine repo of http://go/wvgerrit/23421
This CL adds some more unit tests for big usage tables, and corrects a
problem found in the reference code.
Change-Id: Iae9a4406d79a13362223c2b4da7365b845d92382
Merge from widevine of http://go/wvgerrit/23283
This CL adds the backwards compatiblity functions to the new usage
tables in the oemcrypto mock reference code.
b/31458046
b/32554171
Change-Id: I04901d95aceb8910406f7c514c26c29c2c575322
As a large number of provisioning errors can come from failures
initializing OEMCrypto we need to collect these messages.
Errors and warnings were only printed to the log. This
change takes those messages and puts them into the oemcrypto
intialization mode metric.
"Mode" was chosen as most messages were about how oemcrypto
was initialized (e.g. into L3 because no L1 library was found).
Test: Ran all GTS Media Tests
Bug: 34782934
Change-Id: I1fcdd74c99011d53bdffe9609d2f4c46c222e2f6
There were warnings about unused parameters and unnecessary "const"
that were hiding other warnings. This change resolves those
warnings and resolves some constructor list ordering warnings
that were hidden among the other warnings.
Bug: 34784667
Change-Id: Ied78b00d3565abd66f90dbd1f4cce635dae7b957
This change is the complete Widevine metrics system. It will
measure and record runtime information about what is happening
in the CDM - such as errors and throughput.
Bug: 33745339
Bug: 26027857
Change-Id: Ic9a82074f1e2b72c72d751b235f8ae361232787d
Merge from widevine repo of http://go/wvgerrit/23280
This CL moves some of the oemcrypto mock classes into their own
files. There are no real code changes.
Change-Id: I4e4a6a01d8e75051bc0eb2a5d58361c438c7f41b
Merge from widevine of http://go/wvgerrit/23184
This adds the shared license bit to the key control block for the
reference code and the unit tests.
b/31458046
Change-Id: I4e360ea5dd2e6cee145663d4ab4f384b65cac427
[ Merge of http://go/wvgerrit/23380 ]
The service certificate was setup correctly if specified in mediadrm
properties. If instead the service certificate was later fetched from
the license service, it would not be marked as valid. This led to an
infinite loop of service certificate fetches and processing. This
prevented the license from being fetched and playback failures.
b/34638410
Test: Verified by new service certificate unittests + Hulu playback
using fugu.
Change-Id: I2a4f8754614fccdad3c80d3e13fba0b44d177d61
Merge from widevine of http://go/wvgerrit/23283
This CL adds some big usage table functionality to the oemcrypto
mock and unit tests.
Still missing are: backwards compatibility, defragging the table,
haystack code, and lots of new unit tests.
The haystack now reports it doesn't support usage tables, so that
the unit tests will pass. This will be fixed in a future CL.
b/31458046
b/32554171
b/34173776
b/34174907
Change-Id: I6e08e76f7612ffb77e413151e00f830339298c62
Merge from widevine of http://go/wvgerrit/22958/
This adds unit tests for OEMCrypto to check 3072 bit RSA keys. It
also adds indicates that the mock supports them.
b/32776334
Change-Id: I68a3ff56969a860602e6c230558478dc3577c8f5