Commit Graph

3029 Commits

Author SHA1 Message Date
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
5f12f00956 Merge "Add unit tests for AIDL service" into tm-dev am: 47ebc28f6a am: 6ea9e7212b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17641620

Change-Id: I9acc2ec4cbc5673a0c515da1aabccb62e4f00fef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-14 18:24:47 +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
5dec86a191 Added OTA Keybox stress test. am: 8cab20c0c5 am: 6989567e5e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17549231

Change-Id: I1d108e072004782a9b97338ec5530bffef470953
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 01:23:58 +00:00
Edwin
fbacdc687f Add unit tests for AIDL service
[ Merged from http://go/wvgerrit/150029 ]

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

Bug: 217247987
Change-Id: Ib4f22c976b8ae6c2983cb611a958ddc3a29aebdb
2022-04-11 11:38:15 -07:00
Alex Dale
8cab20c0c5 Added OTA Keybox stress test.
[ Merge of http://go/wvgerrit/149469 ]

Created a new test for stressing OEMCrypto's ability to generate
OTA Keybox provisioning requests.  This forces the TA to retrieve
keys from KM, generate certificate and sign the request.  This is
intended to find any unexpected system degradation within the
device's TA(s).

Bug: 227542259
Test: oemcrypto_test
Change-Id: Ib34f2f801a7fe74ca67aa0a16f68f9ae326de24e
2022-04-04 13:44:10 -07:00
Alex Dale
c3125d8320 Merge "Added CDM support for Watermarking reporting." into tm-dev am: b3a5117b82 am: f0de58c431
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17364417

Change-Id: Ic8673e2b3ae269b71612f6bb6beed7d0e7a67579
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-02 01:35:11 +00:00
Alex Dale
b3a5117b82 Merge "Added CDM support for Watermarking reporting." into tm-dev 2022-04-02 01:07:07 +00:00
Alex Dale
46ce5b68b7 Merge "Reset UsageTableHeader when re-init for tests." into tm-dev am: b3a5a656af am: 06cddd75a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17511529

Change-Id: Id08746db95b09f977f61bdab79a5e43214ebf118
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 21:42:02 +00:00
Alex Dale
97f3544866 Added CDM support for Watermarking reporting.
[ Merge of http://go/wvgerrit/148552 ]

Extended the CDM layer to report OEMCrypto's watermarking support.
The reporting of watermarking comes in three (3) mechanisms:
1) ClientCapabilities in license requests
2) CryptoSession metrics when queried to OEMCrypto
3) String property query by apps

If OEMCrypto implementents OEMCrypto_GetWatermarkingSupport(), then
the reported watermarking support by the CDM will match that of
OEMCrypto.

If OEMCrypto does not implement OEMCrypto_GetWatermarkingSupport()
or an error occurs, it is assumed that OEMCrypto does not support
watermarking, and the CDM will report "Not Supported".

