Commit Graph

7005 Commits

Author SHA1 Message Date
Cong Lin
5e24549b1a Internal factory tool implements CSR v3
Widevine internal BCC extraction tool to extract CSR v3 for testing
purpose. The difference it has from the factory tool is it doesn't rely
on Widevine IRPC HAL.

It just extracts BCC/CSR in the specified format from cli.

Test: Extract CSR v3 on Pixel 7 and upload
Bug: 268246995
Change-Id: I52abe09f991c89c6e7601bcef4d980f24c020c9f
2023-03-02 12:19:43 -08:00
Cong Lin
8dc7cc0c74 Factory tool implements Widevine IRPC HAL v3
Implement IRPC HAL v3 interfaces for extracting device registration CSR.
The new interface calls OEMCrypto_GetDeviceInformation() and
OEMCrypto_GetSignedCsrPayload() and then constructs the CSR.

Also added all mandatory fields of device info in the request.

Test: Run extraction tool on Pixel 7 and upload CSR
Test: Verified Widevine remote provisioning
Bug: 268246995
Change-Id: I24097ba32c7a105266071c1341c938b5874b38d8
2023-03-02 10:51:45 -08: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
Rahul Frias
3f7ecbc43e Merge changes Ia54117ff,I4d469a73,I926d8309 into udc-dev
* changes:
  Remove comment.
  Request debug headers and log URL correctly
  Integration tests for renew on license load
