Commit Graph

281 Commits

Author SHA1 Message Date
Matt Feddersen
0dbc42f10e CAS demo app
Adds a new `cas` directory to the ports/linux project. This contains
an end-to-end demo of OEMCrypto CAS functionality, using the Linux
tee_simulator as a base.

Test: from ports/linux/cas dir: `CDM_DIR=~/work/cdm-dupe ./scripts/build.sh && CDM_DIR=~/work/cdm-dupe ./scripts/run.sh`

Merged from https://widevine-internal-review.googlesource.com/178250

Change-Id: I781b403100ad2e069d99650d9ddae8e7acbc309a
2024-02-01 13:40:50 -08:00
Vicky Min
e5aa80df88 Use GTEST_SKIP for non prov 4.0 tests
Bug: 251240681
Merged from https://widevine-internal-review.googlesource.com/179570

Change-Id: Ieb3e2dc0de3ad33c6407ee4cbcfbd39641b6df4c
2024-02-01 13:40:50 -08:00
Vicky Min
f47c5bf05a Refactor cast oemcrypto unit tests
Refactor the cast related oemcrypto unit tests into a separate file.

Bug: 253779846
Merged from https://widevine-internal-review.googlesource.com/176930

Change-Id: I937042f786d1cc973e186d76bd276cbc792dfc19
2024-02-01 13:40:50 -08:00
Vicky Min
5317ce1c63 Refactor generic crypto unit tests
Refactor the generic crypto oemcrypto unit tests into a separate file.

Bug: 253779846
Merged from https://widevine-internal-review.googlesource.com/176730

Change-Id: I343ee19ef979a9bedbc528a4533711a137ffb5e9
2024-02-01 13:40:50 -08:00
Vicky Min
51c57c9e11 Small refactoring changes
1) Move some provisioning unit tests into
   oemcrypto_provisioning_test.cpp
2) Remove some test group comments

Bug: 253779846
Merged from https://widevine-internal-review.googlesource.com/176735

Change-Id: I3d02c23b63eb7949fbc6abf60a7dbe32086ef2c9
2024-02-01 13:40:50 -08:00
Matt Feddersen
4fa979b43d Fix CastReceiver unit tests
Test: opk_ta, opk_ta_p40
Bug: 259454969

Merged from https://widevine-internal-review.googlesource.com/175370

Change-Id: I6cefe7fb85db539ecb066498b51525a04b8bbd51
2024-02-01 13:40:50 -08:00
Cong Lin
5a17d8ebd9 OEMCrypto_ReassociateEntitledKeySession() to check key policy
OEMCrypto_ReassociateEntitledKeySession() should prevent an entitled key
session from being associated to an arbitrary entitlement session.
Validations added/updated in this CL:
1. at least one entitled key is supposed to have matching entitlement
key in the new session;
2. the key control block in the new entitlement key should remain
   unchanged compared to the existing entitlement key.

Updated OPK and ref/testbed implementations.

Test: jenkins/opk_ta, jenkins/run_fake_l1_tests
Bug: 262795590
Merged from https://widevine-internal-review.googlesource.com/171192

Change-Id: I3868aa0d3c5ffb818ed83b9c49313125803939e0
2024-02-01 13:40:49 -08:00
Cong Lin
ab7c39a450 OEMCrypto_ReassociateEntitledKeySession() to verify entitlement key IDs
OEMCrypto_ReassociateEntitledKeySession() should prevent an entitled key
session from being associated to an arbitrary entitlement session. The
target entitlement session is supposed to have all the entitlement keys
that the entitled key session uses.

Updated OPK and ref/testbed implementations.

Test: jenkins/opk_ta entitlement tests
Bug: 262795590
Merged from https://widevine-internal-review.googlesource.com/169774

Change-Id: I4322422f01f7094c3862f33ef3199ff3a44995b0
2024-02-01 13:40:49 -08:00
Ian Benz
b9d857649e Add clang-tidy support for the OPK Linux port
Bug: 256230932
Change-Id: I4f46e285376101ff129c1fca5c80a259c70cc0c7
2024-02-01 13:40:49 -08:00
Vicky Min
0972c59fc0 Filter CAS tests
Merge from Widevine repo of http://go/wvgerrit/169080

