Commit Graph

658 Commits

Author SHA1 Message Date
Kyle Zhang
c7b46a1119 Merge "Revert "Limit output buffer size during decrypt fallback"" into udc-widevine-dev 2024-10-11 19:18:10 +00:00
Kyle Zhang
79ab04a34e Revert "Limit output buffer size during decrypt fallback"
This reverts commit df29c42108.

Reason for revert: b/372348308

Change-Id: Ib87b0f3045f9962a3cc0bf725cf535a3409fe5bd
2024-10-11 18:05:18 +00:00
Cong Lin
881b7236f4 Fix a naming issue to reduce confusion in cast test
Merge of https://widevine-internal-review.git.corp.google.com/c/cdm/+/206706

Change "digest" to "prefix".

Test: run_fake_l1_tests
Change-Id: I4205367c9a77979992130f4e2aeca90e761e2616
2024-09-12 17:45:54 +00:00
Cong Lin
80fedfcd2f Fix test message format for cast receiver
Merge of https://widevine-internal-review.git.corp.google.com/c/cdm/+/206071

Message to be signed by CAST funciton is supposed to be in a certain
format: "constant prefix + SHA1(message)".

Some of our current CAST tests uses random message which break this
specification. This fixes the input message.

Test: Cast tests with run_fake_l1_tests
Bug: 359893908
Change-Id: I6b318d749971d837f13daa7b147313e8e0b1d3d0
2024-09-12 17:43:41 +00:00
Rahul Frias
d63811fa6e Merge "Add OEMCrypto_WrapClearPrivateKey()" into udc-widevine-dev 2024-08-17 17:23:21 +00:00
Matt Feddersen
77e8597bf9 Add OEMCrypto_WrapClearPrivateKey()
Bug: 306059409
Test: WVTS

Change-Id: Ifce5824b455c276c6fc0753de7932a5b69dffd1f
(cherry picked from commit f4679aac18de5dbe2bc22501294e719a55d51199)
2024-08-15 01:37:30 -07:00
John W. Bruce
df29c42108 Limit output buffer size during decrypt fallback
This is based on a patch submitted by Amlogic.

When we're doing decrypt fallback, either in the CDM or the OEMCrypto
tests, we sometimes fall back to a point where we're synthesizing new
samples and/or subsamples for the content being decrypted. When this
happens and the output buffer is clear, we should limit the size of the
output buffer to only the space needed to hold the output.

Previously, we've been passing the entire output buffer to every call.
This can create a problem if the reason for the fallback is a lack of
enough memory to communicate the buffers to the TA, since the output
buffer will remain the same size as the total output. Restricting the
buffer passed to each call to only the space needed by that call will
reduce the memory requirement.

Cherry-picked from http://go/wvgerrit/205311

Bug: 354834629
Test: x86-64
Merged from https://widevine-internal-review.googlesource.com/204810

Change-Id: I412f43d8f88c72072ef1dd5293436bdb58e500b3
2024-08-14 00:40:35 +00:00
John W. Bruce
48388efcf4 Increase size of BCC buffer in OEC tests
We are receiving reports from partners in the field that they are
failing the OEMCrypto tests only because the tests assume the BCC will
fit into 5k of memory but their BCC is nearly 8k in size.

This patch increases the buffer to 10k.

Cherry-picked from http://go/wvgerrit/205312

Bug: 354834629
Test: x86-64
Merged from https://widevine-internal-review.googlesource.com/204773

Change-Id: I360196518b7651139c003505253d1aed6a0c3907
2024-08-14 00:40:35 +00:00
John W. Bruce
0f28592676 Remove OEMCryptoLicenseTest.RejectCbc1API16
This test should have been removed in v17, when we allowed this pattern
to be used with cbcs. Although we can't start enforcing the correct
behavior until v20 now, we can remove enforcement of the incorrect
behavior.

Cherry-picked from http://go/wvgerrit/205310

Bug: 356173926
Merged from https://widevine-internal-review.googlesource.com/204832

Change-Id: Idc6e3109286daabb83874d52ad3abaff5e14badb
2024-08-14 00:40:30 +00:00
John W. Bruce
6089f50d28 Fix OEMCrypto documentation for (0,0) patterns
The docs on OEMCrypto_DecryptCENC() weren't updated correctly when we
allowed the (0,0) pattern in v17. This patch brings the header docs
in-line with the handwritten part of the devsite documentation.

