Commit Graph

7072 Commits

Author SHA1 Message Date
Treehugger Robot
3fa190202b Merge "Piped CdmEngine's generic crypto operations to Android CDM." into udc-dev am: c77b0a6bf2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22824317

Change-Id: I285f097a9d4c7dc736635608880ceefe0f899dc8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-03 01:58:59 +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
Rahul Frias
c03e8abf39 Merge "Add error details when offline license is not found" into udc-dev am: a4dc63581f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22808261

Change-Id: Ia5833bd53709ce3121ea77403af57e85ce89f6fc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-03 00:11:00 +00: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
Cong Lin
cdf5ef3879 Fix session id in dynamic adapter and re-generate L3 am: 9651c61e25
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22953666

Change-Id: I2247d525b445c0f1097cd2a8afec814ccac4a814
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-02 01:14:24 +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
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
7c24330ea9 Merge "Allow metrics history to outlive the Android CDM." into udc-dev am: 3e650cfd9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22914977

Change-Id: Ie069f3802cf7e65ed7cb1b39858ad37114f3c25c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-29 00:30:06 +00:00
Alex Dale
e61b02b417 Merge "Include metric history in dumpsys." into udc-dev am: 7b32faf9f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22794477

Change-Id: I1e41ab9e15d3394f6886d292d20d14e42806ccd7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-29 00:29:07 +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
e4593c5836 Merge "Added metrics history for WV CDM for Android." into udc-dev am: b5a7412675
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22794476

Change-Id: Iaac091db712fa3e0069179bb6779407cf4c14967
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-29 00:07:32 +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
Kyle Zhang
0ef103b048 Merge "Fix prebuilt apexes" into udc-dev am: 5409567ef9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22787524

Change-Id: Icadda8c3544429b4a62dd5f2a0bab5e63a7eaccb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-27 22:00:20 +00:00
Kyle Zhang
7d3b62c8f6 Merge "Create different targets for each Widevine apex" into udc-dev am: c01cd91d92
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22604302

Change-Id: Idc1db8960465c991ac6f4d91492191afdd8db70a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-27 22:00:16 +00: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
b69acfb612 Add BccParser to internal factory upload tool am: 5ce29c42da
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22881149

Change-Id: I57759862282c52db3850e8d06486e8bd67bfff9e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-26 23:53:25 +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
7256ccc161 Merge "Factory extraction tool: Use device info from OS property when TEE returns empty" into udc-dev am: 9c42689506
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22816864

Change-Id: Iffe39839c4b5c43e680e6e1ad01fc7276cc7a516
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-26 03:28:46 +00: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
a15cf030ea Merge "Set drm@latest to widevine service NOT apex" into udc-dev am: 6fda7dfc49
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22655798

Change-Id: Ib2d13d10599f4d831ed9c6c88d6597dc1de2ee0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 19:01:45 +00:00
Cong Lin
c252d79287 Merge "Use device info from OS property when TEE returns empty" into udc-dev am: 7e3821885b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22824076

Change-Id: Ief9d17bbe725fe43f76dac3da4e36b409dfbcd62
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 19:00:46 +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
fa1bc9116d Merge "Fixed WV metrics YAML formating." into udc-dev am: d09c640c69
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22792935

Change-Id: Iff760bd5be57ecea2d9e2a5ca347e0b3430ff1d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-24 22:47:39 +00:00
Robert Shih
13077f55fb dumpsys properties: fix indent & quotation am: 5036a0fc07
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22822564

Change-Id: Id25f8e04e88f9df0a69ca03d6e1b332f0be34b89
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-24 22:47:19 +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
Robert Shih
ff346a7bea Merge "Return apex name for PROPERTY_VENDOR" into udc-dev am: a658e076dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22606352

Change-Id: Idad157296d2853f2a8e1cc9bff36ae425c406559
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-21 20:59:52 +00: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
6f9245c7ff Fix spurious wake up in dynamic adapter am: 5ccb147bb8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22686796

Change-Id: I13739218a8050fa2ec04ec52848e9dd96e712fd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-20 22:27:02 +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
7a70e1baf6 Re-generate Android L3 after zero-initializer fix am: efd05207c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22653062

Change-Id: I0628f545d8150cac036d17b63c4beacc08a147ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-17 18:15:20 +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
dbf42e9492 Merge "Force a reprovisioning on device renewal" into udc-dev am: 333fe249e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22360386

Change-Id: I264e34cc935d8df45f19c06aa349a88c00b7e4d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-14 06:10:51 +00: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
e168e35355 Moved OEMCryptoResult string converter. am: de779e7545
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22520102

Change-Id: I012477d1bc83989bb558ddf41efc0d52da7afa08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 02:27:01 +00: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