We want to transition to using GTEST_SKIP to skip unit tests instead of
modifying the GTEST_FILTER variable. This does so for tests that require
CAS support.

Bug: 251240681
Merged from https://widevine-internal-review.googlesource.com/167739

Change-Id: Ifb971bf01e2c21fe672bbe4bfa15c797456256ef
2023-03-28 20:30:22 +00:00
Vicky Min
f83698a164 Refactor missed provisioning and renewal tests
Merge from Widevine repo of http://go/wvgerrit/169079

Bug: 253779846
Merged from https://widevine-internal-review.googlesource.com/167738

Change-Id: If8fc484f02fc1544977f1fb3a5fe1fa42d7367d7
2023-03-28 20:30:22 +00:00
Fred Gylys-Colwell
d7ee89bab0 Filter Cast Reciver tests
Merge from Widevine repo of http://go/wvgerrit/169070

This turns on the cast receiver tests for any device that
claims to support this feature. Previously, we had to
explicitly request these tests on the command line.

But since they do not pass for Prov 4.0, we fitler them out
in this case and reference a bug tracking that work.

We also switch to using GTEST_SKIP to skip the tests instead
of modifying the GTEST_FILTER.

Bug: 251240681
Bug: 269310676
Bug: 259455058
Bug: 259454969
Merged from https://widevine-internal-review.googlesource.com/166497

Change-Id: I1bcd749243a474b3f638547aa43c2805e86731af
2023-03-28 20:30:22 +00:00
Vicky Min
64521717d8 Use GTEST_SKIP to skip prov 3.0 tests
Merge from Widevine repo of http://go/wvgerrit/169068

We want to transition to using GTEST_SKIP to skip unit tests instead of
modifying the GTEST_FILTER variable. This does so for provisioning 3.0
tests.

Bug: 251240681
Merged from https://widevine-internal-review.googlesource.com/167498

Change-Id: I997e1051f3bd7925bc69cf1b269a5bbbae8031b7
2023-03-28 20:30:22 +00:00
Vicky Min
54e6b3d45d Small changes to refactored unit tests
Merge from Widevine repo of http://go/wvgerrit/169064

This CL should cleanup some minor issues that existed after the initial
CLs refactoring the unit tests went in. The issues fixed should be:
1) duplicate decrypt tests
2) decrypt tests added to be run
3) removed unecessary header files
4) refactored some provisioning tests that I had previously overlooked

Bug: 253779846
Merged from https://widevine-internal-review.googlesource.com/167537

Change-Id: Ic474fbcf69a08c0482b5e74d0c80be2cd16702d8
2023-03-28 20:30:22 +00:00
Vicky Min
26aa378ca5 Refactor usage table tests
Merge from Widevine repo of http://go/wvgerrit/169061

Bug: 253779846
Merged from https://widevine-internal-review.googlesource.com/167477

Change-Id: I6046e59449700c8be05641f71dcbb2bba6ce493b
2023-03-28 20:30:22 +00:00
Vicky Min
6897bc1a1c Refactor decrypt unit tests
Merge from Widevine repo of http://go/wvgerrit/169052

Refactor the decrypt unit tests into a separate file.

Bug: 253779846
Merged from https://widevine-internal-review.googlesource.com/167180

Change-Id: I10a4a987b0d597f0c6d2953c0723bea4d790fb9c
2023-03-28 20:30:22 +00:00
Cong Lin
e8add8eed8 Sync oemcrypto files from cdm udc-dev to Android
Changes included in this CL:

166806: Update OEMCrypto_GetDeviceInformation() | https://widevine-internal-review.googlesource.com/c/cdm/+/166806
166808: Update Android L3 after OEMCrypto_GetDeviceInformation() signature changes | https://widevine-internal-review.googlesource.com/c/cdm/+/166808
166809: Decode device info and write it to CSR payload | https://widevine-internal-review.googlesource.com/c/cdm/+/166809
167158: Fix Android include path and copy_files | https://widevine-internal-review.googlesource.com/c/cdm/+/167158
167159: Fix common typos and use inclusive language suggested by Android linter | https://widevine-internal-review.googlesource.com/c/cdm/+/167159