Merged from http://go/wvgerrit/204611

Bug: 336330529
Change-Id: Ic6c81d8f04904b83c34fbc0235ebbae8705a4182
2024-08-01 16:29:37 +00:00
Vicky Min
f9049a58ed Update DecryptZeroSizeSubSample test to accept success or error
Bug: 338010108
Merged from https://widevine-internal-review.googlesource.com/198002

Change-Id: I52c72a5c1a287e8556a243b6072faf23ce4bbdad
(cherry picked from commit 8b806d128e450ab0bf9cba17e21b5ed5ff97c277)
(cherry picked from commit 1c6ec56725)
2024-07-19 15:55:20 +00:00
Cong Lin
89871ba834 Fix default cipher mode for CAS unit test
Merge of
https://widevine-internal-review.git.corp.google.com/c/cdm/+/193670

Default to OEMCrypto_CipherMode_CBC instead of OEMCrypto_CipherMode_CENC
which is not used by CAS.

Test: CAS unit tests
Bug: 325639114
Bug: 322928572
Change-Id: I8876d5262643015fb6a322eae6444ef4001d146d
2024-03-15 17:30:19 +00:00
Vicky Min
4129b3ac9f Cherry pick 18.4 changes to udc-widevine-dev
Get the udc-widevine-dev Android branch and oemcrypto-v18 cdm branch in
sync. The commit ID for 18.4 on oemcrypto-v18 is
https://widevine-internal.git.corp.google.com/cdm/+/a2f23a2281e5e06dc2867585bdc516fa132b639.

Merged from go/wvgerrit/190151

Bug: 290252845
Test: unit tests passing on Panther device
Change-Id: I63fa3f1c784f737ca1480e5febe4f3f5a8a49948
2024-02-05 18:08:40 +00:00
Kensuke Miyagi
540c8dfd50 Revert "Cherry pick 18.4 changes to udc-widevine-dev"
This reverts commit 7186433edf.

Reason for revert: Build breakage - b/323194350

Change-Id: Ibba4f5289b8f0d5e835dfba9ceb1e601784af634
2024-01-31 18:13:05 +00:00
Vicky Min
7186433edf Cherry pick 18.4 changes to udc-widevine-dev
Get the udc-widevine-dev Android branch and oemcrypto-v18 cdm branch in
sync. The commit ID for 18.4 on oemcrypto-v18 is
a2f23a2281e5e06dc2867585bdc516fa132b6396.

Merged from go/wvgerrit/190151

Bug: 290252845
Test: WVTS tests are running and passing
Change-Id: I457332e7ca70a5b5169345e1279b3eb9f18413b6
2024-01-29 18:18:50 +00:00
Treehugger Robot
aac5b59efd Merge "Skip entitlement session tests that are only supported on CAS devices" into udc-widevine-dev 2023-09-06 21:20:37 +00:00
Treehugger Robot
fdf0ed469d Merge "Filter keybox tests with GTEST_SKIP" into udc-widevine-dev 2023-09-01 18:03:53 +00:00
Vicky Min
6b71f72709 Skip entitlement session tests that are only supported on CAS devices
(merged from go/wvgerrit/183690)

Bug: 297497167, 297244784
Test: OEMCryptoEntitlementLicenseTest
Change-Id: I25b87ee922080fa7c245041a70c58ac120e789e5
2023-09-01 17:21:07 +00:00
Vicky Min
fe0ddc8098 Filter keybox tests with GTEST_SKIP
(merged from go/wvgerrit/183630)

Bug: 288404945, 251240681
Test: keybox tests
Change-Id: I38ed2ba54c9f756693902fd7d0044d4e42bbc2fd
2023-09-01 17:01:52 +00:00
Robert Shih
9eb8c78150 Update Widevine apex min_sdk_version to 34 am: d81cdbae42
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/24326594