2023-02-25 00:09:25 +00:00
John "Juce" Bruce
340810f77f Remove hash algorithm from renewal requests
(Merged from http://go/wvgerrit/165859.)

Since renewal requests are signed with the MAC keys and not an
asymmetric key, it does not make sense to query OEMCrypto for the
asymmetric key hash algorithm nor to include the result in the renewal
request.

Bug: 262427121
Test: opk_ta
Change-Id: Ib309b63b79e553f4754c013718df242247ab9488
2023-02-24 21:11:50 +00:00
Bob Badour
1625b15b31 [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine
Added legacy_proprietary to:
  libwvdrmengine/apex/prebuilt/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I95cd31dc2d2cea5b266a22b6f6c87db1cfec4f68
2023-02-23 07:23:04 -08:00
Rahul Frias
f63a0b287d Remove comment.
Merged from https://widevine-internal-review.googlesource.com/164120

Based on review comment in PS10 of http://go/ag/20608670

Bug: 262797186
Test: GtsMediaTestCases
Change-Id: Ia54117ffd0882de161e772fc1ca180a8d3f27480
2023-02-22 15:53:42 -08:00
Rahul Frias
c41b6cb713 Request debug headers and log URL correctly
Merged from https://widevine-internal-review.googlesource.com/165861

We want debug headers to help diagnose b/186031735. I also
saw that we were only logging the domain name for some
errors instead of the full URL.

Bug: 186031735
Test: GtsMediaTestCases
Change-Id: I4d469a73e54f86d4d3b5d50bd0030fdb2a36df50
2023-02-22 15:09:22 -08:00
Rahul Frias
ca79034a3d Integration tests for renew on license load
Merged from https://widevine-internal-review.googlesource.com/164468

We need to add integration tests in the form of duration license tests
in order to test that this feature works with licenses from a real
server.

Bug: 253513745
Test: WV unit/integration tests
Change-Id: I926d8309ed24183ae117e3f66fb92fec2d95c310
2023-02-22 13:59:22 -08:00
TreeHugger Robot
7c5f53f861 Merge "Drop nonupdatable Widevine prebuilt files to android source tree." 2023-02-16 00:28:10 +00:00
Rahul Frias
04d136df36 Merge "Logging for L1 devices falling back to L3" 2023-02-15 21:53:10 +00:00
Kyle Zhang
2e143c1b06 Drop nonupdatable Widevine prebuilt files to android source tree.
The following files have been updated as part of this change:

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

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

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

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

Built here: ab/9591839

Bug: 251299786
Change-Id: Iea7c522571f1648c1f6fa05e6024e4fe49037e3a
2023-02-15 21:50:38 +00:00
Rahul Frias
ca583d9510 Logging for L1 devices falling back to L3
[ Merge of http://go/wvgerrit/161877 ]

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
2023-02-14 14:11:08 -08:00
Alex Dale
b11890a694 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-13 13:27:50 -08:00
Alex Dale
1deba6cee1 Merge "Delete secure stops by key set ID." 2023-02-09 23:17:59 +00:00
Cong Lin
0a9e639c15 [automerger skipped] [DO NOT MERGE] Update L3 Android T with new system id after key free fix am: a4b942e176 am: 95d87f3936 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/21218719

Change-Id: I3354ce705fb7cde7d7535570be3756654dd25976
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-09 21:35:57 +00:00
Cong Lin
95d87f3936 [DO NOT MERGE] Update L3 Android T with new system id after key free fix am: a4b942e176
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/21218719

Change-Id: I79df83fc2250399f71d1e20e17444781e09d53cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-09 20:55:46 +00:00
Bob Badour
96fbf2481a Merge "Vendor projects are proprietary." 2023-02-09 18:53:02 +00:00
TreeHugger Robot
e2fd67cb3c Merge "Add non-updatable Widevine Apex in build" 2023-02-09 18:52:07 +00:00
Bob Badour
c34ecdc774 Vendor projects are proprietary.
Test: m droid dist
Change-Id: I19435feeece687cf7977ea62faac7a9692315449
2023-02-08 21:44:52 -08:00
Alex Dale
2c05c65138 Delete secure stops by key set ID.
[ Merge of http://go/wvgerrit/165617 ]

Similar to the issue with updating secure stops by PST (see
http://go/wvgerrit/165597), when deleting different secure stops with
the same PST results in unintended behavior.  This CL changes how the
CDM identifies which secure stop to delete from storaged based on the
key set ID rather than the PST.

Bug: 263316107
Test: device_files_unittest
Test: GTS MediaDrmParameterizedTests and MediaDrmStressTest
Change-Id: Ic3843a1435f252f052c7189423c211c28ed74eaa
2023-02-07 22:32:24 -08:00
Kyle Zhang
ca0a653b2d Add non-updatable Widevine Apex in build
Bug: 251299786
Test: m com.google.android.widevine.nonupdatable
Change-Id: I7129d28ef1fbfddf4176849f5d6bbe9dcc6b3df1
2023-02-07 19:28:19 +00:00
Edwin Wong
97bbc07174 Fixed race condition in closeSession
Merged from http://go/wvgerrit/165059
poc: http://go/ag/20978761

Fix race that corrupts mCryptoSessions std::map,
and race that occurs when CryptoSessions are used after free.

Test: poc
Test: atest MediaDrmParameterizedTests
Test: atest GtsMediaTestCases

Bug: 258189255
Change-Id: I298d3e0770ace9cd590dfaacaa4c52a0732c2fe3
Merged-In: I298d3e0770ace9cd590dfaacaa4c52a0732c2fe3
2023-02-06 18:29:02 +00:00
Edwin Wong
08acec9c3a Fixed race condition in closeSession
Merged from http://go/wvgerrit/165498
poc: http://go/ag/20978761

Fix race that corrupts mCryptoSessions std::map,
and race that occurs when CryptoSessions are used after free.

Test: poc
Test: atest MediaDrmParameterizedTests
Test: atest GtsMediaTestCases

Bug: 258189255
Change-Id: I298d3e0770ace9cd590dfaacaa4c52a0732c2fe3
Merged-In: I298d3e0770ace9cd590dfaacaa4c52a0732c2fe3
2023-02-06 18:28:14 +00: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
cbb6177df2 Merge "Cleanup vendor projects are proprietary." into tm-qpr-dev-plus-aosp 2023-02-05 03:06:24 +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
a4b942e176 [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/+/165219

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

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.
Re-used in tm-qpr-dev.

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.

Test: ran L3 unit tests
Test: verified GTS tests on arm32 device
Test: ran GTS media tests on Pixel4
Bug: 252434586
Bug: 267486513

Change-Id: I8ebc19260b37615efd77a533bd005f2b9485182a
2023-02-03 18:48:47 +00:00
Alex Dale
16e4fb594a Merge "Update secure stops by key set ID." 2023-02-02 02:59:59 +00:00
Alex Dale
5ae1d0fa6e Update secure stops by key set ID.
[ Merge of http://go/wvgerrit/165191 ]

Previously, when updating a secure stop / usage info record, the
existing record was identified by PST.  It was assumed that apps would
never use the same PST for different licenses; however, this was never
enforced.  Certain GTS tests use the same PST across multiple tests to
identify different licenses.  Depending on the order of operations,
the periodic updating of the usage entry might overwrite the wrong
entry.

Key set IDs are generated by the CDM, and are guaranteed to be unique
within the scope of the same file system.  Given that key set IDs are
not expected to be transfered to different licenses, using the key
set ID to identify secure stop / usage info records eliminates the
possibility of overwriting the wrong entry.

Bug: 263316107
Test: device_files_unittest
Test: GTS MediaDrmParameterizedTests and MediaDrmStressTest
Change-Id: I2e2d50d188e05c8ca6b8095549796b913ea72d7a
2023-02-01 15:33:13 -08:00
Robert Shih
aa7e0b2af9 [automerger skipped] Merge "Add "version" to device info in prov4 upload tool" into tm-qpr-dev am: 5f3f0cf2af am: d7936acd30 -s ours
am skip reason: Merged-In I3e2b7158c72fb4321b67053995f62483da934a18 with SHA-1 8764c60fd4 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/21097263

Change-Id: Id5e34867a234cbe0b2850f5f2769538272e29da2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-01 22:45:30 +00:00
Robert Shih
6dada11e7f Surface wv_factory_extraction_tool on ab am: fdb47a37da am: 34cc01c8a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/19392134

Change-Id: Ie7946efc33f4de61b2f96497152186c407fa6acd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-01 22:43:49 +00:00
Robert Shih
d7936acd30 Merge "Add "version" to device info in prov4 upload tool" into tm-qpr-dev am: 5f3f0cf2af
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/21097263

Change-Id: Ie5438b300ef4cc738debb89c72bc3c2d9059007f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-01 22:21:48 +00:00
Robert Shih
5f3f0cf2af Merge "Add "version" to device info in prov4 upload tool" into tm-qpr-dev 2023-02-01 22:09:02 +00:00
Robert Shih
34cc01c8a4 Surface wv_factory_extraction_tool on ab am: fdb47a37da
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/19392134

Change-Id: I7cf05dc2d732b0e71c2950947df6621d92531e7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-01 22:01:26 +00:00
Alex Dale
659301abd3 Specified /bin/bash for Android scripts.
[ Merge of http://go/wvgerrit/165139 ]

Changed the specified shell program used to execute our team's Android
scripts to bash.

Bug: 266891333
Test: ./build_all_unit_tests.sh
Change-Id: Id6fc8e4db10a71e9f17fc48a52a4883331e908d3
2023-01-26 22:23:25 -08:00
Kyle Zhang
dd935f3feb Merge "Update linker config settings" 2023-01-25 18:16:51 +00:00
Robert Shih
fdb47a37da Surface wv_factory_extraction_tool on ab
[ Merge of go/wvgerrit/165108 ]

Bug: 234078142
Bug: 238831085
Test: adb shell wv_factory_extraction_tool csr
Change-Id: I3c689b5719a0a72410d6d8cb95c7c416e67931e5
2023-01-25 15:58:04 +00:00
Rahul Frias
263d675e0e Add "version" to device info in prov4 upload tool
[ Merge of http://go/wvgerrit/160457 ]

Bug: 255921326
Bug: 262198471
Test: WV android unit tests
Merged from https://widevine-internal-review.googlesource.com/160427

Change-Id: I3e2b7158c72fb4321b67053995f62483da934a18
Merged-In: I3e2b7158c72fb4321b67053995f62483da934a18
2023-01-25 07:51:44 -08:00
TreeHugger Robot
c72114c82c Merge "Update L3 after key double free fix master" 2023-01-20 18:52:38 +00:00
Edwin Wong
94f86b717c Fixed race condition in closeSession
Merged from http://go/wvgerrit/164799

Fix race that corrupts mCryptoSessions std::map,
and race that occurs when CryptoSessions are used after free.

Test: poc
Test: atest MediaDrmParameterizedTests
Test: atest GtsMediaTestCases

Bug: 258189255
Change-Id: I298d3e0770ace9cd590dfaacaa4c52a0732c2fe3
2023-01-18 20:04:44 +00:00
Kyle Zhang
dfb0b0d877 Update linker config settings
Update Widevine Apex linker config settings according to b/264330513.

Bug: 243699259
Test: atp v2/widevine-eng/drm_compliance
Change-Id: I0c7581e44dff9f8a4193ef29e68ddef42451b4f6
2023-01-18 06:36:08 +00:00
Cong Lin
7aceca7310 Update L3 after key double free fix master
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/165018

Orignal commit message:
Update L3 in master branch after key double free fix

The fix is here:
https://widevine-internal-review.googlesource.com/c/cdm/+/164909/

Re-generated L3 libraries.

Test: ran L3 unit tests
Test: verified GTS tests on arm32 device
Bug: 252434586
Change-Id: Iea022b3d1087b79edf6649c038e1f701375989c6
2023-01-17 16:52:36 -08:00
Bob Badour
d676bd9c6d [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine
Added legacy_by_exception_only to:
  libwvdrmengine/apex/device/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I9eee9c7bdc6125447499996f49f88e055bd38f83
2023-01-11 10:17:02 -08:00
Kyle Zhang
a95cd36de5 Merge "Add liboemcrypto.so as required by WV APEX" 2023-01-11 05:37:46 +00:00
TreeHugger Robot
d933e34824 Merge "Renaming of Usage Table related variables and types." 2023-01-10 02:43:26 +00:00
Kyle Zhang
a5c7a48f8a Add liboemcrypto.so as required by WV APEX
[ Merge of go/wvgerrit/164757 ]

Modify Widevine apex configuration to add add liboemcrypto.so as
required by WV APEX.

Bug: 243699259
Test: atp v2/widevine-eng/drm_compliance
Change-Id: I136dde5d77aed4fb14737e4692153c8f3b2c701b
2023-01-09 06:32:39 +00:00
Rahul Frias
609349c314 Merge changes Ib18af309,Iebd58823,Ic3a503ef
* changes:
  Support renew on load
  Move functionality to policy_timer.
  Remove references to policy_timers_v15
2022-12-22 08:11:29 +00:00
Rahul Frias
1208c78e94 Merge changes Iec2a8b7f,I01530934
* changes:
  Support ATSC license installation
  Add error codes to support ATSC license installation
2022-12-22 07:07:14 +00:00
Rahul Frias
ab91cf934e Support renew on load
[ Merge of http://go/wvgerrit/164477 ]

Renew on load is supported when OEMCrypto is >= v18.
A new class, policy_timer_v18 has been added to support this
functionality. In addtition,offsets of renewal from first decrypt
and license start are also included.

Bug: 256038127
Test: GtsMediaTestCases
Change-Id: Ib18af3096d1d8807af6a03fd2f84783123ab6b6d
2022-12-21 17:33:02 -08:00