Commit Graph

6209 Commits

Author SHA1 Message Date
Alex Dale
11a55d2e8e Move system ID extraction outside of CryptoSession. am: 9d169a00bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18244016

Change-Id: If5782404e3ffff41a2377d6bd2d0a35851f78529
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 18:18:23 +00:00
Alex Dale
9d169a00bb Move system ID extraction outside of CryptoSession.
[ Merge of http://go/wvgerrit/151391 ]

This CL moves the logic for extracting the system ID from keybox or
OEM certificate (from OEMCrypto or device files) to a dedicated
SystemIdExtractor.

Before Provisioning 4.0, the system ID could only be found from data
returned by OEMCrypto.  However, with provisioning 4.0, the system ID
can now be found in the OEM certificate that is stored on the device
files.

Bug: 232020319
Test: system_id_extractor_unittest
Test: Forest L37800000954493485
Change-Id: Ie1b7987906e2e4fef015cd659a947b6dbb7594b1
2022-05-12 19:22:03 -07:00
Alex Dale
c01aca1d4d Merge "Added metrics for production readiness." into tm-dev am: 8ac7ca3f46
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18304422

Change-Id: Ia06436ff571d566428b059e3cfb7e052988f4e9b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 23:01:56 +00:00
Alex Dale
8ac7ca3f46 Merge "Added metrics for production readiness." into tm-dev 2022-05-12 22:10:24 +00:00
Edwin Wong
e277ac0aaf Add hal_metrics_adapter_unittest for AIDL service. am: cf3771e54a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18308868

Change-Id: Ic0e965c34364ace57f6b10b8ddbaf637b954d1a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 03:09:13 +00:00
Edwin Wong
cf3771e54a Add hal_metrics_adapter_unittest for AIDL service.
[ Merged from http://go/wvgerrit/151750 ]

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

Bug: 217247987
Change-Id: I0c890d2fab754bf993632659293a0272c863b11f
2022-05-11 22:01:35 +00:00
Edwin
56594f7018 Add libwvdrmdrmplugin_hal_test for AIDL service am: 5202862e9a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17831572

Change-Id: I6d8b16e2da6c3a4fa96f699f2dcdcf2e3de21271
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:18:35 +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
Alex Dale
88a7ff7685 Added metrics for production readiness.
[ Merge of http://go/wvgerrit/151749 ]

Extended CryptoSession for recording the result of
OEMCrypto_ProductionReady().

Only OEMCrypto_SUCCESS is considered "production ready".  With the
exception of OEMCrypto_ERROR_NOT_IMPLEMENTED, any other result is
vendor-specific and indicates not being production ready.

Bug: 231655151
Test: metrics_collections_unittest
Change-Id: Ia0e5603d7ee1290238cce63d0194ae1aced424c1
2022-05-10 18:04:11 -07:00
Edwin Wong
cba60f02a9 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: I4a3a7fa6a4ae632f9deb42e51fc7ee1e5aa8c71c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 23:23:59 +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
6fe5fe9b47 Added CDM support for production readiness reporting. am: cd5afa88a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18195696

Change-Id: Iecd0aed0d46bf9e18c2cec2f504744739ad07f5f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 21:37:17 +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
a815dd2852 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: If40ae4258575ee82fc898487607bbd565e703135
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 15:49:33 +00:00
TreeHugger Robot
cae6ea8d7a 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: If98c5abbba11419ba24b9b11a5a86017d6cd6ed4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 15:22:52 +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
5dd27bc39b 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: I747c796868628c614db0e9ab2076d0d6abb16c57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 22:26:16 +00:00
Rahul Frias
90a51d34fb 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: I865cdfa8815549eeabcdd98f85c856cd899b5561
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 22:25:54 +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
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
eb1ea89516 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: Ifef6d4cf3fbf2b7f3e60f43ea85cf47f3042bb3a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 21:09:58 +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
388ea1e988 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: Iaea267d837a01a39ee5da93b2c0d69b1cc94ea4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 18:21:33 +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
2bc51795c9 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: I6a5b61051507751917a30974b204c05aeef53635
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 15:17:21 +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
9c122a40ea Fix TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths() am: 1563fb2a27
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18151647

Change-Id: I8de55fc7626dec605b18b5ccc1de1d51c65efed0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 15:09:39 +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
0657c15214 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: I97b0a7e61e52d14135e2ddd29e56da410cb88015
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 19:54:44 +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
48a64d2240 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: I8497ffcc5af5f19727fdf5ff0b8d5034994e0f49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:01:50 +00:00
Alex Dale
cae67a0b19 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: Ie78be345758fc67e01f185a01fe91119abfb61e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:00:18 +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
71a89e2daa 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: I75fff489cf7945b9aca39990ceea1ea34f08c35a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 21:43:30 +00:00
Robert Shih
022c86d666 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: I7841f278f3e70bb0513c7bfa0b889e4f6a2b0376
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 21:43:13 +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