Commit Graph

6208 Commits

Author SHA1 Message Date
Edwin
9586d34201 Add libwvdrmdrmplugin_hal_test for AIDL service am: 5202862e9a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17831572

Change-Id: Idc534a847bf4d3a592fc0217178b8e1740e9ab21
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:55:27 +00:00
Edwin
5202862e9a Add libwvdrmdrmplugin_hal_test for AIDL service
[ Merged from http://go/wvgerrit/150769 ]

- remove OpenSessions_1_1, only applies to hidl
- move plugin and mCdm creation in SetUp() test fixture
- reset plugin and mCdm smart pointers in TearDown
- reduce code duplication
- remove MockDrmPluginListener, send*Event has gone private

Test: m libwvdrmdrmplugin_hal_test -j128
Test: m libwvdrmdrmplugin_hal_test WV_UNITTESTS_BUILD_TARGET=hidl -j128
Test: adb push $(OUT)/data/nativetest/libwvdrmdrmplugin_hal_test /data/nativetest/.
Test: adb shell LD_LIBRARY_PATH=/vendor/lib64 /data/nativetest/libwvdrmdrmplugin_hal_test

Bug: 217247987
Change-Id: I8bc0a390a88facbc890cf26872fd089afe87850a
2022-05-11 05:36:40 +00:00
Robert Shih
63ad411c0e Merge "wv_factory_extraction_tool: extract provision 4.0 csr" into tm-d1-dev 2022-05-11 00:10:36 +00:00
Edwin Wong
2054705413 Merge "Add libwvdrmmediacrypto_hal_test for AIDL service." into tm-dev am: f8146ee716
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18140898

Change-Id: I836dd3e5a995d261133c73e99137078827d0f680
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 23:25:36 +00:00
Edwin Wong
f8146ee716 Merge "Add libwvdrmmediacrypto_hal_test for AIDL service." into tm-dev 2022-05-10 23:12:05 +00:00
Alex Dale
867954b412 Added CDM support for production readiness reporting. am: cd5afa88a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18195696

Change-Id: I21f1bf89e4b9821f5b01ced5530a45763543947f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 21:40:38 +00:00
Alex Dale
cd5afa88a6 Added CDM support for production readiness reporting.
[ Merge of http://go/wvgerrit/151518 ]

Extended the CDM layer to report OEMCrypto's production readiness
via string property query.

If OEMCrypto implementents OEMCrypto_ProductionReady(), then the
reported readiness by the CDM will report "True" or "False".

If OEMCrypto does not implement OEMCrypto_ProductionReady() then no
level of readiness is assumed, and the CDM will report "Unknown".

Bug: 231655151
Test: run_prov30_tests and request_license_test
Change-Id: I6afe481ef00ac129d02b004eca89a65810bfbff8
2022-05-10 13:35:43 -07:00
TreeHugger Robot
57ea6e5985 Merge "Update TestMaxDRMKeys to use 2048 bit keys only" into tm-dev am: c4a2a08ee6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18132819

Change-Id: I3e6086f2081d3a1a19a3cf9f9582012b3de8d094
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 14:25:18 +00:00
TreeHugger Robot
699e4255b9 Merge "Restrict CAS unit tests to devices that support CAS" into tm-dev am: 6e4cf1f1a9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18128971

Change-Id: Iad7c2038d6045ebfa1a49c9a5517e865caa86da7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 14:21:48 +00:00
TreeHugger Robot
c4a2a08ee6 Merge "Update TestMaxDRMKeys to use 2048 bit keys only" into tm-dev 2022-05-09 09:34:58 +00:00
TreeHugger Robot
6e4cf1f1a9 Merge "Restrict CAS unit tests to devices that support CAS" into tm-dev 2022-05-09 09:34:55 +00:00
Rahul Frias
bece59a04c Merge "Check L3 for secure stops" into tm-dev am: f4e2e9833d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18192750

Change-Id: I15d2b1d134cdd8f6823d001d060c7b2d7247e8a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 22:27:28 +00:00
Rahul Frias
bacd3dd9d3 Merge "Update version change canary test" into tm-dev am: e26370f0b6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18194076

Change-Id: I8a63cdbe0f3357588f2ad6dc7793a7895b7bc4c1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 22:27:09 +00:00
Rahul Frias
f4e2e9833d Merge "Check L3 for secure stops" into tm-dev 2022-05-06 22:08:52 +00:00
Rahul Frias
e26370f0b6 Merge "Update version change canary test" into tm-dev 2022-05-06 22:06:05 +00:00
Edwin Wong
19407fdc10 Add libwvdrmmediacrypto_hal_test for AIDL service.
[ Merge from http://go/wvgerrit/151349 ]

- move plugin and mCdm creation in SetUp() test fixture
- replace StrictMock<MockCD<> with NiceMock; otherwise,
  "uninteresting mock for isOpenSession" will return fail by default
- replace .WillOnce() for isOpenSession() with .WillRepeatedly

Test: m libwvdrmmediacrypto_hal_test -j128
Test: m libwvdrmmediacrypto_hal_test  WV_UNITTESTS_BUILD_TARGET=hidl -j128
Test: adb push $(OUT)/data/nativetest/libwvdrmmediacrypto_hal_test  /data/nativetest/.
Test: adb shell  LD_LIBRARY_PATH=/vendor/lib64
/data/nativetest/libwvdrmmediacrypto_hal_test

Bug: 217247987
Change-Id: I8d7189473d52738645c73c6665f4f3f6a13042f0
2022-05-06 18:21:57 +00:00
Robert Shih
05878ffbe1 wv_factory_extraction_tool: extract provision 4.0 csr
Bug: 231677822
Test: adb shell wv_factory_extraction_tool csr
Change-Id: I9f21514b027261f1d69c24a4d2f54051ccaac9a5
2022-05-06 01:40:11 -07:00
Rahul Frias
13daf6d3ed Check L3 for secure stops
[ Merge of http://go/wvgerrit/151512 ]

Parameterizing GtsMediaDrm tests exposed a few issues. If secure stops
were stored at L3 security level, retrieval would fail. This CL
checks L3 if the secure stop was not found at the default security
level.

Bug: 221249079
Test: GtsMediaTestCases
Change-Id: Ie88197f8e29457981d782199a76d38774f6faa67
2022-05-06 01:39:24 +00:00
Rahul Frias
81e5fc3dc4 Update version change canary test
[ Merge of http://go/wvgerrit/151571 ]

The android OS version has been updated to 13. Updating WV tests as well.
CDM version has been updated previously, so no additional changes are needed.

Bug: 231646284
Test: WV unit/integration tests
Change-Id: Ifaf2fe1f04627654725b1b221d8c3dc30029ac6c
2022-05-05 18:29:25 -07:00
Alex Dale
541f6a38c2 Merge "Resize OEMCrypto buffer-based results on success." into tm-dev am: f980049ef0
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18126088

Change-Id: I624bf91717b136353c03f6e628021a3eaa3ac91d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 21:11:49 +00:00
Alex Dale
f980049ef0 Merge "Resize OEMCrypto buffer-based results on success." into tm-dev 2022-05-05 20:38:05 +00:00
Edwin Wong
e72d16e49f Merge "Only use libbinder_ndk for aidl service." into tm-dev am: f607802265
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18092491

Change-Id: I8de18718e7dffdabc660223bf61b44f2780e62ce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 18:23:20 +00:00
Edwin Wong
f607802265 Merge "Only use libbinder_ndk for aidl service." into tm-dev 2022-05-05 17:53:05 +00:00
Cong Lin
c23c689c0a Merge "Include SPOID in provisioning 4 request" into tm-dev am: e06c526d3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18014492

Change-Id: Iab06782791e7761188a04970ece4fb5da155990e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 15:18:45 +00:00
Edwin Wong
af5f57a46c Only use libbinder_ndk for aidl service.
[ Merged from http://go/wvgerrit/151169 ]

Test: Netflix and Google TV streaming and downloaded playback
Test: unit tests
Test: atest VtsAidlHalDrmTargetTest
Test: adb shell readelf -d /vendor/bin/hw/android.hardware.drm-service.widevine
Test: adb shell readelf -d /vendor/lib64/libwvaidl.so

Bug: 230791937
Change-Id: Ia60d9fc838bf228b40d99b076a837ae789fa2d03
2022-05-05 15:12:55 +00:00
Cong Lin
e06c526d3b Merge "Include SPOID in provisioning 4 request" into tm-dev 2022-05-05 14:56:01 +00:00
Alex Dale
1069ae39cc Resize OEMCrypto buffer-based results on success.
[ Merge of http://go/wvgerrit/151191 ]

Within the CDM and OEMCrypto tests, there were a few OEMCrypto function
calls where the final size of the output buffers were not being
resized.  For several of these functions, an initial call is made with
zero-length output buffers, expecting OEMCrypto to return
ERROR_SHORT_BUFFER; followed by a call with buffers at least as large
as specified by OEMCrypto.  However, for some operations, OEMCrypto
makes an estimate on the final size on the first call, specifying the
exact size only after performing the operations.

This is the case for the wrapped key returned by
OEMCrypto_LoadProvisioning().  The provisioning response contains a
padded + encrypted DRM key.  OEMCrypto does not know the actual size
of the key until decrypted, and the actual DRM key might be smaller.

There was a OEMCrypto test for OEMCrypto_BuildInformation() which
was enforcing the wrong behaviour.  This has been updated.

Bug: 230661565
Test: oemcrypto_test
Change-Id: Iad297d56ffbb085894641fdf8698ce5fd18edbf2
2022-05-04 21:32:08 -07:00
Vicky Min
ad7a07b234 Fix TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths() am: 1563fb2a27
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18151647

Change-Id: I8632a274c3ca239b4342a639d3566214a54dd689
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 15:10:57 +00:00
Vicky Min
1563fb2a27 Fix TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths()
In TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths(),
LoadResponse() should be called after EncryptAndSignResponse() so this
is moved in this CL.

Bug: 231368221
Test: OEMCryptoMemoryLoadLicense tests
Change-Id: I7a0224afb21c3ab1d896ce3cfb64e1ad544a581a
2022-05-03 23:36:05 +00:00
Fred Gylys-Colwell
2899924d42 Update TestMaxDRMKeys to use 2048 bit keys only
Merge from Widevine repo of http://go/wvgerrit/151254

Test: Ran tests on reference oemcrypto
Bug: 228996670
Change-Id: I6ea69bad49fa2d4272fc8bb02895c17f314c7f49
2022-05-02 17:36:36 -07:00
Fred Gylys-Colwell
0d6fbb2d0e Restrict CAS unit tests to devices that support CAS
Merge from Widevine repo of http://go/wvgerrit/151253

This updates the OEMCrypto unit test filters to remove
CasOnly tests if the device does not implement the cas
function OEMCrypto_LoadCasECMKeys.

Test: unit tests on Luci
Bug: 221256887
Change-Id: I7026c4318153ada1d85055704e87b2cef397ffca
2022-05-02 15:41:52 -07:00
Lu Chen
534589fd2e Include SPOID in provisioning 4 request
Merged from https://widevine-internal-review.googlesource.com/148554

This change was merged to master but missed in tm-dev when we stopped
the auto merging to tm-dev. Manually cherry picked it.

Test: ran OPK unit tests
Bug: 230820162
Bug: 180530495

Change-Id: Ib23f07f84096650beb4dd1950105db01e004d484
2022-04-29 21:36:51 -07:00
TreeHugger Robot
addc7921ce Merge "Added mutex for reserved_license_ids_." into tm-dev am: da1e3c5de2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17919183

Change-Id: Ie9cdc9f0ea3e2ee6582f537f980bf55e94a10d8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 19:56:05 +00:00
TreeHugger Robot
da1e3c5de2 Merge "Added mutex for reserved_license_ids_." into tm-dev 2022-04-29 19:36:30 +00:00
John Bruce
22d2ba8bf1 Merge "First-stage Provisioning 4.0 client ID encryption" into tm-dev am: 7d78ce9ac8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17949160

Change-Id: I20a06b97e6cd2a97b688c744a73981fbe4c98700
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:05:10 +00:00
Alex Dale
e4cb3e49b1 Merge "Specify DRM certificate duration in tests." into tm-dev am: 38b639f920
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17779678

Change-Id: Ib0903a3afd461b8d053a5bbcc10533bd74f1f22a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:02:27 +00:00
John Bruce
7d78ce9ac8 Merge "First-stage Provisioning 4.0 client ID encryption" into tm-dev 2022-04-29 17:38:39 +00:00
Alex Dale
38b639f920 Merge "Specify DRM certificate duration in tests." into tm-dev 2022-04-29 17:34:59 +00:00
Robert Shih
470f49f87c Merge "WVCdm: no destroy global log buffer on exit" into tm-dev am: 5c38b38514
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17570520

Change-Id: I57a2da0c868d7e26c655115a4f6bd08197d32d86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 21:44:57 +00:00
Robert Shih
fbec9a1c8b Merge "Widevine PRODUCT_PACKAGES makefiles" into tm-dev am: 3b44c810d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17133103

Change-Id: I8591e0f7fac5a499165ae45634d2989d54bdc06e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 21:44:32 +00:00
Robert Shih
5c38b38514 Merge "WVCdm: no destroy global log buffer on exit" into tm-dev 2022-04-27 21:23:53 +00:00
Robert Shih
3b44c810d6 Merge "Widevine PRODUCT_PACKAGES makefiles" into tm-dev 2022-04-27 21:23:47 +00:00
Robert Shih
5a1d5e8837 WVCdm: no destroy global log buffer on exit
[ Merge of go/wvgerrit/149989 ]

Bug: 227848537
Change-Id: I9407b133654c20ddcd3c15404dd19b3719064e6e
Test: Irdeto monkey test
2022-04-26 16:57:13 +00:00
John "Juce" Bruce
c823a85e7d First-stage Provisioning 4.0 client ID encryption
(This is a merge of http://go/wvgerrit/150131 to the Android repo.)

This patch changes the code path in the CDM so that the first-stage
provisioning request for Provisioning 4.0 is always encrypted with the
Widevine service certificate instead of the client-set service
certificate, reflecting that the first-stage provisioning is always
handled by Widevine.

This patch also makes several methods on the ServiceCertificate class
const. This has no impact on their behavior.

Bug: 221443151
Test: prov40 tests
Change-Id: Ide4c3927afadcd45ae7fb629b99e2f55cc29d56e
2022-04-25 17:33:53 -07:00
Alex Dale
a80a9fef26 Added mutex for reserved_license_ids_.
[ Merge of http://go/wvgerrit/150630 ]

DeviceFiles uses a static variable for tracking license IDs which
have been reserved by a CDM session before officially storing the
license on the device.  This variable was not protected by a mutex,
and a rare race condition would arise, either crashing the service
or getting it stuck in a loop.

This CL adds a mutex for protecting the set of reserved IDs.

Bug: 226555704
Test: device_files_unittest
Change-Id: Icdea88673c76c267b4b7db79697ec52ae8e2581e
2022-04-22 13:53:11 -07:00
Robert Shih
b573e138ce Widevine PRODUCT_PACKAGES makefiles
Bug: 170611688
Bug: 228299194
Change-Id: I6f63e271f53cc76af91b4b8b6474e3a3e53ee800
2022-04-22 16:35:07 +00:00
Alex Dale
cc35c64757 Specify DRM certificate duration in tests.
[ Merge of http://go/wvgerrit/150350 ]

Certain integration tests were depending on the provisioning server
only sending short duration (~2 minute) certificates when testing
the CDM's ability to enforce expiration periods.  This behavior of
the server was not reliable, resulting in device test failures from
server behavior changes.

The DRM certificate provisioning server allows the requester to
optionally provide a desired certificate duration in the request
URL.  The tests which test the CDM's ability to enforce certificate
durations will now explicitly specify the certificate duration
required by the test.

Bug: 228547158
Test: request_license_test
Change-Id: Ib9ebfdba1451104be0e59baca0b2f23a94cd51e6
2022-04-15 20:14:51 -07:00
Edwin Wong
56d976fec6 Merge "Add unit tests for AIDL service" into tm-dev am: 47ebc28f6a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17641620

Change-Id: Icb4f82445784ecf441355f9ba12ad2071776582d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-14 17:49:07 +00:00
Edwin Wong
47ebc28f6a Merge "Add unit tests for AIDL service" into tm-dev 2022-04-14 17:26:44 +00:00
Alex Dale
5fb6be161e Added OTA Keybox stress test. am: 8cab20c0c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17549231

Change-Id: Id9068c7e935ecd5a7a0475da99db3dba48dac874
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 00:59:33 +00:00