Change-Id: I37776a31e1c4317399607e43c859f19360f1eb89
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-30 20:13:52 +00:00
Robert Shih
d81cdbae42 Update Widevine apex min_sdk_version to 34
Bug: 287567070
Bug: 294568360
Test: v2/widevine-eng/drm_compliance_apex
Change-Id: Iad45bf7a66ff0217724376aa8648ecd613af32c1
2023-08-28 12:30:36 -07:00
Treehugger Robot
ded20371d3 Merge "Skip Android tests after initialization" into udc-widevine-dev 2023-08-25 18:43:05 +00:00
Vicky Min
a155742b41 Skip Android tests after initialization
Merged from go/wvgerrit/183552

Bug: 297123471
Test: OEMCryptoAndroidLMPTest
Change-Id: I708c285db77616c3060c3a49474cb6b7cd8da6af
2023-08-25 17:46:39 +00:00
Vicky Min
5b378d5172 Allow ODKs to be tested against older versions for Qualcomm
Merged from go/wvgerrit/179770

Bug: 276889732
Test: oemcrypto tests
Change-Id: I5aec5f03c68847470900dfaf20c6fd324c7f8251
2023-07-27 17:37:29 +00:00
Vicky Min
bc20b9dac9 Cherry pick cdm udc-widevine-release changes to udc-widevine-dev to be in sync with 18.3 release
Merged from go/wvgerrit/178231

Bug: 290252845
Test: WVTS tests seem to be running and passing
Change-Id: Ifff9123a73e173e835a6e89ba7c2760e1cd500fd
(cherry picked from commit 6889845d2e7e24f22c00b333335c34259b3fc96e)
2023-07-25 20:14:41 +00:00
Vicky Min
6d494fa76c Filter RSA 3072 tests
Merge from Widevine repo of http://go/wvgerrit/169089

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
RSA 3072 support. Note: I think part of this CL got lost in
go/wvgerrit/167740, so this is adding the rest in.

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

Change-Id: I3002f705f7e3f4b38d0e5efef355e5c3f3529218
2023-03-28 20:30:22 +00: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
Vicky Min
225a3e50ed Use GTEST_SKIP to skip prov40 tests
Merge from Widevine repo of http://go/wvgerrit/169076

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

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

Change-Id: I65a879fba24b199bd115980bdd556c123fcc1cdc
2023-03-28 20:30:22 +00:00
Fred Gylys-Colwell
6c834acc50 Update test updates and known issues to ChangeLog
Merge from Widevine repo of http://go/wvgerrit/169075

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

Bug: 275264353
Test: luci tests
Change-Id: I247e5fd73ad53d526a662badbca43520fed5f1bd
2023-03-28 20:30:22 +00:00
Fred Gylys-Colwell
2f45350921 Update oemcrypto unit tests version number
Merge from Widevine repo of http://go/wvgerrit/169074

And update a few scripts that check for version number.

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

Bug: 275264353
Test: luci tests
Change-Id: Ic3c16323e993075c9bfe206fc73bf82c0e67f65b
2023-03-28 20:30:22 +00:00
John "Juce" Bruce
8dd8fc5a79 Update CHANGELOG for late-breaking OPK v17.1.1 changes
Merge from Widevine repo of http://go/wvgerrit/169073

Due to the late-breaking maximum_minor_version change, we had to revise
the CHANGELOG on the release branch. This patch ports this change to the
development branches.

Bug: 275264353
Test: luci tests
Change-Id: I46a18bd05ad1ae2afc766eaaf39c563f82f4eeea
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
Matt Feddersen
803617b783 Document RSA keypair issue on OP-TEE 64-bit
Merge from Widevine repo of http://go/wvgerrit/169069
Merged from https://widevine-internal-review.googlesource.com/167604

Bug: 275264353
Test: luci tests
Change-Id: Ib77b2f7d3855779dd6d97696d6066ad361e6e416
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
John "Juce" Bruce
d3183f504e Remove V17 backwards-compatibility decrypt functions
Merge from Widevine repo of http://go/wvgerrit/169066

Now that we only have to support the v18 API, we can drop the v17
versions of these functions. For SelectKey, the new function fully
replaces it, so it has been removed. For the other functions, the v18
functions were calling the v17 functions previously. Now, they have been
rolled together.

These functions were not actually deprecated in the OEMCryptoCENC.h
header to allow OPK's serialization generator to still support them for
backwards-compatibility. Now that they are gone, this patch also
deprecates the functions.