165618: Explicitly state python3 where needed. | https://widevine-internal-review.googlesource.com/c/cdm/+/165618

166757: Update Android.bp for Android | https://widevine-internal-review.googlesource.com/c/cdm/+/166757
164993: Refactor basic oemcrypto unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/164993
164978: Update OEMCrypto Unit Test Docs | https://widevine-internal-review.googlesource.com/c/cdm/+/164978
166941: Update make files for OEMCrypto | https://widevine-internal-review.googlesource.com/c/cdm/+/166941

165279: Refactor license unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/165279
165318: Refactor provisioning unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/165318
164800: Add extra check for renew on license load unit test | https://widevine-internal-review.googlesource.com/c/cdm/+/164800
165860: Remove duplicate definition of MaybeHex() | https://widevine-internal-review.googlesource.com/c/cdm/+/165860

164889: Updated CoreCommonRequestFromMessage and fix test | https://widevine-internal-review.googlesource.com/c/cdm/+/164889
164967: Add OPK pre-hook and post-hook error codes | https://widevine-internal-review.googlesource.com/c/cdm/+/164967
165140: Add hidden device_id_length to v18 provisioning message | https://widevine-internal-review.googlesource.com/c/cdm/+/165140
165204: Fix memory leak in oemcrypto test | https://widevine-internal-review.googlesource.com/c/cdm/+/165204

165958: Fix oemcrypto_generic_verify_fuzz mutator signature offset | https://widevine-internal-review.googlesource.com/c/cdm/+/165958

166037: Support SHA-256 in OEMCrypto Session Util | https://widevine-internal-review.googlesource.com/c/cdm/+/166037

Test: Run GtsMediaTests on Pixel 7
Bug: 270612144

Change-Id: Iff0820a2de7d043a820470a130af65b0dcadb759
2023-02-28 11:21:05 -08:00
Cong Lin
7474b41fd0 Temporarily remove json dependency in oemcrypto v18 unit test
Disable one oemcrypto v18 unit test which takes nlohmann-json dependency
for now, until the json dependency is fixed.

