Commit Graph

7023 Commits

Author SHA1 Message Date
Jooyung Han
6808813f46 Add build script for widevine apkset.
This builds Widevine APEXes for every target arch and then build APKS
file signed with devkeys.

Bug: 281617982
Test: DIST_DIR=out/dist UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true \
  TARGET_BUILD_APPS="com.google.android.widevine \
    com.google.android.widevine.nonupdatable \
    com.google.android.widevine.lazy" \
  vendor/widevine/libwvdrmengine/apex/device/build.sh
Change-Id: I6b47d9de3d572298e84b26b744710818e9f75210
2023-05-11 16:01:39 +09:00
Treehugger Robot
24c3bbb783 Merge "Skip RenewOnLicenseLoad tests for v17 OEMCrypto" into udc-dev 2023-05-08 20:38:47 +00:00
Treehugger Robot
6511d44f3c Merge "Expect failure on license load for expired LDL license" into udc-dev 2023-05-08 19:03:33 +00:00
Rahul Frias
fa4f9ca07d Skip RenewOnLicenseLoad tests for v17 OEMCrypto
[ Merge of http://go/wvgerrit/173950 ]

Bug: 280641992
Test: duration use case tests
Change-Id: If81df367c9359592b1ba797f6192d413afe55273
2023-05-08 11:55:40 -07:00
Alex Dale
f2bf164914 Updated usage test to expect v16 duration values.
[ Merge of http://go/wvgerrit/174431 ]

It is possible that the initial license duration was limited due to
the finit rental duration; however, if the license has a soft rental
duration, it will be considered unlimited after playback has begun.

The *.UsageTest* have been updated to ignore cases where initial
license durations are finit, but later report as unlimited.

Bug: 275651559
Test: cdm_extended_duration_test
Change-Id: I689163b1066b2bc9f9345e2279e9373010f844cc
2023-05-05 17:30:13 -07:00
Fred Gylys-Colwell
65d52908af Expect failure on license load for expired LDL license
Merge from Widevine repo of http://go/wvgerrit/170970

RenewOnLicenseLoad.Case2 tests are failing because they
are expecting to load an expired license. However, the spec
says that the license should return KEY_EXPIRED. The test is
being updated.

Some other RenewOnLicenseLoad tests were failing because
they forgot to request the renewal.

Bug: 278750980
Test: Run tests on Luci
Change-Id: I7196db11fcf43859ba9310b87fd8ccb609e47039
2023-05-04 21:18:06 -07:00
Treehugger Robot
651776f475 Merge "Drop prebuilt files to android source tree." into udc-dev 2023-05-03 19:34:04 +00:00
Treehugger Robot
630fbd2251 Merge "Widevine apex cleanup" into udc-dev 2023-05-03 19:34:04 +00:00
Alex Dale
2e84e8b5f7 Merge "Exclude the default CDM from metrics history." into udc-dev 2023-05-03 18:44:06 +00:00
Kyle Zhang
dc9fbae1b4 Widevine apex cleanup
1. Remove prerelease tag.
2. Add TARGET_BUILD_WIDEVINE_USE_PREBUILT to control building from source.
3. Unify config namespace to "widevine".

Bug: 251299786
Bug: 277764729
Change-Id: I2f19bcf8efd280a1a3aa86f595599d79e20b4ff4
2023-05-03 17:38:43 +00:00
Alex Dale
82709ebab0 Merge "DRM Pluging uses CDM core's generic crypto API." into udc-dev 2023-05-03 02:02:45 +00:00
Treehugger Robot
c77b0a6bf2 Merge "Piped CdmEngine's generic crypto operations to Android CDM." into udc-dev 2023-05-03 01:16:23 +00:00
Alex Dale
628d1ac38c DRM Pluging uses CDM core's generic crypto API.
[ Merge of http://go/wvgerrit/173170 ]

This CL updates the Widevine's Android DRM plugin to use the generic
crypto operations provided by CDM core rather than its own
implementation.

Bug: 274984456
Test: atest WvtsDeviceTestCases
Change-Id: I94e1c92c7da577aad5ec43bd3bf0bb380b607b80
2023-05-02 16:51:23 -07:00
Rahul Frias
a4dc63581f Merge "Add error details when offline license is not found" into udc-dev 2023-05-02 23:41:30 +00:00
Kyle Zhang
d3f2693e17 Drop prebuilt files to android source tree.
The following files have been updated as part of this change:

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

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

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

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

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

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

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

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

Built here: ab/10026699

The change is generated with prebuilt drop tool.

Bug: 251299786
Change-Id: I51b971baddaa43156a7aecbc6fc7ba37cf94e72a
2023-05-02 21:28:37 +00:00
Alex Dale
37f125a491 Piped CdmEngine's generic crypto operations to Android CDM.
[ Merge of http://go/wvgerrit/172010 ]

The CdmEngine provides an API for generic crypto operations that are
already used for the CE CDM.  This API is being exposed in the Android
CDM.  The parameter order of the Android CDM is modified to match the
existing generic crypto parameters used in the media DRM plugin.

Bug: 274984456
Bug: 29400687
Test: build x86-64 and Android
Change-Id: I3b286ebb011bd58754b7b8ea814ed46daf1f62f9
2023-05-01 15:50:39 -07:00
Alex Dale
da6437fe5e Exclude the default CDM from metrics history.
[ Merge of http://go/wvgerrit/173410 ]

The DRM plugin opens and closes many CDMs using the default identifier.
These metrics are not needed when checking the metric history and will
no longer be stored.  Default CDM metrics will continue to appear in
the live metrics list.

Bug: 239462891
Bug: 270166158
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Change-Id: I64662a44e9c084cc0f08c5a3f013dbf86374ac2d
2023-05-01 15:37:34 -07:00
Cong Lin
9651c61e25 Fix session id in dynamic adapter and re-generate L3
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/173330

Skipping files that are not in android from the CL above.

Original commit message:

Pass the real oemcrypto session id from `pair.session` instead of
`session`, since `session` can be changed when L1 and L3 are running in parallel and `session` in that case may not be the correct oemcrypto session id any more.

Also adding a few missing v18 L3 functions pointers to the dynamic
adapter.

Need to re-generate L3 since the L3 sources changed.

Test: L3 unit tests
Test: GTS dash policy tests and Dexter tests
Bug: 271290471
Bug: 279967915
Change-Id: Idc44d57ca38eb1de24c0038917800e37c25b9afc
2023-05-01 19:25:27 +00:00
Alex Dale
3e650cfd9f Merge "Allow metrics history to outlive the Android CDM." into udc-dev 2023-04-29 00:17:49 +00:00
Alex Dale
7b32faf9f8 Merge "Include metric history in dumpsys." into udc-dev 2023-04-29 00:15:57 +00:00
Alex Dale
b5a7412675 Merge "Added metrics history for WV CDM for Android." into udc-dev 2023-04-28 23:39:33 +00:00
Rahul Frias
9d1c9ca76a Add error details when offline license is not found
[ Merge of http://go/wvgerrit/171310 ]

Offline license not found errors are identified by CdmResponseEnum
347 (KEYSET_ID_NOT_FOUND_4). No addition file system information
is shared.

Checks for file existance use the stat command. The stat call can
return error codes from errno.h when the command fails.
These are now converted into sub error codes and returned along with
the offline license file not found error.

This also includes a change to log stat errors other than
ENOENT (no such file or directory) as a warning rather than verbose.

Bug: 276225520
Test: file_store_unittest, file_utils_unittest, GtsMediaTestCases
Change-Id: Ic09d036549582cd65783b49fa96ffefc4bf562c7
2023-04-28 02:38:35 -07:00
Alex Dale
4b267e37f9 Allow metrics history to outlive the Android CDM.
[ Merge of http://go/wvgerrit/172910 ]

The lifecycle of the Android CDM is controlled by Android's strong/
weak pointer functionality.  Unfortunately, it does not provide an
easily predictable point in the code where the CDM is to be deleted
along with the saved metrics.  In order to allow the CDM to keep a
list of metrics that are persistent with the life of the service, a
global thread safe queue is provided which is created when the first
CDM is created, but will out live the CDM.

The metrics will still be deleted when the DRM service is terminated.

Bug: 270166158
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Change-Id: Id98676d8b5278798b4de332cc272cd5b85024244
2023-04-27 15:31:39 -07:00
Alex Dale
666e26284f Include metric history in dumpsys.
[ Merge of http://go/wvgerrit/171470 ]

Dumping the DRM plugin metrics will now include any saved instances of
the CDM metrics that may be available.

Bug: 239462891
Bug: 270166158
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Test: atest GtsMediaTestCases
Change-Id: I24d3e0771b50fd20212568a7fd5654691ae51f93
2023-04-27 14:54:17 -07:00
Alex Dale
c42627a23e Added metrics history for WV CDM for Android.
[ Merge of http://go/wvgerrit/171271 ]

There is a need to maintain a short history of metrics from CDMs which
have been deleted.  This CL adds this ability to the Android version
of the WV CDM.  The history cannot yet be maintained for long, as the
WV CDM instance is destroyed if unused.

Further changes are required to the plugin to maintain the history
beyond the life-cycle of the CDM instance, and to properly format
its output.

Bug: 239462891
Bug: 270166158
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Test: atest GtsMediaTestCases
Change-Id: I81c0996602722a9795fc3951030d20bb39b5816b
2023-04-27 14:54:17 -07:00
Kyle Zhang
5409567ef9 Merge "Fix prebuilt apexes" into udc-dev 2023-04-27 21:21:11 +00:00
Kyle Zhang
c01cd91d92 Merge "Create different targets for each Widevine apex" into udc-dev 2023-04-27 21:21:11 +00:00
Cong Lin
5ce29c42da Add BccParser to internal factory upload tool
Add a Bcc parser which prints the public keys in dice chain and a few
other key properties.

Borrowed code from
https://source.corp.google.com/piper///depot/google3/video/widevine/keysmith/provisioning/provisioning40/boot_certificate_chain_parser.cc
and modified locally to build an executable tool.

Sample output from new pixel device:

ROOT DEVICE PUBLIC KEY:
key encoding format: DEVICE_KEY_OCTET_PAIR
key algorithm type: ECDSA_SHA384
curve: P384
public key bytes: 04de874f6067bde6604b2d7a5d51ad28e6335d4524de4314ba6e594e6c95ccefeb17066a0b2f86b16591815c184694d7c54f02549e390e98e9e244e9cd73e616ffd9160371936b7c57e42617a3b497265bc84a0870fae4542e9f35b350383f4ebf

CDI PUBLIC KEY 1:
Issuer: 6a680468c33e5a9a95730632070f76e016f971a9
Subject: 5fbc8ab87c4a23ae660ea38461fea5bbc375a08c
key encoding format: DEVICE_KEY_OCTET_PAIR
key algorithm type: ECDSA_SHA384
curve: P384
public key bytes: 04dfa00e8f96d25400a7824c44a27ba141520629820a7348d48b6fa9b616e6f6793df08288c81985864b07b08fbce4beca3f0297b4b1965be3c26aa493d98ef20f18b2cf2c751ed77b170e04a2a7712f7509b22ac9b504965bd0a963c5947ccc2e

CDI PUBLIC KEY 2:
Issuer: 5fbc8ab87c4a23ae660ea38461fea5bbc375a08c
Subject: 34a2c88d0edfd43663d47357e64280f26ebe5baa
key encoding format: DEVICE_KEY_OCTET_PAIR
key algorithm type: ECDSA_SHA384
curve: P384
public key bytes: 047717658a703114cd4d287162b3d75ff366b0d7dcd330bdab7fe61bcb1d50b2dd897a2ae6e878100839a3a47b966339bbb1220e76af68832035954ba39266563357fae446b734aefdf8b1295db59ac1ee9692841fee0b62b6d32651c817b34116

CDI PUBLIC KEY 3:
Issuer: 34a2c88d0edfd43663d47357e64280f26ebe5baa
Subject: 0b657b3c2448a5e0669953f9d5bdd90b431bbff2
key encoding format: DEVICE_KEY_OCTET_PAIR
key algorithm type: ECDSA_SHA384
curve: P384
public key bytes: 041a11632576b82a1ead43a6744c6601c869dc8cbc519332f588ad79d01754964b595c4f83a7168c0f494715bedefa87cb699df4d41849fe140ab95252e55808908cc02708bc86b4d3a6a0f4dc6c49d138d67a5d3406ae25773ae182972656599c

Test: parse BCC and Dice chain on pixel existing/new devices
Bug: 279688624
Change-Id: Ia77a1d9f8f467992b998549572270da2c56b38b8
2023-04-26 10:20:16 -07:00
Cong Lin
9c42689506 Merge "Factory extraction tool: Use device info from OS property when TEE returns empty" into udc-dev 2023-04-26 02:57:21 +00:00
Kyle Zhang
6fda7dfc49 Merge "Set drm@latest to widevine service NOT apex" into udc-dev 2023-04-25 18:47:14 +00:00
Cong Lin
8c0e7f2ba3 Factory extraction tool: Use device info from OS property when TEE returns empty
Similar change is merged to widevine internal tool: ag/22824076

Some mandatory device info fields like manufacturer can be empty string
when returned from TEE on devices which have not been provisioned with
attestation IDs.

The extraction tool also needs to check for empty string in the
response, and if so, populates the field with Android property values.

Test: extracting device info from new Pixel EVT 1.1 and uploading
Bug: 276958001
Change-Id: I055ee0994d9dbbbf9c0c0875670a449a56a3e29e
2023-04-25 18:23:09 +00:00
Cong Lin
7e3821885b Merge "Use device info from OS property when TEE returns empty" into udc-dev 2023-04-25 18:22:02 +00:00
Alex Dale
d09c640c69 Merge "Fixed WV metrics YAML formating." into udc-dev 2023-04-24 22:04:34 +00:00
Cong Lin
65f50d4662 Use device info from OS property when TEE returns empty
Some mandatory device info fields like manufacturer can be empty string
when returned from TEE on devices which have not been provisioned with
attestation IDs.

The extraction tool also needs to check for empty string in the
response, and if so, populates the field with Android property values.

Test: extracting device info from new Pixel EVT 1.1 and uploading
Bug: 276958001
Change-Id: I6e1b3dee8ffcd991335bc50b59a0c80f030cdc79
2023-04-24 14:14:42 -07:00
Robert Shih
5036a0fc07 dumpsys properties: fix indent & quotation
[ Merge of go/wvgerrit/c/cdm/+/171352 ]

Bug: 239462891
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -p
Change-Id: I0b9ea26a4027b7fbbd277536c0e705885eef408e
2023-04-24 12:54:11 -07:00
Alex Dale
1e1f11f5b1 Fixed WV metrics YAML formating.
[ Merge of http://go/wvgerrit/171270 ]

The metrics dump tool for the Widevine DRM factory was producing
malformed YAML output.  This is compounded by the formatting using
fixed indentation for its output.

Bug: 239462891
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Test: atest GtsMediaTestCases
Change-Id: I784d107085721ad0dabe94bdab33e9cc073f98e4
2023-04-21 13:32:52 -07:00
Robert Shih
a658e076dc Merge "Return apex name for PROPERTY_VENDOR" into udc-dev 2023-04-21 19:37:03 +00:00
Kyle Zhang
e362704180 Create different targets for each Widevine apex
Bug: 277764729
Change-Id: I7c8599ba55ba75b092b14ddb88553735f02cdaa0
2023-04-21 17:05:38 +00:00
Jooyung Han
71781924e8 Fix prebuilt apexes
- Add vendor:true
- Use use_soong_config_var to toggle prebuilt/source_build

Bug: 251299786
Test: SOONG_CONFIG_widevine_module_source_build=false m \
        com.google.android.widevine
Change-Id: If835b443a825dcab1ec09aaa21001602e9b53d20
2023-04-21 17:05:11 +00:00
Cong Lin
5ccb147bb8 Fix spurious wake up in dynamic adapter
The predicate version of wait_for() to avoid spurious wake up by
checking running_ status.

This is a fix to ag/21439870

Test: build widevine
Bug: 272424659
Bug: 271811708
Change-Id: I446fef8f4c8c58bcd47b885dba50643b3e5e1185
2023-04-20 19:16:19 +00:00
Kyle Zhang
555b381e81 Set drm@latest to widevine service NOT apex
Bug: 277761241
Change-Id: I71f8a7e6b6a1c3cce24a8b33e0bb7748bbdd7230
2023-04-20 17:29:54 +00:00
Cong Lin
efd05207c8 Re-generate Android L3 after zero-initializer fix
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/170631

Original fix:

Array intializer "= {0}" may involve compiler specific behaviors which
can cause haystack hang on arm32 target. Fix is to use memset() instead.

Test: debug build verified on arm32 device
Test: Ran GTS media tests on Pixel 7
Bug: 274637461
Change-Id: I02f5df232934e0c78e259c85e4faf313c01c0b6b
2023-04-14 12:38:49 -07:00
Rahul Frias
333fe249e4 Merge "Force a reprovisioning on device renewal" into udc-dev 2023-04-14 05:49:14 +00:00
Robert Shih
d258acb879 Return apex name for PROPERTY_VENDOR
[ Merge of go/wvgerrit/c/cdm/+/170370 ]

Bug: 277620071
Test: WidevineHalTest
Change-Id: I05385358875723e20b13d3abb21a0deee9f35c29
2023-04-12 15:36:38 -07:00
Alex Dale
de779e7545 Moved OEMCryptoResult string converter.
[ Merge of http://go/wvgerrit/170073 ]

Removed the file "error_string_util.cpp" and its header, moving the
OEMCryptoResult to string converter to "wv_cdm_types.cpp".  This extra
file served little purpose, and created a dependency on the CDM utils
to the CDM itself.

This is part of the effort to fix the formatting of WV metrics; making
enum-to-string conversion uniform throughout the CDM.

Bug: 239462891
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Test: Manual testing with Google TV
Change-Id: I4bf95d26b623f5b8fa86bdb2578cbc4ee65125cb
2023-04-11 14:08:30 -07:00
Cong Lin
9c844682a6 Merge "Fix invalid key session id" into udc-dev 2023-04-05 17:41:43 +00:00
Rahul Frias
d31a4dec56 Force a reprovisioning on device renewal
[ Merge of http://go/wvgerrit/169374 ]

Device renewals used to require that OEMs remove provisioning
certificates as part of the OTA update process. Instead, a change
in system ID is relied upon to indicate a change in root of trust.
If a change in System ID is detected, reprovisioning will be forced.

This is not enabled for ATSC devices or L3 devices. For the latter a
change in system ID may occurs without a change in RoT.

Bug: 258361396
Test: GtsMediaTestCases
Change-Id: I6e8b0b2149fc2ed5362a32bb6e869826f5fa8ef7
2023-04-05 08:30:47 -07:00
Cong Lin
1b5bf5a71a Fix invalid key session id
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/169871

The default invalid entitled key session id was 0, which in fact could
be a valid value depending on how the key session id is allocated by the
implementation. This can be a possible cause of L3 entitled key session
failure since L3 can recycle a regular oemcrypto session id 0 and
re-assign it to an entitled key session later.

Bug: 264688931
Test: Run GTS media tests

Change-Id: Iae79d08378d61be8a3402f606992765f24298508
2023-04-05 00:34:40 +00:00
Kyle Zhang
0ab8f029a0 Merge "Drop Widevine CDM v17 prebuilt files" into udc-dev 2023-04-04 20:12:57 +00:00
Alex Dale
6bddc2e43e Merge "Add mutex to CdmEngine for use of usage_session_." into udc-dev 2023-04-03 06:25:56 +00:00