Bug: 240995221
Merged from https://widevine-internal-review.googlesource.com/167338

Change-Id: I10261142121d4de8c96e2cd5fac570f7b536a82e
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
John "Juce" Bruce
ea3d319879 Add CHANGELOG entry for OPK v17.1.1
Merge from Widevine repo of http://go/wvgerrit/169062

Bug: 269670984
Merged from https://widevine-internal-review.googlesource.com/167378

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

Change-Id: I309aff7aa0e7f662893f20e54975009c427a525f
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
Matt Feddersen
dbd5bd2a4d Update OPK v18 documentation
Merge from Widevine repo of http://go/wvgerrit/169050

- Update changelog
- Update copy parter files script to include linux port
- Update opk_partner_test script (used to make sure everything works out
  of the box) with third party dependencies, refactored downloads into
  a public setup.sh script
- Remove WTPI_BUILD_INFO from OPK makefiles and gyp files, since it is
  no longer needed
- Remove FILES.md since it is out of date and ree-sources.mk and
  tee-sources.mk satisfy the same purpose
- Add debug flag in comments for OP-TEE and Linux ports. As a hint for
  how to enable debug in OPK
- Remove oemcrypto_build_info.h since it is no longer needed. Move the
  XSTR macro it contained to oemcrypto_api_macros.h
- Add provisioning method macro to OPTEE and Linux build files to hint
  at how to build Prov 2 and Prov 4 using the same build files but
  different build-time values.

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

Bug: 275264353
Test: luci tests
Change-Id: I220e3296f631d895a7c4504454635fe396efc0a4
2023-03-28 20:28:57 +00:00
Ian Benz
c579a79462 Fix null passed to memcpy in generic verify fuzz
Merge from Widevine repo of http://go/wvgerrit/169048

Do not generate a new signature during mutation if a key handle cannot
be retrieved by OEMCrypto_GetKeyHandle().

Bug: 275264353
Test: luci tests
Change-Id: I9a804328c4b6d3e50d14c3f9c71043e71a88e3da
2023-03-28 20:28:57 +00:00
Fred Gylys-Colwell
322355dbbf Update documentation for Cast
Merge from Widevine repo of http://go/wvgerrit/169044

Document changes needed for supporting cast and provisioning
4.0 at the same time.

Bug: 259454830
Merged from https://widevine-internal-review.googlesource.com/166459

Change-Id: Iebf50d856c18f29db66352041b2b0429c43bd594
2023-03-28 20:28:57 +00:00
Fred Gylys-Colwell
9e7877a95d Document lacking signature of Prov 3.0 message
Merge from Widevine repo of http://go/wvgerrit/169039

Bug: 243734378
Merged from https://widevine-internal-review.googlesource.com/166458

Change-Id: I3eae16d09cf42e554d450f746390744ef580ac03
2023-03-28 20:28:57 +00:00
Fred Gylys-Colwell
e51bb19296 Refresh corpus for oemcrypto fuzz tests with modified format
Merge from Widevine repo of http://go/wvgerrit/165958
and  http://go/wvgerrit/165862

Bug: 275264353
Test: test only code

Change-Id: I30829ad72d58e2233f4cc9963d17cb07314b7720
2023-03-28 20:28:57 +00:00
Jooyung Han
a4de7eb9b5 Set min_sdk_version for the Widevine APEX
also remove `use_vndk_as_stable: true` to remove dependency to VNDK
libs.

Bug: 251299786
Test: build WV APEX with V and install it on U device
Change-Id: Ie7f7f9b699119478d4b33f95ab9e6ba7f459346c
2023-03-28 06:57:46 +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
Bob Badour
080bfc7414 Merge "Cleanup vendor projects are proprietary." into tm-qpr-dev-plus-aosp am: cbb6177df2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/21276850

Change-Id: I7ba871f7714ba4eb5dcb5b0571b6024533a25217
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-05 03:54:39 +00:00
Bob Badour
6f047790e0 Cleanup vendor projects are proprietary.
Test: m droid dist
Change-Id: I0bdec38c4d12710fa97b91665d211ba6c0d4b24d
2023-02-03 14:37:11 -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