Test: build widevine and oemcrypto unit tests
Bug: 263397641
Change-Id: I065b28a81cc481b2b64bda27733640e0fdea0c2c
2022-12-21 13:23:21 -08:00
Kyle Zhang
11255b7426 Pick widevine oemcrypto-v18 change
No-Typo-Check: From a third party header file
Bug: 260918793
Test: unit tests
Test: atp v2/widevine-eng/drm_compliance
Change-Id: I36effd6a10a99bdb2399ab1f4a0fad026d607c70
2022-12-21 00:03:50 +00:00
Kyle Zhang
af0168dbed Merge cdm changes to android repo
Bug: 251924225
Test: GtsMediaTestCases
Change-Id: I1b4e64c0abf701fe1f5017f14dc72b72c3ea6770
2022-10-11 00:40:42 +00:00
Alex Dale
073f478239 Implement GetDeviceId for prov4
[ Merge of http://go/wvgerrit/150349 ]

The device id for prov4 is hash of the encoded device public key
(COSE_key).

Also replaced a few bug numbers if it is prov3 specific (not related to prov4).

Bug: 225216277
Bug: 236317198
Test: oemcrypto_test
Change-Id: Ica1c8579c0a3ef83c70f331283c9cce629c6bb3f
2022-06-23 14:48:19 -07:00
Alex Dale
9b04109b60 Merge "Updated OEMCrypto tests to use DRM key objects." 2022-06-21 20:52:08 +00:00
Cong Lin
f529e0d563 Add unit test for clear KCB in LS SDK 16.4 response am: 8c4c238324 am: 154a1db776
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18973819

Change-Id: I0224f6540925ad4b16988afd8e2bd76a12771c49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 08:26:02 +00:00
Cong Lin
8c4c238324 Add unit test for clear KCB in LS SDK 16.4 response
This is a merge from:
https://widevine-internal-review.googlesource.com/c/cdm/+/152897
and http://go/wvgerrit/153709

Adding a new OEMCrypto unit test will allow partners to correct a
problem earlier in their integration.

Verifies current oemcrypto implementation handles clear KCB in a
mocked 16.4 license response.

Unit test release date updated to 2022-06-17.

Test: run_x86_64_tests; opk_ta
Bug: 235870170
Bug: 234645065
Change-Id: I59fef2c25f5c007624447d4f46147d96adeddad9
2022-06-17 15:02:09 -07:00
Alex Dale
bfa2d782bd Updated OEMCrypto tests to use DRM key objects.
[ Merge of http://go/wvgerrit/147275 ]

Swapped out use of OpenSSL/BoringSSL RSA and EC_KEY to use OEMCrypto
reference utility classes RsaPublicKey/EccPublicKey.  This enables
further test development with ECC keys, and removes duplicate OpenSSL/
BoringSSL code.

For Android makefiles, only the minimally required files have been
added.

Bug: 205902021
Bug: 236317198
Test: run_prov30_test run_prov40_test oemcrypto_test
Change-Id: I64491018e8ffb69bf986083e3aae446eb9e5cf39
2022-06-16 21:13:22 -07:00
Alex Dale
2a371dce54 Remove duplicate wvcrc files
[ Merge of http://go/wvgerrit/150789 ]

We had two copies of the wvcrc32.h and wvcrc.cpp files: One in
oemcrypto/util/ and one in oemcrypto/test/. The two were identical
except for the namespaces used. However, this setup created confusion if
the compiler could see both files, as the wrong one could get included.
This patch removes the set from test/ in favor of the more-widely-used
set from util/ and updates the one piece of code using the old
namespace.

Update Android oemcrypto_test makefile for wvcrc32.

[ Merge of http://go/wvgerrit/153657 ]

Duplicated wvcrc files were removed in http://go/wvgerrit/150632,
however, the Android-specific makefile for oemcrypto_test was not
updated with the new source and include directory.  This CL makes
the necessary changes to the makefile to build with the OEC ref util
version of wvcrc32.

Bug: 229160397
Bug: 236317198
Test: oemcrypto_test
Change-Id: I0b53255122172fb514e7e0602b59f3ab704e52da
2022-06-16 20:53:57 -07:00
TreeHugger Robot
c4a2a08ee6 Merge "Update TestMaxDRMKeys to use 2048 bit keys only" into tm-dev 2022-05-09 09:34:58 +00:00
Alex Dale
1069ae39cc Resize OEMCrypto buffer-based results on success.
[ Merge of http://go/wvgerrit/151191 ]

Within the CDM and OEMCrypto tests, there were a few OEMCrypto function
calls where the final size of the output buffers were not being
resized.  For several of these functions, an initial call is made with
zero-length output buffers, expecting OEMCrypto to return
ERROR_SHORT_BUFFER; followed by a call with buffers at least as large
as specified by OEMCrypto.  However, for some operations, OEMCrypto
makes an estimate on the final size on the first call, specifying the
exact size only after performing the operations.

This is the case for the wrapped key returned by
OEMCrypto_LoadProvisioning().  The provisioning response contains a
padded + encrypted DRM key.  OEMCrypto does not know the actual size
of the key until decrypted, and the actual DRM key might be smaller.

There was a OEMCrypto test for OEMCrypto_BuildInformation() which
was enforcing the wrong behaviour.  This has been updated.

Bug: 230661565
Test: oemcrypto_test
Change-Id: Iad297d56ffbb085894641fdf8698ce5fd18edbf2
2022-05-04 21:32:08 -07:00
Vicky Min
1563fb2a27 Fix TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths()
In TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths(),
LoadResponse() should be called after EncryptAndSignResponse() so this
is moved in this CL.

Bug: 231368221
Test: OEMCryptoMemoryLoadLicense tests
Change-Id: I7a0224afb21c3ab1d896ce3cfb64e1ad544a581a
2022-05-03 23:36:05 +00:00
Fred Gylys-Colwell
2899924d42 Update TestMaxDRMKeys to use 2048 bit keys only
Merge from Widevine repo of http://go/wvgerrit/151254

Test: Ran tests on reference oemcrypto
Bug: 228996670
Change-Id: I6ea69bad49fa2d4272fc8bb02895c17f314c7f49
2022-05-02 17:36:36 -07:00
Rahul Frias
b07523f4c6 Constrain the generated key type in testing
[ Merge of http://go/wvgerrit/148157 ]

Fail the test if the returned type is other values.

Bug: 224375138
Test: GtsMediaDrmTests
Change-Id: I4abad9d69865cac99654d3dedd443463dd728a58
2022-03-21 14:41:01 -07:00
Rahul Frias
57353b4941 Test max number of DRM private keys
[ Merge of http://go/wvgerrit/143909 ]

The max. number of DRM keys that can be loaded depends on the resource
rating.

Add a test to verify:
1. We can load up to MAX. drm keys
2. Loading the MAX+1 key can fail
3. The loaded keys should work even if loading other keys failed

Bug: 209084113
Test: opk_ta, run_x86_64_tests, run_level3_static_tests,
run_fake_l1_tests
Test: GtsMediaTestCases on sunfish

Change-Id: Ib9821e8a1994d41d3e9c2063440c109a2332ba89
2022-03-16 01:33:48 -07:00
Rahul Frias
bc6e841ccd Add out of bounds testing for LoadKeys()
[ Merge of http://go/wvgerrit/146249 ]

Update the OEMCryptoMemoryLoadLicense* tests so they cover LoadKeys()
for v15 and prior and LoadLicense() for v16 and later versions.

Merged from https://widevine-internal-review.googlesource.com/145951

Bug: 190749256
Test: GtsMediaTestCases on sunfish
Change-Id: If90f7afd82819375f52a2fe619675bf0c4c4dd3a
2022-03-16 01:30:39 -07:00
Rahul Frias
8350badbb5 Separate invalid session test for ReuseUsageEntry
[ Merge of http://go/wvgerrit/144729 ]

Since OEMCrypto_ReuseUsageEntry() was introduced in v17, splitting the
test case for an invalid session from the other usage entry methods
since they were implemented in v15/16 as well.

Bug: 216193739
Test: GtsMediaTestCases on a sunfish
Change-Id: I7f4399c07a19227495a15807228b930066f6a794
2022-03-16 01:20:02 -07:00
Kyle Zhang
642965c678 Merge latest oemcrypto-v17 change
No-Typo-Check: Not related to this change.

Bug: 161477208
Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
2022-01-27 20:07:15 -08:00
John W. Bruce
c45559177a Fix -Wshorten-64-to-32 errors in test code
(This is a merge of http://go/wvgerrit/134316.)

This patch fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits. Most of the time, it
does this by making the implicit conversion explicit. Occasionally,
where it makes sense, it does this by expanding the code to operate on a
64-bit value.

This patch removes LicenseKeysTest::NumContentKeys(), which no one was
using, as all the tests access content_key_count_ directly.

Bug: 194971260
Test: x86-64
Change-Id: Iae7685c10b9db989253b349cab693728b438798d
2021-11-10 16:16:47 -08:00
John W. Bruce
5619afc566 Clarify entitled vs. entitlement in OEMCrypto tests
(This is a merge of http://go/wvgerrit/133650.)

Several places in the OEMCrypto tests refer to entitled keys as
entitlement keys. This patch fixes those references. It does not change
places that were actually meant to refer to entitlement keys.

Test: x86-64 platform tests
Bug: 203697187
Change-Id: I2ad2d82a666fd0cc08662e39177313cf36c2ad43
2021-10-21 20:05:15 +00:00
John W. Bruce
1447eba7bc Fix -Wshorten-64-to-32 errors in usage table code
(This is a merge of http://go/wvgerrit/134312.)

This patch fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits. Most of the time, it
does this by making the implicit conversion explicit. There are a lot of
these places in the usage table code because we always use uint32_t as
the type of a usage entry index, but much of the code that interacts
with the usage table system naturally wants to use size_t.

Bug: 194971260
Test: OEMCrypto unit tests
Test: x86-64 platform tests
Change-Id: I3923af40715efe367955a194a9e33be3e9cb014c
2021-10-20 22:28:57 +00:00
John W. Bruce
895d391121 Migrate tests to googletest 1.10+ API
(This is a cherry-pick of http://go/wvgerrit/135227 and
http://go/wvgerrit/135246 from the Widevine repo.)

Googletest has deprecated the TEST_CASE nomenclature in favor of the
International Software Testing Qualifications Board-compliant term
TEST_SUITE. See
https://google.github.io/googletest/primer.html#beware-of-the-nomenclature
for more info.

Bug: 156766290
Test: build_and_run_all_unit_tests.sh
Change-Id: Ib94d534d17677601c4c160eb6b8d4e4e07df85c9
2021-10-11 17:05:48 -07:00
Vicky Min
ae211a02dd Add curly braces in oemcrypto_test.cpp
On the gcc 9.3 compiler, oemcrypto/test/oemcrypto_test.cpp will not
compile without curly braces in some places so we must add them to
these 4 tests.

Test: OEMCryptoLoadsCertificateAlternates tests and CheckUsageTableSizeAPI16
Bug: 200057124
Change-Id: Ia097ba992a024adfd3311b82b812de60985a0de1
2021-09-15 22:03:43 +00:00
Fred Gylys-Colwell
052016eb57 Add extra RSA private keys to unit tests
Merge from Widevine repo of http://go/wvgerrit/128047

There have been some failures with various RSA private keys. We add
them to the unit tests to make sure that OEMCrypto is able to load
these types of keys:
* Shorter: than normal private exponents. This seems to occur
  occasionally even with Euler totients. But it occurs more with
  Carmichael totients.
* 0-leading-byte: private exponents. This also occurs naturally for
  both Euler and Carmichael totients.
* Carmichael: vs Euler totients. I think we may already have tests for
  this. But just in case.

Bug: 190450051
Test: ran unit tests on bonito (and they passed!)
Change-Id: Id64ec738479eb8a0f77e253bace319cebe918d3f
2021-06-29 16:47:20 +00:00
John W. Bruce
ed17d09c1b Remove asserts from GenerateSimpleSampleDescription()
(This change is merged from http://go/wvgerrit/124824)

GenerateSimpleSampleDescription() only had asserts to check parameters
that only came from other test code, so they weren't testing anything of
use. With the asserts removed, it's no longer necessary to wrap calls to
GenerateSimpleSampleDescription() with ASSERT_NO_FATAL_FAILURE(), which
a lot of callers were already forgetting to do anyway. This also
simplifies a future patch that will generalize the decryption test code
to work with entitlement licenses.

Bug: 186782279
Test: x86-64 platform
Test: build_and_run_all_unit_tests
Change-Id: I987427fdfee4826d77ab95344f9aca8c374b2001
2021-05-11 12:49:22 -07:00
Fred Gylys-Colwell
e51c9fbbb8 Update license comment
Merge from Widevine repo of http://go/wvgerrit/121950

Remove term "Master" from "Widevine Master License Agreement".

Bug: 168562298
Change-Id: I655babf1bc447f4872f6a0f849107262be42df7a
2021-04-12 14:10:08 -07:00
Fred Gylys-Colwell
6628c7f693 Update OEMCrypto test comments and logs
Merge from Widevine repo of http://go/wvgerrit/121886

This CL merges some changes from branch rvc-dev to sc-dev
that prepared it for merge.

One change is that the unit tests now say they are part of
Android S instead of R.

Bug: 180546871
Change-Id: I2ebbd8f7b8586389ebb75f3743a2dc2ad8caa214
2021-04-12 14:00:53 -07:00
Bharath Chandra Elluru
6b548748b2 Merge oemcrypto buffer overflow tests from cdm
Widevine CLs:
http://go/wvgerrit/112243
http://go/wvgerrit/110563
http://go/wvgerrit/95483
http://go/wvgerrit/107047
http://go/wvgerrit/111123
http://go/wvgerrit/106224
http://go/wvgerrit/106263
http://go/wvgerrit/106223
http://go/wvgerrit/104223
http://go/wvgerrit/108583
http://go/wvgerrit/111403
http://go/wvgerrit/111623
http://go/wvgerrit/106264
http://go/wvgerrit/110483
http://go/wvgerrit/111944
http://go/wvgerrit/108684
http://go/wvgerrit/104183
http://go/wvgerrit/111443
http://go/wvgerrit/111869
http://go/wvgerrit/108843
http://go/wvgerrit/104363
http://go/wvgerrit/104423
http://go/wvgerrit/104263
http://go/wvgerrit/106584
http://go/wvgerrit/105924
http://go/wvgerrit/104524
http://go/wvgerrit/113023

Bug:175401639

Test: We would like to run these tests on pixel devices from master
branch using go/wv-and-dash

Change-Id: Ic4188504af64de9ce79941f75ac6feaf29189a4d
2021-01-11 22:13:16 +00:00
Cong Lin
0f32446ee7 Upgrade L3 to v16 and update Android.bp files
Merging CL:
* http://go/wvgerrit/108203
* http://go/wvgerrit/103904 (changes to L3 source files excluded)

Also added ODK dependency which is required by L3 v16.
Do not replace constant sizeof() with a hard-coded value in L3 library because it is target-specific.

Test: Unit tests on gLinux
    jenkins/linux_unit_tests
    jenkins/ce_cdm_tests
Test: Unit tests on Pixel 4(flame-userdebug, rvc-qpr-dev)
    vendor/widevine/libwvdrmengine/build_and_run_all_unit_tests.sh
Test: Manual ExoPlayer L1/L3 playback tests (flame-userdebug)
    WV: Secure HD/SD (cenc,MP4,H264)
    WV: Secure HD/SD (cbc1,MP4,H264)
    WV: Secure HD/SD (cbcs,MP4,H264)
Test: Widevine GTS tests(bramble-userdebug, master)
    http://ab/I23800006571451275
Bug: 136317881
Bug: 139814713
Bug: 173331251
Change-Id: I1656e83a74a0eaf650f55f5e2388819bf5020c0d
2020-11-17 23:28:51 +00:00
TreeHugger Robot
a53fb38be1 Merge "Merge recent doc changes for OEMCrypto" 2020-10-21 23:15:27 +00:00
Alex Dale
927c2f628b Test for creating and reloading usage entries.
[ Merge from http://go/wvgerrit/102303 ]

This adds an OEMCrypto test that ensures that usage entries can be
loaded and reloaded without issue within the same crypto client
lifecycle.  This is in response to b/158273241 where certain entries
could not be reloaded if new entries are created and loaded in a
particular order.

Bug: 158619296
Test: OEMCrypto test on Android
Change-Id: Ib7422b2003e46a3ee27c6a591177a12d14e628bc
2020-10-02 13:20:22 -07:00
Fred Gylys-Colwell
20bb84ffee Merge recent doc changes for OEMCrypto
This is a cherry pick of recent changes to OEMCrypto and ODK. Most of
these are part of the document migration to doxygen.

See http://go/wvgerrit/106005 and its parents for code reviews.

Bug: 144715340
Bug: 148232693
Bug: 167580674
Change-Id: I658f99c8117b974faed97322d61fac0f382283af
2020-09-15 19:10:53 -07:00
Alex Dale
f22cd20466 Enabled log formatting warnings.
[ Merge of http://go/wvgerrit/105025 ]

Clang and GCC allow for warnings against the arguments for printf-like
functions (e.i. LOGx).  These validate that the format type specified
in the format string match the corresponding argument type.

Most of the time, format specifer errors are benign; hence why they
haven't been seen as an error so far.  However, with the enabling of
specifier warnings and the enabling of warnings as errors on certain
platforms, these existing errors need to be addressed.

This CL enables format specifier warnings for most of the Widevine
code, with the OEMCrypto L3 implementation which has a single error
which requires a fix in the haystack code before being fixed in the
Widevine branch.

Strict format string warnings are not enabled for non-LP64 systems.

Bug: 137583127
Test: Compiled for Linux and Android
Change-Id: I051398332d31a20457b86563a90ad8f6d428445f
2020-09-08 15:46:15 -07:00