Commit Graph

6245 Commits

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

Change-Id: I1f82980a08bd0bf4923f9932cabe5c98bd88c4d4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 18:18:17 +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
b3bc24aaf1 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: Icb1244bfa2831f36d63fcdb5db96a9ae17e10b16
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 23:02:13 +00:00
Alex Dale
8ac7ca3f46 Merge "Added metrics for production readiness." into tm-dev 2022-05-12 22:10:24 +00:00
Edwin Wong
8cc0db4a89 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: I6ad4d5573686317a4d1aece16f9136936dbc8faa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 03:09:34 +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
8089519493 Add libwvdrmdrmplugin_hal_test for AIDL service am: 5202862e9a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17831572

Change-Id: I0d15e53dd83e507f840731f74590c7f6a43103fc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:19:32 +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
e7fc768561 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: I9e178ea105015385ca5fe2c150b8f4aff273501c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 23:24:40 +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
cce550d006 Added CDM support for production readiness reporting. am: cd5afa88a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18195696

Change-Id: Ib668fd1bd21be93ccc0638d348f7997bb902b394
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 21:37:42 +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
dedba3996d 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: I9abc884ab878ca8bc288f1ae00df8caa175a7e1a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 15:35:25 +00:00
TreeHugger Robot
66e61fd671 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: I1a4fa1e9eb3ae389fc362732a515fe50675a71eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 15:12:01 +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
ba5c28e363 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: I5054995864e65066f8b786d8ce1fc544147de1c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 22:26:39 +00:00
Rahul Frias
6966dd7b20 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: I9f7c6d87f6ded4ff75a0fb731124d4374f451368
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 22:26:16 +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
3adda51fc2 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: Ibf810cf6ef434aed8856c5eaa197d52a82168f6c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 21:10:28 +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
421e7d99d9 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: I4f07440feead6d352fdc2ca378c682b5698501c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 18:21:31 +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
fa90d3da1f 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: I7a8479af3c9108da9b9ccecdbdcf244b76c86bdc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 15:17:35 +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
6b273fb5e0 Fix TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths() am: 1563fb2a27
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18151647

Change-Id: I89b5a42e853fa1b88cc4d331fc11db634a8eb4fd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 15:10:05 +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
15dbcab918 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: I29709ea493d3f116e04f1d98ba6284a30ec38fcf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 19:54:25 +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
9063559c43 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: I34a211b4f201580a227c3c0f725d12244d244abb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:01:39 +00:00
Alex Dale
beddef3475 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: I440cb42578dbf320ea192a540329d9401b52a5b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:00:02 +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
5c15da7afc 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: Id1f9debd87340d9df72e7a97f06acf51551843c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 21:43:54 +00:00
Robert Shih
2212311d21 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: Ia8b63e21ccd0b519fc11046a278bc5f2e0128e63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 21:43:30 +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