Commit Graph

3553 Commits

Author SHA1 Message Date
Kyle Zhang
85223cf29a Merge "Lock v19.1 API" into main 2024-03-28 23:26:55 +00:00
Treehugger Robot
2b80494f57 Merge "Add BCC extract tool for BCC uploading test" into main 2024-03-28 23:04:05 +00:00
Matt Feddersen
fb1554a10b Lock v19.1 API
Merged from https://widevine-internal-review.googlesource.com/195130

Change-Id: I44760c19bc1457017ffacdda5f3c40f4a66edccb
2024-03-28 14:04:35 -07:00
Treehugger Robot
24027c5ebf Merge "Quit test setup when test is skipped" into main 2024-03-26 23:00:40 +00:00
Rahul Frias
ee77a96d74 Merge changes I55b1eb04,I839db69a,I43e845b8,I56b6d301,Ia59bfacf, ... into main
* changes:
  Unit tests for forbidden RSA key usage
  Add DRM reprovisioning request generation
  Correct copyright header
  Fix bcc length for printing
  Update ODK version to 18.4
  Adjust skipping tests when provisioning skipped
  Change test storage to use protobuf
  Remove WvCdmEnginePreProvTestStaging
  Rename and clarify Drm Reprovisioning token types
2024-03-26 06:09:26 +00:00
Treehugger Robot
284b6bef68 Merge "Skip License Release tests when there is no usage table" into main 2024-03-25 20:04:28 +00:00
Fred Gylys-Colwell
202350959d Quit test setup when test is skipped
The SetUp for child classes do not automatically quit when
the parent SetUp is skipped.

Bug: 305093063
Change-Id: I606a949ef0e94fa87a97268856b7f2d8b9135ebe
2024-03-21 16:58:05 -07:00
Alex Dale
f7944b4dac Merge "Update support for HDCP levels on Android and CE CDM." into main 2024-03-21 21:00:59 +00:00
Cong Lin
1fd5a8bf37 Add BCC extract tool for BCC uploading test
Extract BCC and build info from oemcrypto, construct BCC uploading
record and dumps it out a JSON file.

The BCC uploader will pick up the output file later.

Bug: 312787974
Change-Id: Ie8ef6a75408e8ef8355b1c0de14532de0ae83732
2024-03-21 13:35:46 -07:00
Vicky Min
c001e2f5a4 Skip License Release tests when there is no usage table
Bug: 330364107
Merged from https://widevine-internal-review.googlesource.com/194574

