Commit Graph

3177 Commits

Author SHA1 Message Date
Rahul Frias
13368f4076 Merge changes Ied664ce8,I90004025 into udc-dev
* changes:
  Test refactoring to support load on renewal tests
  Fix formatting of renew on license load integration tests
2023-05-12 15:08:16 +00:00
Jooyung Han
d13f8124ff Merge "Add build script for widevine apkset." into udc-dev 2023-05-12 08:14:22 +00:00
Rahul Frias
d50b9031c9 Test refactoring to support load on renewal tests
[ Merge of http://go/wvgerrit/174470 ]

There are two sets of changes
* Mocking CryptoSession so that OEMCrypto API version can be queried
* Creating a PolicyEngineTestV16 so that API version expectations
  can be set and V18 can be accommodated.

Bug: 278751387
Test: policy_engine_unittest
Change-Id: Ied664ce87e22f697b6a45d3c573e22273e65e37f
2023-05-11 16:16:20 -07:00
Rahul Frias
f0e546d703 Fix formatting of renew on license load integration tests
[ Merge of http://go/wvgerrit/174270 ]

Bug: 240995342
Test: Duration use case tests
Change-Id: I900040256b4accf2b695a6da0827033eadb4f2e4
2023-05-11 01:52:08 -07:00
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
Alex Dale
ed81ae2b11 Remove duplicate session ID in metrics dump.
[ Merge of http://go/wvgerrit/174932 ]

Bug: 281794097
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Change-Id: Id29e1c4298ed5b86453f22012cfccc2cb5ee7d05
2023-05-10 16:20:45 -07:00
Kyle Zhang
1a42aed25b Merge changes Icd280b53,I6eed117e into udc-dev
* changes:
  Cast Receiver integration test
  Combine provisioning code for tests and improve logging
2023-05-10 18:40:30 +00:00
Fred Gylys-Colwell
d211195f92 Cast Receiver integration test
Merge from Widevine repo of http://go/wvgerrit/169471

Remove the test in android tests and add it to the
core tests.

Bug: 276464340
Test: GTEST_FILTER="CorePIGTest.CastReceiverProvisioning*" jenkins/run_fake_l1_tests
Change-Id: Icd280b532ddae274f66b2fab3e65520e96adb7cb
2023-05-10 18:40:21 +00:00
Fred Gylys-Colwell
836b1a30a6 Combine provisioning code for tests and improve logging
Merge from Widevine repo of http://go/wvgerrit/169018

This CL adds a provisioning holder that attempts to
provision and logs the request and response for
failures. The server team can replay the request to debug
problems on their end.

Bug: 276464340
Test: ran cast and ota tests
Change-Id: I6eed117e504ae3287f2ba16c3c507cfdc7456f8d
2023-05-10 18:38:50 +00:00
Rahul Frias
09d7572ece Fix oec session id in dynamic adpater
[ Merge of http://go/wvgerrit/174572 ]

Pass the real oemcrypto session id from `pair.session` instead of
`session` for CopyBuffer, 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.

Bug: 279967915
Test: wvts
Change-Id: Ic5e21ccb227d4c4992ef500435fa3b68812c4d9b
2023-05-08 23:21:47 -07: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