Bug: 226443788
Test: run_x86_64_tests request_license_test and license_unittest
Change-Id: Id929a356c395e6bcf45d371ee6887eec40d35329
2022-04-01 14:24:44 -07:00
Alex Dale
b3a5a656af Merge "Reset UsageTableHeader when re-init for tests." into tm-dev 2022-04-01 21:13:32 +00:00
Alex Dale
8091ed239e Reset UsageTableHeader when re-init for tests.
[ Merge of http://go/wvgerrit/149130 ]

When re-initializing OEMCrypto for testing purposes, the
UsageTableHeader must be reset as well.  This is to inform future
sessions to load or create a new header before creating new entries.

Bug: 219075437
Test: request_license_test and MediaDrmTests GTS
Change-Id: Ie8bc72bc7ea079d21587e114223fcb67547c756a
2022-04-01 03:20:24 +00:00
TreeHugger Robot
b18b3e20d3 Merge "Rename conditional flag and remove log spam." into tm-dev am: 0a65e3ba32
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17500167

Change-Id: I8e2943b97b5f3e8d5910ef2f00d93bfde30eebd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 19:01:51 +00:00
TreeHugger Robot
0a65e3ba32 Merge "Rename conditional flag and remove log spam." into tm-dev 2022-03-30 18:41:32 +00:00
TreeHugger Robot
ad85c2c69d Merge "Replace _hidl_ with _hal_ in test names" into tm-dev am: 5e0c55d2f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17325508

Change-Id: I130cc9d48af8e4f7ad1e7b8d392a12f66c327257
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 17:20:52 +00:00
TreeHugger Robot
5e0c55d2f7 Merge "Replace _hidl_ with _hal_ in test names" into tm-dev 2022-03-30 16:57:22 +00:00
Edwin Wong
2a91e85b91 Rename conditional flag and remove log spam.
[ Merged from http://go/wvgerrit/149029 ]

Address comment in http://ag/17158449 for
b/217247987, rename BUILD_TARGET with a
unique name. Also remove $(info ...) log spam.

Test: ./build_all_unit_tests -t hidl
Test: ./build_and_run_all_unit_tests -t hidl
Test: ./build_all_unit_tests
Test: ./build_and_run_all_unit_tests
Test: ./build_and_run_all_unit_tests -t invalid (default to AIDL)
Bug: 226976702
Change-Id: I1529dfbbbd1b112668ccac22bc684817dcb9ed35
2022-03-30 16:38:01 +00:00
Frederick Mayle
a9828a7168 Merge "libwvdrmengine: Fix double ownership of WVDrmFactory" into tm-dev 2022-03-28 22:13:39 +00:00
Frederick Mayle
d9c60f75d7 Merge changes from topic "presubmit-am-6622fe4b6ed34c108ae72ef4c712fd08"
* changes:
  [automerge] libwvdrmengine: Fix double ownership of WVDrmFactory 2p: 3112fd5505 2p: e7ba29b5ae
  [automerge] libwvdrmengine: Fix double ownership of WVDrmFactory 2p: 3112fd5505
  libwvdrmengine: Fix double ownership of WVDrmFactory
2022-03-28 22:13:39 +00:00
Suren Baghdasaryan
f48bafb7b1 Replace writepid with task_profiles command for cgroup migration
writepid command usage to join a cgroup has been deprecated in favor
of a more flexible approach using task_profiles. This way cgroup path
is not hardcoded and cgroup changes can be easily made. Replace
writepid with task_profiles command to migrate between cgroups.

Bug: 191283136
Test: build and boot
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: If3e351ff118ea4eb395f71a7e2e0ace5b62b77c0
2022-03-24 17:52:31 +00:00
Rahul Frias
04e403cc64 Merge "Sync license_protocol.proto" into tm-dev am: d3c653bd11 am: 7ce3d819d9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17345666

Change-Id: I1d8471440b1e7459f5ce23b5f4020a6a29258ce9
2022-03-24 04:23:46 +00:00
TreeHugger Robot
9378f74171 Merge "Correct when OEMCrypto_GetOEMPublicCertificate is called" into tm-dev am: 27d2826d03 am: 6905de19f9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17365196

Change-Id: Ic9ef9f131d6ee1d7d6138294ed9a3c62e6ff0220
2022-03-24 04:23:40 +00:00
TreeHugger Robot
355e671d6e Merge "Update ExoPlayerDemo.apk" into tm-dev am: e1c107bd8f am: 202363e65d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17359730

Change-Id: Ia7d7af078ed2f9b0ae1bae23d38335c81cc0302b
2022-03-24 04:16:51 +00:00
Rahul Frias
d3c653bd11 Merge "Sync license_protocol.proto" into tm-dev 2022-03-24 03:58:21 +00:00
TreeHugger Robot
27d2826d03 Merge "Correct when OEMCrypto_GetOEMPublicCertificate is called" into tm-dev 2022-03-24 03:52:42 +00:00
TreeHugger Robot
e1c107bd8f Merge "Update ExoPlayerDemo.apk" into tm-dev 2022-03-24 02:27:11 +00:00
Rahul Frias
c014da7da3 Correct when OEMCrypto_GetOEMPublicCertificate is called
[ Merge of http://go/wvgerrit/148469 ]

OEMCrypto_GetOEMPublicCertificate needed to be called
before the OEM private key was loaded due to a bug in OEMCrypto.
The bug has been addressed and the call can now be removed.

OEMCrypto_GetOEMPublicCertificate is only applicable to
devices with OEM certs as their root of trust. Devices with
keyboxes (or BCC) as their RoT would return a spurious
error OEMCrypto_ERROR_NOT_IMPLEMENTED. Removing the call
addresses this as well.

Bug: 190231658
Test: WV unit/integration test
Change-Id: I8216ca5a78b8c2acb5681c7f599cdc41efdf9fc7
2022-03-23 17:18:36 -07:00
Rahul Frias
3912635502 Sync license_protocol.proto
[ Merge of http://go/wvgerrit/148470 ]

Bug: 226298543
Test: WV unit/integration tests
Change-Id: Id3300772182a089230e23a277775334f6731d45a
2022-03-23 16:59:13 -07:00
Alex Dale
5ba7ab4d25 Merge changes from topic "presubmit-am-2da434748b5f487f8fc0a047848553c9"
* changes:
  [automerge] Threading requirements of UsageTableHeader. 2p: 64047c8958 2p: 6bff1691c5
  [automerge] Threading requirements of UsageTableHeader. 2p: 64047c8958
  Threading requirements of UsageTableHeader.
2022-03-23 23:56:53 +00:00
Alex Dale
cbea9a11ef Merge "Threading requirements of UsageTableHeader." into tm-dev 2022-03-23 23:56:53 +00:00
TreeHugger Robot
7cab9e5031 Merge "Copied OEMCrypto utils to Android." into tm-dev am: 26ee600923
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17312281

Change-Id: I5aca4c1df46e7fd61d2c22d1b46dd25684d40d57
2022-03-23 23:32:51 +00:00
TreeHugger Robot
26ee600923 Merge "Copied OEMCrypto utils to Android." into tm-dev 2022-03-23 23:16:15 +00:00
Kyle Alexander
b705d68631 Update ExoPlayerDemo.apk
Test: Playback of content in ExoPlayerDemo.apk

Bug: 203837661
Change-Id: Ic62b483b92215d2369b05bc2adc33d754ef5de5e
2022-03-23 15:29:57 -07:00
Presubmit Automerger Backend
691a355fbe [automerge] Threading requirements of UsageTableHeader. 2p: 64047c8958 2p: 6bff1691c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17352456

Bug: 189366337
Change-Id: I7d3867d8b1cbfcd6d65cb113b9f7d513fdcb9498
2022-03-23 18:54:33 +00:00
Alex Dale
64047c8958 Threading requirements of UsageTableHeader.
[ Merge of http://go/wvgerrit/148450 ]

This CL adds threading requirements to the method doc-comments of
UsageTableHeader.

Bug: 189366337
Test: usage_table_header_unittest
Change-Id: I671f702d3e8ec219cc8daaa220133cb8cec183c8
2022-03-23 11:54:12 -07:00
Frederick Mayle
a415b078ea [automerge] libwvdrmengine: Fix double ownership of WVDrmFactory 2p: 3112fd5505 2p: e7ba29b5ae
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17353612

Bug: 226379467
Change-Id: Ib09f225b85dfeea9d3aed5af754a2b5840856843
2022-03-23 18:00:14 +00:00
Frederick Mayle
3112fd5505 libwvdrmengine: Fix double ownership of WVDrmFactory
Using std::make_shared with ndk::SharedRefBase objects causes memory
errors.

Bug: 226379467
Test: TH
Change-Id: I3649ace96067e68cfc0ac998c836d9a8bd48bd11
2022-03-23 18:00:00 +00:00
Edwin Wong
0f3c297250 Replace _hidl_ with _hal_ in test names
[ Merged from http://go/wvgerrit/148451 ]

This step is a prelude in adding Widevine unit tests that
use AIDL interface.

Test: ./build_and_run_all_unit_tests.sh
Bug: 217247987
Change-Id: I449050819e6c9b0261066997dd45a6103b3a9a7a
2022-03-23 07:16:27 -07:00
TreeHugger Robot
8b4efe6eb9 Merge "Enable Widevine Aidl service." into tm-dev am: dddd1142de
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17158450

Change-Id: I60cba93678ff43c69c4d0c29908ae598a99f84c1
2022-03-22 23:33:21 +00:00
TreeHugger Robot
dddd1142de Merge "Enable Widevine Aidl service." into tm-dev 2022-03-22 23:17:15 +00:00
Rahul Frias
09db0f4f27 Merge changes I10f0c1bc,I4abad9d6,Ic1d42756 into tm-dev am: d210233e58
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17300766

Change-Id: Idef2f4b8dfb60bead7bdaa8f370b2ebf853e045c
2022-03-22 23:06:57 +00:00
Edwin
253a804c57 Enable Widevine Aidl service.
Merged from http://go/wvgerrit/146409

The original http://go/ag/16984707 was reverted due a
merge conflict from tm-dev to master, which
is now fixed by http://go/ag/17035190.

Bug: 219538389
Test: atest GtsMediaTestCases
Test: ./build_and_run_all_unit_tests
Change-Id: I95b639cf7ec138e809540db7a3fc0a234c7f4b2a
2022-03-22 10:17:01 +00:00
Alex Dale
6cfc1e06bf Added key_session_ guard to SelectKey. am: 1fac6fa5de
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17262613

Change-Id: I70573778fb89a8f266cd0f756f133f597c6b9bed
2022-03-22 05:32:35 +00:00
Alex Dale
4a065adc33 Copied OEMCrypto utils to Android.
The OEMCrypto utils have been copied over from the CDM repo.
Tests have been excluded for this CL.

Files represent a snapshot taken from http://go/wvgerrit/148270
and http://go/wvgerrit/148372.

Bug: 205902021
Change-Id: I1a58952cd1436a48974367c5436bf7296163e6f1
2022-03-21 21:22:19 -07:00
Rahul Frias
587516dfa2 Return error first if the returned status is not ok
[ Merge of http://go/wvgerrit/148249 ]

Bug: 224375138
Test: GtsMediaDrmTests
Change-Id: I10f0c1bc28342d6cd5ae7d373ef554321bb6d3c8
2022-03-21 14:43:54 -07:00
Rahul Frias
b07523f4c6 Constrain the generated key type in testing
[ Merge of http://go/wvgerrit/148157 ]

Fail the test if the returned type is other values.

Bug: 224375138
Test: GtsMediaDrmTests
Change-Id: I4abad9d69865cac99654d3dedd443463dd728a58
2022-03-21 14:41:01 -07:00
Rahul Frias
a6a99c416f Free EC key in test session destructor
[ Merged from http://go/wvgerrit/148030 ]

Bug: 224375138
Test: GtsMediaDrmTests
Change-Id: Ic1d42756cb1a03fa52d90c5fb0bd496e87a43c65
2022-03-21 14:37:58 -07:00
Alex Dale
1fac6fa5de Added key_session_ guard to SelectKey.
[ Merge of http://go/wvgerrit/148158 ]
[ Cherry pick of http://ag/16982989 ]

A rare race condition was found where a key is selected as the session
is closed.  This results in a null pointer dereference in
CryptoSession::SelectKey().  Two additional checks have been added to
SelectKey() to prevent this from occuring.

Bug: 217749078
Test: CDM unit tests, atest GtsMediaTestCases
Change-Id: Iec390cc7d1f28ddc18a30a68bc78922ec4fdbb89
(cherry picked from commit 1cd85a6b79)
2022-03-18 21:06:51 +00:00
Rahul Frias
f53715e25d Merge changes from topics "presubmit-am-0d92e9728c2d40da892bd450843310cb", "presubmit-am-11f8881adcb544ca8682231293b0f1c7", "presubmit-am-30bc14671b7b4b309e57b8600f46b32b", "presubmit-am-35012549d66140dd9d446b5eedf6e274", "presubmit-am-374672395de04b7b8f697a54e16be928", "presubmit-am-48d77602d3694ced89dd6e82a89fa646", "presubmit-am-4f8d5681247e4064a298d1e5263c41be", "presubmit-am-89930436636343d5a779bc06ccc307dc", "presubmit-am-904492a27e4449e78cf21dd9f4ab8ff0", "presubmit-am-90646715a3284730bf356bb6f4634729", "presubmit-am-a1ae313a0fde4696b7fb8c4390d3a94c", "presubmit-am-ae051fae1d06485ca7f12bcf265e8328", "presubmit-am-b4e6ace5be72409aab8e328c6f2a0288", "presubmit-am-dd16b680e0454031b2213179b22df7d7", "presubmit-am-e249264532da4839841f4cab3675fa61", "presubmit-am-e3a2f43ba2f84f429536270e16d0d251", "presubmit-am-e5f2e7a319d04b89950c63471d7f2458", "presubmit-am-ea47ff378925466c8c92e2ed9b58c461", "presubmit-am-f582c497c3274c7e84606cf3da4b09df" into tm-dev am: cff6103321
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17182326

Change-Id: I07a3c784e998ef295219e1d60a230ad74c20cc5d
2022-03-17 17:36:42 +00:00
Rahul Frias
cff6103321 Merge changes from topics "presubmit-am-0d92e9728c2d40da892bd450843310cb", "presubmit-am-11f8881adcb544ca8682231293b0f1c7", "presubmit-am-30bc14671b7b4b309e57b8600f46b32b", "presubmit-am-35012549d66140dd9d446b5eedf6e274", "presubmit-am-374672395de04b7b8f697a54e16be928", "presubmit-am-48d77602d3694ced89dd6e82a89fa646", "presubmit-am-4f8d5681247e4064a298d1e5263c41be", "presubmit-am-89930436636343d5a779bc06ccc307dc", "presubmit-am-904492a27e4449e78cf21dd9f4ab8ff0", "presubmit-am-90646715a3284730bf356bb6f4634729", "presubmit-am-a1ae313a0fde4696b7fb8c4390d3a94c", "presubmit-am-ae051fae1d06485ca7f12bcf265e8328", "presubmit-am-b4e6ace5be72409aab8e328c6f2a0288", "presubmit-am-dd16b680e0454031b2213179b22df7d7", "presubmit-am-e249264532da4839841f4cab3675fa61", "presubmit-am-e3a2f43ba2f84f429536270e16d0d251", "presubmit-am-e5f2e7a319d04b89950c63471d7f2458", "presubmit-am-ea47ff378925466c8c92e2ed9b58c461", "presubmit-am-f582c497c3274c7e84606cf3da4b09df" into tm-dev
* changes:
  Change the signature format requirement of OEMCrypto_GenerateCertificateKeyPair
  Fix EnsureProvisioned for double provisioning
  Update fuzz tests to match output desriptor struct
  Use default url to inform app of prov40 stages
  Fix key_control_iv in OEMCrypto tests
  Fix jenkins/opk_optee after v17 merge
  Remove old test license holder
  Generic crypto tests: use license holder
  Reboot tests: verify offline license is valid after reboot
  Policy integration tests: use license holder
  Integration tests: add license holder
  Reboot test: Initialize fake clock
  Reboot test: save large files
  Test max number of DRM private keys
  Merge oemcrypto-v17 to master
  Update cipher mode elsewhere
  Fix 1 ClangTidyBuild finding:
  Add out of bounds testing for LoadKeys()
  Separate invalid session test for ReuseUsageEntry
2022-03-17 16:39:36 +00:00