Change-Id: I25db60e239b157d736d89506280c3d218215fb6f
2024-03-21 11:46:42 -07:00
Rahul Frias
a798692e4e Unit tests for forbidden RSA key usage
[ Partial merge of http://go/wvgerrit/188279 ]

This CL adds unit tests to verify that the following
forbidden uses of an RSA private key do not work:

- ForbidPrepAndSign -- A cast cert key cannot sign a license
  request.
- ForbidUseAsDRMCert -- A cast cert cannot be used with the
  DRM cert's padding scheme and it cannot be used to derive
  keys from a session key.
- *ForbidRSASignatureForDRMKey* -- A DRM cert key cannot be
  used with GenerateRSASignature.
- *OEMCertForbidGenerateRSASignature* -- An OEM cert key
  cannot be used with GenerateRSASignature.

Bug: 251875110
Test: WVTS
Change-Id: I55b1eb04465023352edea55ba4ef532d1cd07231
2024-03-20 23:59:55 -07:00
Rahul Frias
b3157f2328 Add DRM reprovisioning request generation
[ Merge of http://go/wvgerrit/192010 ]

Adding files not merged in ag/26501922

Updates the CDM to add support for DRM reprovisioning request creation.
- Load the baked-in certificate for use as the client token.
- Add functions to build and sign a drm reprovisioning request.
- Update the Rikers L3 OEMCrypto implementation to support signing
  provisioning requests and getting embedded certificate.
- Update client id token to handle DRM reprovisioning.
- Add OEMCrypto function to load the baked-in device certificate in
  Rikers CDMs and stubs for non-Rikers CDMs.
- Add dynamic adapter support for getting embedded device certificate
  only on L3.

Bug: 305093063
Test: WVTS
Change-Id: I839db69a48c1add196f9b56e6ee3812f549f814d
2024-03-20 23:30:26 -07:00
Rahul Frias
8046719c10 Correct copyright header
[ Merge of http://go/wvgerrit/186825 ]

Remove the words ` All rights reserved.` from Widevine's
existing copyright headers.

For context, see cl/578224540

Bug: 330655176
Test: WVTS

PiperOrigin-RevId: 580020267
Change-Id: I43e845b83f438e4ef7f0f542c2f4e427a188ab06
2024-03-20 23:24:17 -07:00
Cong Lin
5e186dcfa6 Fix bcc length for printing
[ Merge of http://go/wvgerrit/194310 ]

Resize bcc to the correct length to eliminate the trailing zeros.

Bug: 330645490
Test: core unit tests

Change-Id: I56b6d30120735a4d7a0f39f29a9f255bd2d2d18c
2024-03-20 21:41:15 -07:00
Vicky Min
882c80783b Update ODK version to 18.4
[ Merge of http://go/wvgerrit/192493 ]

Bug: 311951236
Test: WVTS

Change-Id: Ia59bfacf91d812f36f7a198632f7fa3462d0b8df
2024-03-20 20:45:43 -07:00
Fred Gylys-Colwell
38243aca4c Adjust skipping tests when provisioning skipped
[ Merge of http://go/wvgerrit/194254 ]

For some platforms, we cannot provision. In this case, any
test that needs provisioning is skipped. However, when a
test is skipped in a subroutine, the rest of SetUp is still
run. Any failures in SetUp will cause the test to be marked
as a failure.

This CL duplicates the check for skipping the test in SetUp
and in TearDown.

Bug: 329467151
Test: WV and unit/integration tests

Change-Id: I0087b12a3f26b52ecf62bf7b0e7bcf4fa2c6c763
2024-03-20 14:55:42 -07:00
Jacob Trimble
428586b0eb Change test storage to use protobuf
[ Merge of http://go/wvgerrit/193190 ]

This changes the persistent test storage to use protobufs instead of
manual parsing.  This simplifies the code but makes the files less
"human readable".  Files can be read using 'gqui' if needed.

Bug: 312529037
Test: unit/integration tests
Change-Id: I1b025eac96458c0061e0883e1e4fd05484842ff2
2024-03-20 13:59:14 -07:00
Fred Gylys-Colwell
d3b869c0ab Remove WvCdmEnginePreProvTestStaging
[ Merge of http://go/wvgerrit/194370 ]

This test explicitly provisions against the staging server,
which we do not require from partners.

Bug: 329293570
Test: WV unit/integration tests

Change-Id: Id88840f188ec99b386837d83f69844b0990594a9
2024-03-20 13:30:23 -07:00
Geoffrey Alexander
e9e4b76817 Rename and clarify Drm Reprovisioning token types
[ Merge of http://go/wvgerrit/194374 ]

Renames and adds clarifying comments to Drm Reprovisioning token types.
All provisioning methods can be forced to reprovision by apps which can
cause reprovisioning to be an overloaded term. Renaming token types
used by the Drm Reprovisioning method to more clearly state they are
used for Drm Certificate Reprovisioning should help to avoid confusion.
This change also adds comments to help clarify when and where Drm
Reprovisioning is used as a provisioning type.

Bug: b/305093063
Test: WVTS

* Added dependency to dynamic perf tests to fix missing header build
  error.

Change-Id: I158eb5672ad9e655a60bc68e0f4f2f7a0d464b4e
2024-03-20 11:15:58 -07:00
Rahul Frias
7cc19077ca Merge "Add DRM reprovisioning request generation" into main 2024-03-20 17:24:36 +00:00
Rahul Frias
fb795b7946 Merge "Call CopyBuffer in Decrypt if key handle is empty" into main 2024-03-19 21:22:30 +00:00
Alex Dale
a5393206b1 Merge "Reset crypto session pointers on RemoveKeys." into main 2024-03-19 19:07:28 +00:00
Robert Shih
f6b1fb288a WVCdm version stamping
First, version.txt will be stamped by Android CI with a release
candidate name like "ZV1A.240307.001".

Next, a genrule will read version.txt and embed the release candidate
name inside the Widevine CDM binary.

See also:
- go/wv-trunk "Versioning"
- cl/616721723

Bug: 327241925
Test: Coastguard
Change-Id: I892ee957c058ac5f624912a38a048781af5f3487
2024-03-18 21:32:04 -07:00
Vicky Min
6577f6f212 Call CopyBuffer in Decrypt if key handle is empty
(Merged from go/wvgerrit/193672)

Bug: 320785945
Test: GTS + unit tests
Change-Id: I4a0c7568bf8323187f1156874ea98718511120f4
2024-03-15 14:50:02 -07:00
Rahul Frias
af2ffca5fa Add DRM reprovisioning request generation
[ Merge of http://go/wvgerrit/192010 ]

Updates the CDM to add support for DRM reprovisioning request creation.
- Load the baked-in certificate for use as the client token.
- Add functions to build and sign a drm reprovisioning request.
- Update the Rikers L3 OEMCrypto implementation to support signing
  provisioning requests and getting embedded certificate.
- Update client id token to handle DRM reprovisioning.
- Add OEMCrypto function to load the baked-in device certificate in
  Rikers CDMs and stubs for non-Rikers CDMs.
- Add dynamic adapter support for getting embedded device certificate
  only on L3.

Bug: 305093063
Test: WVTS
Change-Id: I9a0ecf95e27213b046f03baa0781fb164179323b
2024-03-15 10:22:35 -07:00
Rahul Frias
6499e7063d Merge "Re-generate Android L3 after merging oemcrypto-v19 to master" into main 2024-03-14 22:24:42 +00:00
Alex Dale
b1fad7f4cb Reset crypto session pointers on RemoveKeys.
[ Merge of http://go/wvgerrit/189590 ]
[ Cherry-pick of http://ag/26541307 ]

The CDM session shares its CryptoSession instance with a few additional
member objects (CdmLicense and PolicyEngine).  When the CDM session's
crypto session is reset, it must also reset the CdmLicense and
PolicyEngine otherwise, a potential stale pointer reference may occur.

Test: request_license_test on Oriole
Test: run_x86_64_tests
Bug: 311239278
Change-Id: Ie175513ae652dcd96e12e5e1def574a8a56d5863
2024-03-14 00:19:25 -07:00
Alex Dale
67393a2cb6 Update support for HDCP levels on Android and CE CDM.
[ Merge of http://go/wvgerrit/194050 ]

OEMCrypto v17 introduced higher granularity in the device's HDCP V1
levels.  Previously, all HDCP v1.x were group together.  The change
was aimed towards server policy enforcement, not device enforcement.

Core code was updated, and could then be reflected in license
requests; however, reporting the new v1.x subversions was never
exposed to the higher app layers.

It is likely that devices which attempted to use specific 1.x versions
encountered test failures (for both CE CDM and Android CDM) as neither
implementations could handle such versions when communicating with
the app.

This change updates both CE CDM and Android CDM:
1) The CE CDM now uses the same subversion version comparisons as
   performed by the core code.
2) The Android CDM will now recognize new HDCP levels, and not return
   unexpected values.

Bug: 329155501
Test: run_x86_64_tests
Test: request_license_test on Oriole
Change-Id: I61fc0f11808f594456bd00210fd9b2bb5ed16c0e
2024-03-13 23:02:26 -07:00
Kyle Zhang
5c175ad151 Merge "Add new dev apex set 11546836" into main 2024-03-13 17:21:17 +00:00
Rahul Frias
72077acec6 Re-generate Android L3 after merging oemcrypto-v19 to master
[ Merge of http://go/wvgerrit/192271 ]

Test: L3 unit tests and GTS on pixel 7
Bug: 324147162
Test: WVTS
Change-Id: I5d94b0c9b3f681774e32623463b0d689f5bacc8c
2024-03-11 22:48:46 +00:00
Kyle Zhang
1324d5954b Add new dev apex set 11546836
Bug: 324294223
Change-Id: If74e9cffebb5b2aa05824973449dbebd8de269f1
2024-03-11 18:33:30 +00:00
Kyle Zhang
cbc38ca085 Drop Widevine apex prebuilt files for dev 11546836
The following files have been updated as part of this change:

libwvdrmengine/apex/prebuilt/dev/com.google.android.widevine.lazy-11546836.apks[standalones/standalone-arm64_v8a.apex]
package: name=com.google.android.widevine.lazy
versionCode=11546836
versionName=
platformBuildVersionName=UpsideDownCake
compileSdkVersion=34
compileSdkVersionCodename=UpsideDownCake
sdkVersion:34
targetSdkVersion:10000

libwvdrmengine/apex/prebuilt/dev/com.google.android.widevine.lazy-11546836.apks[standalones/standalone-armeabi_v7a.apex]
package: name=com.google.android.widevine.lazy
versionCode=11546836
versionName=
platformBuildVersionName=UpsideDownCake
compileSdkVersion=34
compileSdkVersionCodename=UpsideDownCake
sdkVersion:34
targetSdkVersion:10000

libwvdrmengine/apex/prebuilt/dev/com.google.android.widevine.lazy-11546836.apks[standalones/standalone-x86.apex]
package: name=com.google.android.widevine.lazy
versionCode=11546836
versionName=
platformBuildVersionName=UpsideDownCake
compileSdkVersion=34
compileSdkVersionCodename=UpsideDownCake
sdkVersion:34
targetSdkVersion:10000

libwvdrmengine/apex/prebuilt/dev/com.google.android.widevine.lazy-11546836.apks[standalones/standalone-x86_64.apex]
package: name=com.google.android.widevine.lazy
versionCode=11546836
versionName=
platformBuildVersionName=UpsideDownCake
compileSdkVersion=34
compileSdkVersionCodename=UpsideDownCake
sdkVersion:34
targetSdkVersion:10000

libwvdrmengine/apex/prebuilt/dev/com.google.android.widevine.nonupdatable-11546836.apks[standalones/standalone-arm64_v8a.apex]
package: name=com.google.android.widevine.nonupdatable
versionCode=11546836
versionName=
platformBuildVersionName=UpsideDownCake
compileSdkVersion=34
compileSdkVersionCodename=UpsideDownCake
sdkVersion:34
targetSdkVersion:10000

libwvdrmengine/apex/prebuilt/dev/com.google.android.widevine.nonupdatable-11546836.apks[standalones/standalone-armeabi_v7a.apex]
package: name=com.google.android.widevine.nonupdatable
versionCode=11546836
versionName=
platformBuildVersionName=UpsideDownCake
compileSdkVersion=34
compileSdkVersionCodename=UpsideDownCake
sdkVersion:34
targetSdkVersion:10000

libwvdrmengine/apex/prebuilt/dev/com.google.android.widevine.nonupdatable-11546836.apks[standalones/standalone-x86.apex]
package: name=com.google.android.widevine.nonupdatable
versionCode=11546836
versionName=
platformBuildVersionName=UpsideDownCake
compileSdkVersion=34
compileSdkVersionCodename=UpsideDownCake
sdkVersion:34
targetSdkVersion:10000

libwvdrmengine/apex/prebuilt/dev/com.google.android.widevine.nonupdatable-11546836.apks[standalones/standalone-x86_64.apex]
package: name=com.google.android.widevine.nonupdatable
versionCode=11546836
versionName=
platformBuildVersionName=UpsideDownCake
compileSdkVersion=34
compileSdkVersionCodename=UpsideDownCake
sdkVersion:34
targetSdkVersion:10000

Built here: ab/11546836

The change is generated with prebuilt drop tool.

Change-Id: I646e410011c4168987e7ced0101a3ae7c442ab8f
2024-03-11 18:17:15 +00:00
Rahul Frias
e7a96ec47a Merge "Run unit tests if verity has already been disabled" into main 2024-03-08 22:30:45 +00:00
Rahul Frias
925b52e133 Merge "Add a flag to enable Rikers" into main 2024-03-08 05:20:06 +00:00
Robert Shih
179c197464 Bump kWVAndroidCdmVersion to v19
Bug: 323289757
Bug: 328438268
Change-Id: I634752312c4567aa3703f4f35c1d1457baa2021b
2024-03-06 11:18:11 -08:00
Robert Shih
6f03887937 Widevine version genrules (2nd attempt)
Bug: 327241925
Bug: 328438268
Test: dumpsys android.hardware.drm.IDrmFactory/widevine
Change-Id: I0336f366910de9c4ea8903b09d64c32b8d68c977
2024-03-06 11:18:07 -08:00
Priyanka Advani
543c875b55 Merge "Revert "Widevine version genrules"" into main 2024-03-06 18:44:57 +00:00
Rahul Frias
54e0514767 Merge "Add /system/lib[64] to LD_LIBRARY_PATH" into main 2024-03-06 17:17:05 +00:00
Vaibhav Devmurari
8aef692798 Revert "Widevine version genrules"
This reverts commit 9f32150e5f.

Reason for revert: Potential cause for b/328364975

Change-Id: I3d1411cb183bf3faf04dee51f8a191ec796517f4
2024-03-06 11:50:38 +00:00
Robert Shih
9f32150e5f Widevine version genrules
Bug: 327241925
Test: dumpsys android.hardware.drm.IDrmFactory/widevine
Change-Id: Ice412cd2739f0c8a95af488cf565a3abf484200a
2024-03-05 14:36:52 -08:00
Rahul Frias
b0203576c4 Run unit tests if verity has already been disabled
[ Merge of http://go/wvgerrit/192930 ]

The script to run unit/integration tests aborts if an adb remount
command indicates that verity needs to be run. This just checks
for presence of the string "verity" in the output. Some devices
output "Verity is already disabled". The test script should not
abort the run in this scenario.

Bug: 327421750
Test: ./build_and_run_all_tests.sh
Change-Id: Ic953f25aba31be0ca527bc000f433d8c9076effa
2024-02-28 09:44:13 -08:00
Rahul Frias
72ad929dc8 Add /system/lib[64] to LD_LIBRARY_PATH
[ Merge of http://go/wvgerrit/192851 ]

When running widevine unit/integration tests the script sets
the LD_LIBRARY_PATH to include /vendor/lib[64] and
/system/lib[64]/vndk-R so that shared libraries can be found.

/system/lib[64] also needs to be included so that
libbinder.so and libbinder_ndk.so are also picked up.

Bug: 325595891
Test: ./build_and_run_all_tests
Change-Id: I411bb98474eb7e65bf9070c029869a9d4d220673
2024-02-28 08:16:07 -08:00
Robert Shih
fc8d793682 Fix certificate_provisioning_unittest after KDF change
KDF change: ag/26339839

Bug: 299527712
Change-Id: Ibfff3c13b10615e71f60fc69a811a3119881ea80
2024-02-23 10:41:49 -08:00
Jacob Trimble
649640709f Remove OEMCrypto_GetRandom from dynamic adapter
This is no longer used in v18, so we no longer need it in the dynamic
adapter or in the L3.

Change-Id: I0dc584252344bf7e271b282c26bc48d0b6618458
2024-02-23 09:47:26 -08:00
Cong Lin
02fbb0adcd Re-generate Android L3 after L3 fixes
Build L3 after
https://widevine-internal-review.git.corp.google.com/c/cdm/+/186593

Test: run_dynamic_level3
Bug: 323957284
Change-Id: Ica4974d4ed941174e43d4898771ffe004f9cf8db
2024-02-23 08:47:28 -08:00
Cong Lin
55ff31629f Add -DHAS_HAYSTACK flag to Android L3 build
Using Haystack L3 for now.

Test: build widevine apex
Bug: 324147162
Change-Id: I6421b2cd6f48efc32b7067c7dfd31203181c1e84
2024-02-23 08:47:28 -08:00
Cong Lin
2ba9667dee Update L3 with new SystemIDs for Android V
ID     Description
33097  Android Arm L3 Provisioning 3.0 2024
33098  Android Aarch64 L3 Provisioning 3.0 2024
33099  Android X86 L3 Provisioning 3.0 2024
33100  Android X86 64 L3 Provisioning 3.0 2024

Test: L3 playback tests on pixel
Change-Id: I74a377fa52e1cb8f4c3ae1c7c1edf70086b3fd14
2024-02-23 08:47:27 -08:00
Cong Lin
d81b8f97b2 Add OEMCrypto_GetBCCType() in L3
It is used by prov4 only. So L3 will just return
OEMCrypto_ERROR_NOT_IMPLEMENTED.

Test: build L3
Bug: 307969500
Change-Id: Iff6c79a3fb0220a6c995186f5923ce5ad6bc256f
2024-02-23 08:47:26 -08:00
Cong Lin
0e165f6d54 L3 v19: Rebuild Android L3 and update .bp files
Regenerate L3 after fixes and add new source to .bp files.

Test: Build Widevine apex in Android main
Change-Id: I93fd5cf22437a2c8e6d2b60d9994dbf97f4ba213
2024-02-23 08:47:13 -08:00
Cong Lin
47ef97c747 L3 v19: Add missing v19 function declarations
OEMCrypto_PrepAndSignReleaseRequest() and OEMCrypto_LoadRelease()
declarations are needed for L3 static adapter to build.

Test: run_level3_static_tests
Bug: 323957284
Change-Id: I9ccb4e51fd404b6a49e865545e9a5b4f22169cf7
2024-02-23 08:41:07 -08:00