Commit Graph

6388 Commits

Author SHA1 Message Date
Alex Dale
a878e7b98d Avoid null dereference with empty BCC strings.
[ Merge of http://go/wvgerrit/167897 ]

The function OEMCrypto_GetBootCertificateChain() does not always
provide an additional signature depending on the device.  However, the
CDM would still attempt to dereference the first character in the
additional signature buffer when empty.  This CL changes how the data
pointer to an output string is acquired.  Empty string will instead
pass in a null pointer.

Bug: 272643393
Test: run_prov40_tests
Test: atest GtsMediaTestCases
Change-Id: I10b0a3c7df4fc73272aa701bb01c60672645d4fc
2023-03-16 11:54:33 -07:00
TreeHugger Robot
d9ef97dfbc Merge "Call AIBinder_setRequestingSid from createBinder override function" into tm-widevine-release 2023-03-07 22:52:39 +00:00
TreeHugger Robot
49e505c36f Merge "wv_factory_extraction_tool: extract provision 4.0 csr" into tm-widevine-release 2023-03-07 22:52:34 +00:00
TreeHugger Robot
0bcf816677 Merge "Provide BCC in WVDrmFactory dumpsys." into tm-widevine-release 2023-03-07 19:59:52 +00:00
Rahul Frias
e4cde22826 Merge of OEMCrypto fuzz test CLs
----------------------------------------------------------------------

Fix oemcrypto_generic_verify_fuzz mutator signature offset

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

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

Change-Id: I85574fcd62622d2954c306688e04ecfda333c0cb

----------------------------------------------------------------------

Fix regressions in oemcrypto_decrypt_cenc_fuzz

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

Fix null-dereference of subsamples vector and potential memory leak due
to parsing errors.

Bug: 260005865
Bug: 260013015

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

Change-Id: I91bf1baa726803b2a0073ff3db94e69719d377bb

----------------------------------------------------------------------

Add custom mutator to oemcrypto_generic_verify_fuzz

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

Enable fuzzing mutations beyond changing the signature length.

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

Change-Id: I022d752107b788bd45aafb8325e3186ef90336de

----------------------------------------------------------------------

Refactor oemcrypto_decrypt_cenc_fuzz

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

Refactor to minimize the required corpus length, fuzz the sample input
data, and avoid undefined behavior related to filling
OEMCrypto_DestBufferDesc::buffer with fuzzed data.

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

Change-Id: Id9af8b1704d4619ba88ab8de3adb35d5f8bb69f6

----------------------------------------------------------------------

Refactor oemcrypto_copy_buffer_fuzz

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

Refactor to minimize the required corpus length, fuzz the output buffer
length, and avoid undefined behavior related to filling
OEMCrypto_DestBufferDesc::buffer with fuzzed data.

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

Change-Id: Ieddc6260e5eca641f8409a9b361ca4e5a40d6f52

----------------------------------------------------------------------

Improve AddressSanitizer coverage for LoadEntitledContentKeys fuzzing

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

Split fuzzed message into separate buffer so AddressSanitizer can detect
out-of-bounds accesses.

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

----------------------------------------------------------------------

Avoid copying fuzzed data when separator splitting

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

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

Change-Id: I2b13ff34eee74c8aea9a8176aa711e3e2bc57add

----------------------------------------------------------------------

Fix oemcrypto_opk_dispatcher_fuzz

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

Set ODK_Message size and add timestamp field to initialization requests.

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

Change-Id: Ide51d1cb4119a396212d1802411cfa19f5792e9d

----------------------------------------------------------------------

Cover empty buffers in fuzz tests

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

Update tests that avoid passing empty buffers to OEMCrypto API methods.

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

Change-Id: If0d8007e3294820654b081fe813a09485e757f1c

----------------------------------------------------------------------

Fix cherry pick of "Improve buffer size distribution in fuzz tests"

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

Change-Id: I8b0440fe13b513396b5779c25e6a46ac40eaa183

----------------------------------------------------------------------

Improve buffer size distribution in fuzz tests

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

When a buffer size is fuzzed, use the modulo operation, instead of
std::min, to create an even distribution.

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

Change-Id: I3c1168c7a7d739793005927a97af18de5df2e4c6

----------------------------------------------------------------------

Improve AddressSanitizer coverage in fuzz tests

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

Split fuzzed data into separate buffers so AddressSanitizer can detect
all out-of-bounds accesses.

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

Change-Id: I7ca67409b7c6f96548e21ab41f6caf99f738605d
2023-02-28 00:40:35 +00:00
Rahul Frias
469c6408da Specify server version on the command line
Merged from http://go/wvgerrit/160746

Bug: 251599048

Change-Id: I66bd4766e1cb5f6b9592e1f804a68258f9e9a3d2
2023-02-27 15:06:50 -08:00
Alex Dale
a1a2ee08e7 Provide BCC in WVDrmFactory dumpsys.
[ Merge of go/wvgerrit/c/cdm/+/165138 ]

Enabled the Widevine DRM service on Android to return the raw boot
certificate chain via the CDM status query capabilities.  This
property key is not available for app-level queries.

The BCC is dumped by the WVDrmFactory when requested to print all
CDM properties via dumpsys.

Bug: 234095402
Test: request_license_test
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -p
Change-Id: I34695b0655b4c609979577e9986974bc0fbda898
2023-02-14 13:20:07 -08:00
TreeHugger Robot
738f9472ca Merge "[DO NOT MERGE] Update L3 Android T with new system id after key free fix" into tm-widevine-release 2023-02-10 16:19:27 +00:00
Robert Shih
6bdc49bd4c wv_factory_extraction_tool: extract provision 4.0 csr
Includes following fixes:
* http://ag/19196496 Fix the length of the extracted BCC
* http://ag/21097263 Add "version" to device info in prov4 upload tool

Bug: 231677822
Test: adb shell wv_factory_extraction_tool csr
Change-Id: I9f21514b027261f1d69c24a4d2f54051ccaac9a5
2023-02-10 07:33:29 -08:00
Edwin Wong
f196b63088 Call AIBinder_setRequestingSid from createBinder override function
AIBinder_setRequestingSid must be called first upon creation of a
binder object before AIBinder_getCallingSid is called. Call
AIBinder_setRequestingSid in the createBinder override function
for WVDrmFactory, WVDrmPlugin and WVCryptoPlugin classes.

Test: Play TV streaming
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -a

Bug: 237613676
Change-Id: I9dde4715ba2003deb463bd75b23e1ebc2f22a764
(cherry picked from commit 6797b8eb8a)
2023-02-08 17:07:59 +00:00
Cong Lin
b83ef4c106 [DO NOT MERGE] Update L3 Android T with new system id after key free fix
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/165220

Original commit message:
Update Android L3 v17 with new system ID after key free fix

Android Arm L3 v17 Provisioning 3.0 2023       28923
Android Aarch64 L3 v17 Provisioning 3.0 2023   28924
Android X86 L3 v17 Provisioning 3.0 2023       28925
Android X86 64 L3 v17 Provisioning 3.0 2023    28926

Test: L3 unit tests
Test: integration tests on Pixel4
Test: GTS media tests on Pixel4
Bug: 252434586

Change-Id: I8ebc19260b37615efd77a533bd005f2b9485182a
2023-02-02 15:32:20 -08:00
Cong Lin
4e582ceff0 [DO NOT MERGE] Update L3 Android T with new system id after key free fix
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/165220

Original commit message:
Update Android L3 v17 with new system ID after key free fix

Android Arm L3 v17 Provisioning 3.0 2023       28923
Android Aarch64 L3 v17 Provisioning 3.0 2023   28924
Android X86 L3 v17 Provisioning 3.0 2023       28925
Android X86 64 L3 v17 Provisioning 3.0 2023    28926

Test: L3 unit tests
Test: integration tests on Pixel4
Test: GTS media tests on Pixel4
Bug: 252434586
Change-Id: I68d36bf57266c4d3245962e22b8dff92f2667948
2023-02-02 15:21:33 -08:00
Cong Lin
79b8a375a6 Update L3 after key double free fix tm-widevine-release
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/164981

Original commit message:
Fix key double free issue in L3

Cherry-pick the fix from:
https://widevine-internal-review.googlesource.com/c/cdm/+/164885/
https://widevine-internal-review.googlesource.com/c/cdm/+/164958/

Then generated L3 on top of tm-widevine-release code base.

Original commit message:

During license loading if an error occurs, all the loaded keys will be
freed. Later at session termination, the previously freed keys get freed
again, which screwed up the key table.

This CL prevents the double free by checking if the key index is already
freed, and updates the freed index to be kKeyDataArrayCount.

Also a side fix to correctly zero-out the intialized memory and adding a
few debug outs.

Test: ran L3 unit tests
Test: verified GTS tests on arm32 device
Bug: 252434586
Change-Id: I8058c10daae3d1007733eb6ac54101545d3ce029
2023-01-17 12:40:18 -08:00
Rahul Frias
25b2ea2be5 Logging for L1 devices falling back to L3
[ Merge of http://go/wvgerrit/161877 and http://go/ag/20523252 ]

This change introduces some logging to shed some light on
why some L1 devices fallback to L3.

* Additional logging has been added to indicate whether a lookup of
  the symbols for OEMCrypto_Initialize, OEMCrypto_APIVersion
  or OEMCrypto_Terminate failed.
* OEMCrypto_Initialize error code is saved and reported later.

Bug: 245887116
Test: GtsMediaTestCases
Change-Id: Ice4d966d2fee458de2fae28a1355f292f879c38b
2022-12-08 05:07:00 +00:00
Fred Gylys-Colwell
8f60d8124f Allow entitlement and entitled session to be the same
Merge from Widevine repo of http://go/wvgerrit/160720

For DRM, but not for CAS, we allow the entitlement session
and the entitled session to be the same.

Bug: 253471127
Bug: 246566056
Bug: 245018059
Bug: 242815450
Test: oemcrypto unit tests on oriole (all but CAS tests pass)
Test: GTS
Change-Id: Ib830484be8437b1c4ce34500ae912e6c119dcfc3
2022-11-22 03:02:42 +00:00
Fred Gylys-Colwell
bc734e1f1f Allow session id to be zero
Merge from Widevine repo of http://go/wvgerrit/160719

We do not require that a session id be nonzero. This CL
removes test asserts that a session id is not zero.

Bug: 242815450
Test: tested with http://go/ag/20420224

Change-Id: Ia0f25bca737503e1ad3ac4336714312cacea28f8
2022-11-22 03:02:32 +00:00
Fred Gylys-Colwell
53f3000087 Generate nonce before signing fake license request
Merge from: http://go/wvgerrit/160557

Bug: 242100344
Test: tested with http://go/ag/20420224

Change-Id: I35f625998f04a728f950075cc200e15f93dfb474
2022-11-22 03:02:21 +00:00
Ian Benz
5a9b8a9c81 Fuzz OEMCrypto_CopyBuffer subsample_flags parameter
Merge from Widevine repo of http://go/wvgerrit/159341

Test: tested with http://go/ag/20420224

Change-Id: Ia5f15e9053c7e7be6ea3687c123ad5e36796573e
2022-11-22 03:02:12 +00:00
Vicky Min
579b9144b5 Add a DecryptCENC call after SelectKey for entitled sessions
Merge from Widevine repo of http://go/wvgerrit/154874

We do not require an error to come from SelectKey immediately, it can
come from a following call to DecryptCENC. This adds a function
Session::TestDecryptCENC to be called instead of SelectKey for the tests
that use entitled sessions.

Bug: 232225906
Test: tested with http://go/ag/20420224

Change-Id: If5695a5034cce371b6eb6bcf1b6467d84456c21d
2022-11-22 03:02:03 +00:00
Ian Benz
e88bcf51c8 Optimize OEMCrypto_ShrinkUsageTableHeader fuzzing
Merge from Widevine repo of http://go/wvgerrit/159057

Increase fuzzing efficiency by generating the header_buffer_length
parameter from the input data and pre-creating a usage table header.

Test: tested with http://go/ag/20420224

Change-Id: Idab4c3d0ae879854202e5ffd24bf031b946aeb6a
2022-11-22 03:01:55 +00:00
Ian Benz
2e9cbaf30f Fix InjectFuzzedResponseData unused size parameter
Merge from Widevine repo of http://go/wvgerrit/159077

ProvisioningRoundTrip::InjectFuzzedResponseData and
LicenseRoundTrip::InjectFuzzedResponseData were unsafe as they ignored
their size parameter.

Test: tested with http://go/ag/20420224

Change-Id: I9b5647a283d98bc960caa458b1adf433a3f0ae17
2022-11-22 03:01:44 +00:00
Drew Shao
d9567c66fd [fuzzing] add oemcrypto_shrink_usage_table_header_fuzz
Merge from Widevine repo of http://go/wvgerrit/158860

Bug: b/243078947
Test: tested with http://go/ag/20420224

Change-Id: I00d7f96ad86990ed62fb1b81508bf79bbdd3da13
2022-11-22 03:01:34 +00:00
Cong Lin
0ad587ca20 Substring out of range test needs non-zero length value
Merge from Widevine repo of http://go/wvgerrit/154651

Some substring out of range tests uses non-zero offset but
with zero length. This zero length later will be ignored by
v15 oemcrypto, so the tests actually didn't test
anything. These tests are failing on v15 oemcrypto because
the test expect an out of range error but it actually
succeeded since nothing was tested.

Assign the offset to be out of range and then also assign
length to be not zero.

Test: run_fake_l1_tests; run_level3_static_tests;
Bug: 229299394
Test: tested with http://go/ag/20420224

Change-Id: Ic50b6323312e0ecb253dbeb925d9291db6eec075
2022-11-22 03:01:26 +00:00
Fred Gylys-Colwell
6161f812dc Fix cherry pick of unpacking enum
Merge from Widevine repo of http://go/wvgerrit/158251

The cherry pick of http://go/wvgerrit/157958 was not complete.

Bug: 251827716
Test: tested with http://go/ag/20420224

Change-Id: Icd4d2f23003ab621bf690ca3dcf1de2f0c5afc45
2022-11-22 03:01:19 +00:00
Ian Benz
7671db226a Prevent oemcrypto_opk_deactivate_usage_entry_fuzz abort
Merge from Widevine repo of http://go/wvgerrit/158203

Prevent abort, interpreted as a crash by libFuzzer, when
OEMCrypto_CreateUsageTableHeader fails session state checks due to being
called after OEMCrypto_GenerateNonce.

Bug: 251215411
Test: tested with http://go/ag/20420224

Change-Id: I71ad1186ff2cb9ced81f9950d2fa235878aeb54d
2022-11-22 03:01:03 +00:00
Ian Benz
d04af0042e Prevent oemcrypto_opk_report_usage_fuzz abort
Merge from Widevine repo of http://go/wvgerrit/158204

Prevent abort, interpreted as a crash by libFuzzer, when
OEMCrypto_CreateUsageTableHeader fails session state checks due to being
called after OEMCrypto_GenerateNonce.

Bug: 250682470
Test: tested with http://go/ag/20420224

Change-Id: Ia15b8c26fb391a190c32115e398a78ff9f8a7e16
2022-11-22 03:00:51 +00:00
Fred Gylys-Colwell
e0294995d8 Lock OEMCrypto API for v17.1
Merge from Widevine repo of http://go/wvgerrit/158077

I ran the script ./oemcrypto/lock-api-for-release

Bug: 235858362
Test: tested with http://go/ag/20420224

Change-Id: I59b808898cdec60bffe36059f75ac413b0f55356
2022-11-22 03:00:41 +00:00
Fred Gylys-Colwell
b10a4459f8 Verify OEMCrypto API has not changed
Merge from Widevine repo of http://go/wvgerrit/157923

This adds a C file to be built by Luci to verify that nobody
has made a change to OEMCryptoCENC.h that changes the
signature of any _oecc function. See the new comment in the
header for an explanation why we don't want to chage the
function signature of an oecc function.

We also update the OEMCrypto release script to verify that
all of the functions have been locked. There is a script to
update the lock file that should be run before each release.

Bug: 235858362
Test: tested with http://go/ag/20420224

Change-Id: Id890054e82cf8cc4c75e83c8347a776bda2d8a3b
2022-11-22 03:00:29 +00:00
Fred Gylys-Colwell
f862f2a378 Prevent unpacking invalid enum values from ODK_Message
Merge from Widevine repo of http://go/wvgerrit/158102
Test: tested with http://go/ag/20420224
Bug: 247376339

Change-Id: I5b3ef3cfdee6870f6d58e5551fd6a74507ae1e81
2022-11-18 17:08:14 +00:00
Vicky Min
78e4c4ba8a Fix out of bounds buffer error in CreateCoreLicenseResponse()
Merge from Widevine repo of http://go/wvgerrit/157777
(partially merged in http://go/ag/20031768)

In CreateCoreLicenseResponse(), there seems to be an out of bounds
potential error due to a missing check that the index used for
license_response.parsed_license->key_array is valid. Adding a check
for this here.

Bug: 217677571
Test: tested with http://go/ag/20420224
PiperOrigin-RevId: 452114761
Change-Id: Id35ec48bebb564596b8e67c737bc13be9377891b
2022-11-15 22:46:20 +00:00
Cong Lin
0f32f41bd1 [RESTRICT AUTOMERGE] Sync OEMCrypto, ODK files and unit tests
run android/copy_files from cdm repo to sync files in Android
tm-widevine-release.

Changes include:
1. Update ODK to 17.1
2. update in license_protocol.proto
3. updates in oemcrypto unit tests
4. A few cdm and util test updates
5. Prov4 unit test fixes

Originating CLs:
https://widevine-internal-review.googlesource.com/c/cdm/+/155289/
https://widevine-internal-review.googlesource.com/c/cdm/+/155429/
https://widevine-internal-review.googlesource.com/c/cdm/+/155430/
https://widevine-internal-review.googlesource.com/c/cdm/+/154415/
https://widevine-internal-review.googlesource.com/c/cdm/+/156457/
https://widevine-internal-review.googlesource.com/c/cdm/+/156878/
https://widevine-internal-review.googlesource.com/c/cdm/+/156879/
https://widevine-internal-review.googlesource.com/c/cdm/+/156425/
https://widevine-internal-review.googlesource.com/c/cdm/+/156486/
https://widevine-internal-review.googlesource.com/c/cdm/+/156539/
https://widevine-internal-review.googlesource.com/c/cdm/+/156542/

Test: ran oemcrypto unit tests and ODK tests
Test: ran gts media test cases
Bug: 239201888

Change-Id: Iad9aff72aec5ba42296582837f34dd704bc11810
2022-09-22 17:13:02 -07:00
Alex Dale
fa8c0a9a62 Create custom gtest matcher for similar URLs.
[ Merge of http://go/wvgerrit/156997 ]

Several of the Android integration tests perform direct URL comparisons
between fixed URLs and the server URL returned by the CDM.  With
provisioning 4.0, the CDM will append additional query parameters to
the server URL.  This updated URL still contains all of the original
expected information, but with additional parameters.  So long as the
URL contains the required fields, any additional parameter should be
considered valid.

The gtest framework used by the integration tests allow for the
creation of custom "matchers", rules that can be used to validate data
and create informative failure logs.  The CL creates a new matcher for
checking that a tested URL is a superset of content of the expected
URL.

Bug: 244319313
Test: request_license_test on prov 4 device
Change-Id: Ie721058fa628b3a4a74dc56f4172a3dfcb1f1ef3
2022-09-07 20:20:57 -07:00
TreeHugger Robot
4a4b4405e9 Merge "Update clear KCB test name" into tm-widevine-release 2022-08-03 16:47:26 +00:00
Alex Dale
6109ec6d66 Added mutex protection for session_property_set_.
[ Merge of http://go/wvgerrit/154575 ]
[ Cherry-pick of http://go/wvgerrit/19216679 ]

There is a rare race condition experienced by some Android devices
where the a new client property set is being added while another is
being removed.  The C++ stl library does not provided thread
protection by default.

This CL adds a new mutex for the client property set map which prevents
multiple threads accessing the property sets concurrently.

Bug: 235238226
Test: GtsMediaTestCases on redfin
Change-Id: I32cf11bfb1332295ba1245071102ff0adc35259d
(cherry picked from commit aaa97a5d60)
2022-08-02 16:35:13 +00:00
Cong Lin
0ce898be87 Update clear KCB test name
This is to bring cdm tm-widevine-release in sync with Android
tm-widevine-release.

Originating CL: https://widevine-internal-review.googlesource.com/c/cdm/+/154509
The only difference is in the test name.

Test: run diff against CDM tm-widevine-release
Bug: 239059097
Change-Id: I1279bf780c8faef393b32d73a163756a016d80fc
2022-07-26 21:19:32 +00:00
Android Build Coastguard Worker
85b470e1ca Snap for 8742898 from 8c4c238324 to tm-release am: 50ecea3526
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18983484

Change-Id: I00f832231698a5949d7cca2b46b9343e0902a488
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 22:24:38 +00:00
Android Build Coastguard Worker
50ecea3526 Snap for 8742898 from 8c4c238324 to tm-release
Change-Id: Ieb00135247a13e8249efc85b18b1a9fd61023262
2022-06-18 21:57:37 +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
Android Build Coastguard Worker
32e1e8e7c7 Snap for 8656240 from cd593979e9 to tm-release
Change-Id: I5e8bdd3004549143addbc100b2432a4aed6bf0c2
2022-05-28 01:58:37 +00:00
Rahul Frias
cd593979e9 Allow provisioning model to be queried
[ Merge of http://go/wvgerrit/152674 ]

This allows an app to query the provisioning model. Possible
values are { "DrmCertificate", "Keybox", "OEMCertificate",
"BootCertificateChain" }

An app can use these to disntinguish between provisioning models.
Provisioning 4.0 (boot certificate chain) requires a double provisioning
step.

Bug: 234057551
Test: WV unit/integration tests, libwvdrmdrmplugin_hal_test
Change-Id: I1611488ec632a0e5a9e1d106b7475e8f5a2a5a13
2022-05-26 16:22:16 -07:00
Android Build Coastguard Worker
90227da99c Snap for 8627648 from 9935fae50d to tm-release
Change-Id: If460e31096902e522161af2b0979b792ec40adb3
2022-05-22 21:20:30 +00:00
Cong Lin
9935fae50d Loosen KCB encryption checks in L3
This is a merge from:
https://widevine-internal-review.googlesource.com/c/cdm/+/152372

The L3 source change which produced these libraries is:
https://widevine-internal-review.googlesource.com/c/cdm/+/152371/

Original commit message:
To address the bug with certain 16.4.x SDK versions returning a
clear key control block (KCB) for clients newer than 16.5, the
exact version check to determine whether key control blocks are
clear or not has been loosened.

Original behavior:
- ODK version >= 16.5.x --> Assume clear
- ODK version <= 16.4.x --> Assume encrypted
New behavior:
- No KCB IV --> Assume clear
- Otherwise --> Assume encrypted

This CL also includes a change to oemcrypto/include/OEMCryptoCENC.h
The changes to OEMCryptoCENC.h in the CL are comments or variable name
change. So it should be safe.
This change was merged to wv tm-dev here:
https://widevine-internal-review.googlesource.com/c/cdm/+/148411
So, adding it to Android tm-dev.

Test: run_level3_static_tests, CdmDecryptTest/CdmTestWithDecryptParam.* against LS SDK 16.4.2 & 17.0
Bug: 232557453
Change-Id: I2bbb5ab3ea33a16bd6c198077e5aefe960737ea0
2022-05-22 06:35:22 +00:00
Android Build Coastguard Worker
dd8bd6c169 Snap for 8598607 from 186e489562 to tm-release
Change-Id: I6575dd1b8cb4d1a24442d297a684415ac8d74467
2022-05-16 23:21:28 +00:00
Robert Shih
186e489562 Merge "dumpsys widevine: print hex IDs to avoid garbled text" into tm-dev 2022-05-16 06:17:33 +00:00
Android Build Coastguard Worker
6569359fb8 Snap for 8590907 from 9d169a00bb to tm-release
Change-Id: I560ab9de4ada467154cec87425aa719ae6818c91
2022-05-14 01:20:22 +00:00
Alex Dale
9d169a00bb Move system ID extraction outside of CryptoSession.
[ Merge of http://go/wvgerrit/151391 ]

This CL moves the logic for extracting the system ID from keybox or
OEM certificate (from OEMCrypto or device files) to a dedicated
SystemIdExtractor.

Before Provisioning 4.0, the system ID could only be found from data
returned by OEMCrypto.  However, with provisioning 4.0, the system ID
can now be found in the OEM certificate that is stored on the device
files.

Bug: 232020319
Test: system_id_extractor_unittest
Test: Forest L37800000954493485
Change-Id: Ie1b7987906e2e4fef015cd659a947b6dbb7594b1
2022-05-12 19:22:03 -07:00
Android Build Coastguard Worker
6e98c38fbb Snap for 8581162 from cf3771e54a to tm-release
Change-Id: I4829192ab84646c1c207e9886c3f1218533283fb
2022-05-12 23:20:10 +00:00
Alex Dale
8ac7ca3f46 Merge "Added metrics for production readiness." into tm-dev 2022-05-12 22:10:24 +00:00
Android Build Coastguard Worker
60ee9521df Snap for 8572535 from f8146ee716 to tm-release
Change-Id: Ifa4d22190fadf94fafdd8705c7e31fbaa4d174af
2022-05-11 23:20:21 +00:00
Edwin Wong
cf3771e54a Add hal_metrics_adapter_unittest for AIDL service.
[ Merged from http://go/wvgerrit/151750 ]

Test: m hal_metrics_adapter_unittest -j128
Test: m hal_metrics_adapter_unittest  WV_UNITTESTS_BUILD_TARGET=hidl -j128
Test: adb push $(OUT)/data/nativetest/hal_metrics_adapter_unittest  /data/nativetest/.
Test: adb shell  LD_LIBRARY_PATH=/vendor/lib64 /data/nativetest/hal_metrics_adapter_unittest

Bug: 217247987
Change-Id: I0c890d2fab754bf993632659293a0272c863b11f
2022-05-11 22:01:35 +00:00