Commit Graph

1695 Commits

Author SHA1 Message Date
Treehugger Robot
170b2bcc93 Merge "Revert CDM changes from oemcrypto 18.4" into udc-widevine-dev 2024-03-25 05:50:59 +00:00
Alex Dale
bb71b1261e Reset crypto session pointers on RemoveKeys.
[ Merge of http://go/wvgerrit/189650 ]

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: WVTS on Oriole
Bug: 311239278
Change-Id: Ie175513ae652dcd96e12e5e1def574a8a56d5863
2024-03-18 16:24:47 -07:00
Vicky Min
7fd4541eab 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-13 18:51:44 +00:00
Rahul Frias
8e0a3f5600 Revert CDM changes from oemcrypto 18.4
[ Merge of TBD ]

The merge of oemcrypto-v18 cdm branch to udc-widevine-dev
caused a number of CDM/plugin fixes to be lost.

This undoes the non-oemcrypto changes in http://go/ag/26105061

Bug: 290252845
Test: WVTS, unittests on panther
Change-Id: I2bb99f423bda351eee30276cb0e26e3d9e27fa7d
2024-02-16 14:38:05 -08:00
Vicky Min
4129b3ac9f Cherry pick 18.4 changes to udc-widevine-dev
Get the udc-widevine-dev Android branch and oemcrypto-v18 cdm branch in
sync. The commit ID for 18.4 on oemcrypto-v18 is
https://widevine-internal.git.corp.google.com/cdm/+/a2f23a2281e5e06dc2867585bdc516fa132b639.

Merged from go/wvgerrit/190151

Bug: 290252845
Test: unit tests passing on Panther device
Change-Id: I63fa3f1c784f737ca1480e5febe4f3f5a8a49948
2024-02-05 18:08:40 +00:00
Kensuke Miyagi
540c8dfd50 Revert "Cherry pick 18.4 changes to udc-widevine-dev"
This reverts commit 7186433edf.

Reason for revert: Build breakage - b/323194350

Change-Id: Ibba4f5289b8f0d5e835dfba9ceb1e601784af634
2024-01-31 18:13:05 +00:00
Vicky Min
7186433edf Cherry pick 18.4 changes to udc-widevine-dev
Get the udc-widevine-dev Android branch and oemcrypto-v18 cdm branch in
sync. The commit ID for 18.4 on oemcrypto-v18 is
a2f23a2281e5e06dc2867585bdc516fa132b6396.

Merged from go/wvgerrit/190151

Bug: 290252845
Test: WVTS tests are running and passing
Change-Id: I457332e7ca70a5b5169345e1279b3eb9f18413b6
2024-01-29 18:18:50 +00:00
Rahul Frias
63ff6596b6 Offline playback failure for ATSC 3.0
[ Merge of http://go/wvgerrit/148949 ]

For ATSC licenses use ATSC certificates/private keys rather than
any cert/private key specified in the license.

Bug: 216420542
Test: WV unit/integration tests
Change-Id: I12541577e672c67cc4c6eb3365e48bf2034fd9a4
2024-01-16 14:37:47 -08:00
Robert Shih
8b52f39a58 Embed build number in non-apex build
Bug: 316978205
Test: m android.hardware.drm-service.widevine
Change-Id: Ibf77a0135fa832424f38619bdd2df0ccc53f5849
2024-01-16 06:09:26 +00:00
Kyle Zhang
c1ba10fd16 Do not fall back to L3 if L1 has test keybox
[ Merged of go/wvgerrit/186370 ]

CDM by default allows test keybox from device side.

Bug: 299987160
Bug: 301669353
Change-Id: I06f1936ccd068eb71364a5a8931970954233b686
2023-11-08 01:04:06 +00:00
Treehugger Robot
df7846a20f Merge "Correct stability issues for SPOIDs for provisioning 4.0" into udc-qpr-dev am: 05f045d802
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/24537206

Change-Id: I9bf72cd82f4c8821344ec1134c22d105b76f6cbe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 21:17:31 +00:00
Treehugger Robot
05f045d802 Merge "Correct stability issues for SPOIDs for provisioning 4.0" into udc-qpr-dev 2023-09-20 20:15:28 +00:00
Rahul Frias
2f83cd0e49 Correct stability issues for SPOIDs for provisioning 4.0
[ Merge of http://go/wvgerrit/183472 ]

For provisioning 4.0 devices, the DRM certificate serial number
was changing on a reprovisioning attempt or factory reset. The
app parameters sent up in the client identification name-value
pair field were being filtered out in provisioning requests.
This has been corrected for provisioning 4.0 stage 2
(DRM certificate request). There is no need to include them for
stage 1 (OEM certificate request).

The test case WvCdmRequestLicenseTest.ProvisioningSpoidTest
was created earlier to ensure that SPOIDs and DRM certificates are
stable. Unfortunately due to another bug b/250099615, the RKP service
was holding a connection to the Widevine TA for provisioning 4.0
devices. When native tests ran as their own process, L1 would fail
to load due to a connection failure and the test would run as L3.
The tests passed for provisioning 4.0 devices Pixel 7 and 8 when
they should have failed. This gave us a false sense of confidence
that the SPOIDs were stable.

For now a workaround is to run a shell command to kill the widevine
TA before running native tests.

$ adb shell pkill -f -9 widevine

New tests have been introduced to provide integration coverage
WVPluginTest at the WV plugin level and CoreIntegrationTest
for core. GTS tests are also being written in b/295538002.

Bug: 294451432
Bug: 293950895
Test: WVPluginTest.ProvisioningStableSpoidTestL1, WVTS tests
Change-Id: Ib9ace4387866ea38bb1840feb69cea78d2d2c09c
2023-09-19 09:39:13 -07:00
Treehugger Robot
fdf0ed469d Merge "Filter keybox tests with GTEST_SKIP" into udc-widevine-dev 2023-09-01 18:03:53 +00:00
Vicky Min
fe0ddc8098 Filter keybox tests with GTEST_SKIP
(merged from go/wvgerrit/183630)

Bug: 288404945, 251240681
Test: keybox tests
Change-Id: I38ed2ba54c9f756693902fd7d0044d4e42bbc2fd
2023-09-01 17:01:52 +00:00
Robert Shih
9eb8c78150 Update Widevine apex min_sdk_version to 34 am: d81cdbae42
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/24326594

Change-Id: I37776a31e1c4317399607e43c859f19360f1eb89
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-30 20:13:52 +00:00
Robert Shih
d81cdbae42 Update Widevine apex min_sdk_version to 34
Bug: 287567070
Bug: 294568360
Test: v2/widevine-eng/drm_compliance_apex
Change-Id: Iad45bf7a66ff0217724376aa8648ecd613af32c1
2023-08-28 12:30:36 -07:00
Alex Dale
310c028965 Merge "Close session during capacity check." into udc-qpr-dev 2023-08-07 22:32:28 +00:00
Alex Dale
75d3ade093 Close session during capacity check.
[ Merge of http://go/wvgerrit/181151 ]
[ Cherry-pick of http://ag/24103737 ]

For devices with a large number of usage entries, when restoring the
usage table a capacity check is performed.  This checks that a new
entry can be created.  This test was originally added as some devices
might enter a "stuck" state the table cannot be initialized.

To perform this test, a temporary crypto session is created and an
entry is created for that session.  After successfully creating that
entry, the entry is deleted.  However, because the session was left
open, the entry could not be deleted.

This change closes the capacity-check-session before deleting the
entry, as well as includes additional logs for helping future debugs.

Bug: 286176947
Bug: 291351287
Test: usage_table_header_unittest
Test: Android GTS R11 on oriole
Change-Id: I6923de00175f70b2392bfe581ca5f9ae60c4af25
(cherry picked from commit 8b4bbeeb6f440c48a3250b961f7a7dab2472d7e9)
(cherry picked from commit bb925c46e5)
2023-08-07 20:50:18 +00:00
Alex Dale
3ea91f35dd Add HDCP cap logging on HDCP-based failures.
[ Merge of http://go/wvgerrit/181152 ]
[ Cherry-pick of http://ag/24137228 ]

Partners have requested that we log HDCP information during certain
operation:
1) Current and max HDCP capability when calls to decrypt or select
   key failure due to insufficient or mixed HDCP levels.
2) Current, desired and default HDCP level when video contraints
   are not met.

To avoid spamming the logs, decrypt failures are only logged on their
first occurrence, and unmet video constrains when one of the
requirements change.

Bug: 276686656
Bug: 292005982
Test: license_keys_unittest
Test: Android WVTS on oriole
Change-Id: I98b18e66d7ce1c474a018ae83af4f1c0b03308df
(cherry picked from commit c84b9afd38)
2023-08-05 09:21:50 +00:00
Vicky Min
bc20b9dac9 Cherry pick cdm udc-widevine-release changes to udc-widevine-dev to be in sync with 18.3 release
Merged from go/wvgerrit/178231

Bug: 290252845
Test: WVTS tests seem to be running and passing
Change-Id: Ifff9123a73e173e835a6e89ba7c2760e1cd500fd
(cherry picked from commit 6889845d2e7e24f22c00b333335c34259b3fc96e)
2023-07-25 20:14:41 +00:00
Alex Dale
42a5f26c5a Merge "Add HDCP cap logging on HDCP-based failures." into udc-widevine-dev 2023-07-25 18:12:02 +00:00
Rahul Frias
0a8acd713e Sony Patch to LicenseKeys::GetAllowedUsage()
[ Merged from http://go/wvgerrit/179214 ]

Sony has identified a 5-year-old copy-and-paste error in
LicenseKeys::GetAllowedUsage(). For entitled keys, it was calling
CanDecryptContent() instead of GetAllowedUsage() on the entitlement key
session. This meant that for entitled keys, the allowed_usage parameter
was never updated and the return value of the function was indicating
something different than intended.

Bug: 280902715
Test: build_and_run_all_unit_tests
Test: wvts on panther
Change-Id: Ic1db01b6dce08d444572f53157ff08b337c48d31
2023-07-25 17:55:57 +00:00
Cong Lin
c785d6f02f Merge "WVDrmPlugin changes to query device CSR payload for prov 4" into udc-widevine-dev 2023-07-21 06:23:26 +00:00
Cong Lin
51bcf4ba12 Merge "Cdm to expose GetDeviceInformation() and GetDeviceSignedCsrPayload()" into udc-widevine-dev 2023-07-21 06:23:13 +00:00
Cong Lin
7318ab2ee0 WVDrmPlugin changes to query device CSR payload for prov 4
[ Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/178891/ ]

Plugin to provide getPropertyByteArray("deviceSignedCsrPayload")
which returns the signed CSR payload for device registration. It
queries both BCC and device info to be set in plugin before calling this
getPropertyByteArray("deviceSignedCsrPayload") method. The returned csr
payload will be used by assemble the device CSR by the caller for device
registration.

Bug: 286556950
Test: build WV DRM plugin
Change-Id: Ie592f53497f6d391ff232fd02bd4e66ca857e0e4
2023-07-20 22:54:55 +00:00
Cong Lin
bb522c70a3 Cdm to expose GetDeviceInformation() and GetDeviceSignedCsrPayload()
[ Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/178890/ ]

GetDeviceInformation() and GetDeviceSignedCsrPayload() are added to
cdm_engine and crypto_session, so that they can be queried by DRM
plugin. This is to allow the wv drm HAL to be able to extract BCC and
CSR payload to build CSR for prov 4 device registration, such that we
don't need a separate RKP HAL to do this job.

Changes to the DRM plugin to use the exposed methods will be in the
coming CL.

Bug: 286556950
Test: request_license_test
Change-Id: I5f7aed8b3471ea477b79d08b95e1d217dc39070b
2023-07-20 22:52:06 +00:00
Alex Dale
c84b9afd38 Add HDCP cap logging on HDCP-based failures.
[ Merge of http://go/wvgerrit/178872 ]
[ Cherry-pick of http://ag/24047535 ]

Partners have requested that we log HDCP information during certain
operation:
1) Current and max HDCP capability when calls to decrypt or select
   key failure due to insufficient or mixed HDCP levels.
2) Current, desired and default HDCP level when video contraints
   are not met.

To avoid spamming the logs, decrypt failures are only logged on their
first occurrence, and unmet video constrains when one of the
requirements change.

Bug: 276686656
Test: license_keys_unittest
Test: Android WVTS on oriole
Change-Id: I98b18e66d7ce1c474a018ae83af4f1c0b03308df
2023-07-19 23:34:46 +00:00
Alex Dale
bb925c46e5 Close session during capacity check.
[ Merge of http://go/wvgerrit/178217 ]
[ Cherry-pick of http://ag/24029327 ]

For devices with a large number of usage entries, when restoring the
usage table a capacity check is performed.  This checks that a new
entry can be created.  This test was originally added as some devices
might enter a "stuck" state the table cannot be initialized.

To perform this test, a temporary crypto session is created and an
entry is created for that session.  After successfully creating that
entry, the entry is deleted.  However, because the session was left
open, the entry could not be deleted.

This change closes the capacity-check-session before deleting the
entry, as well as includes additional logs for helping future debugs.

Bug: 286176947
Test: usage_table_header_unittest
Test: Android GTS R11 on oriole
Change-Id: I6923de00175f70b2392bfe581ca5f9ae60c4af25
(cherry picked from commit 8b4bbeeb6f440c48a3250b961f7a7dab2472d7e9)
2023-07-17 21:12:25 +00:00
Kyle Zhang
14f7594f5e Add Cdm support for Cast provision 4.0 flow
[ Merge of http://go/wvgerrit/178135 ]

Bug: 259455235
Test: CorePIGTest.CastReceiverProvisioning*
Test: com.google.android.wvts
Change-Id: I8d546a73a64a71a4d61225d9c6d14d893decce22
(cherry picked from commit 494da3dddf0f47e516e6fc1a73e19b091e6c2abd)
2023-07-14 20:02:01 +00:00
Kyle Zhang
b0c3e69962 Revise cdm signing api and test
[ Merge of http://go/wvgerrit/178131 ]

Bug: 279671867
Bug: 279672538
Test: com.google.android.wvts
Change-Id: If2e2c6d250c0379c217b3f9b21efb197c9ae4fd6
(cherry picked from commit 1e05d16ddeaeff5de994e30aa713cd74bed21400)
2023-07-14 20:00:56 +00:00
Kyle Zhang
bd389027a1 Exposing the Cast Signing Algorithm
[ Merge of http://go/wvgerrit/178076 ]

1. Exposing the Cast Signing Algorithm in cdm core.
2. Update core Cast tests to use new core CDM Cast signing API.

Bug: 279671867
Bug: 279672538
Test: com.google.android.wvts
Change-Id: Ia73c4b5e6dd61edf790bca97a321881d310e7a99
(cherry picked from commit 8996b624d73adf14db45e54653e7ddc513f3895c)
2023-07-14 20:00:23 +00:00
Vicky Min
74a9f80790 Fix oec session id in dynamic adpater
[ Merge of http://go/wvgerrit/175310 ]

Pass the real oemcrypto session id from `pair.session` instead of
`session` for LoadEntitledContentKeys, 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, 282180589
Test: wvts
Change-Id: I127ff37abf8b618dfbcb623f59bc999e58e7a028
2023-05-15 18:40:21 +00:00
Rahul Frias
75c1b88603 Merge changes I5cbfcc73,I3070b3f3 into udc-dev
* changes:
  Indicate support for initial_renewal_delay_base
  Fixes for renew on license load
2023-05-13 04:08:22 +00:00
Rahul Frias
0c288c1cda Indicate support for initial_renewal_delay_base
[ Merge of http://go/wvgerrit/174555 ]

This is only announced if OEMCrypto is v18+

Bug: 278751387
Test: Duration use case tests, wvts tests
Change-Id: I5cbfcc733ed2af2c940fde381b40a5be850e7e88
2023-05-12 15:05:44 -07:00
Rahul Frias
669fc9c7af Fixes for renew on license load
[ Merge of http://go/wvgerrit/173290 ]

* Renew timer offset from when license is loaded verifies that the
  rental duration has not expired and begins decryption.
* Renew timer offset from first decrypt bugfix
* Feature is enabled based on oemcrypto v18 presence
* Renewal logic verifies that |can_renew| is enabled
* Unit tests were added to reflect use cases from duration
  and renewal documentation

Bug: 278751387
Test: policy unittests, CdmUseCase tests, wvts tests
Change-Id: I3070b3f31b316e150c28ebe38d0440ab1eeb89b9
2023-05-12 15:02:32 -07:00
Vicky Min
5026c50ebc Fix oec session id in dynamic adpater
[ Merge of http://go/wvgerrit/175058 ]

Pass the real oemcrypto session id from `pair.session` instead of
`session` for LoadEntitledContentKeys, 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, 282180589
Test: wvts
Change-Id: Iad0ac5e505d3b38d220f1484d4cf5f8bc3b5337f
2023-05-12 21:17:58 +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
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
Alex Dale
2e84e8b5f7 Merge "Exclude the default CDM from metrics history." into udc-dev 2023-05-03 18:44:06 +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