Commit Graph

2821 Commits

Author SHA1 Message Date
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
Rahul Frias
85310dfbf6 Change the signature format requirement of OEMCrypto_GenerateCertificateKeyPair
[ Merge of http://go/wvgerrit/147593 ]

As we have decided to use hw_bcc service in Trusty to generate BCC and
sign the generated certificate public key, we need to change the
signature format to cose-sign1, which is defined by hw_bcc API.

Bug: 221496117
Test: GtsMediaTestCase on sunfish
Change-Id: I30739a0f0ae49291d343db46ad9e898663985cc8
2022-03-16 01:39:00 -07:00
Rahul Frias
1ab6872f82 Fix EnsureProvisioned for double provisioning
[ Merge of http://go/vwvgerrit/147459 ]

Bug: 222355942
Bug: 166849552
Test: GtsMediaTestCases on sunfish
Change-Id: Ia14cad535425af814927b14df8f1ee839ac7dee2
2022-03-16 01:38:40 -07:00
Rahul Frias
d6362f6e6b Update fuzz tests to match output desriptor struct
[ Merge of http://go/wvgerrit/147110 ]

The OEMCrypto_DestBufferDesc had fields address/address_length renamed
to clear_buffer/clear_buffer_length in v17. However this was not updated
for the fuzz tests thus causing some code coverage errors. This should
fix those errors.

Merged from https://widevine-internal-review.googlesource.com/146889

Bug: 220946359, 220946990
Test: GtsMediaTestCases on sunfish
Change-Id: I2837de2f79c0e731d072e3712d6b769df17a1c7e
2022-03-16 01:38:19 -07:00
Rahul Frias
e64dd05e25 Use default url to inform app of prov40 stages
[ Merge of http://go/wvgerrit/147457 ]

For the first stage of provisioning 4, the default url is appended with
"&preProvisioning=true" as an indicator to the app that the current
stage is the first stage.

Design doc:https://docs.google.com/document/d/1NZVKCsBtaMJdTjj2C9FzW8s-s4eEj2niu5SPlw7EvRM/edit

Bug: 224375138
Test: GtsMediaTestCase on sunfish
Change-Id: I49ba6f799b51b042461a32c51e4e20c6071227b8
2022-03-16 01:37:58 -07:00
Rahul Frias
139310fd05 Fix key_control_iv in OEMCrypto tests
[ Merge of http://go/wvgerrit/145989 ]

The key_control_iv field is used with an encrypted KCB.  With v17, the
KCB is in the clear and this field should have a length of 0.  This
updates the tests to set the field correctly.

Bug: 224375138
Test: GtsMediaTestCases on sunfish
Change-Id: I2973bc064705557c878bb1fe943e5fde92977dcc
2022-03-16 01:37:32 -07:00
Rahul Frias
b448a70645 Fix jenkins/opk_optee after v17 merge
[ Merge of http://go/wvgerrit/145349 ]

- Remove wvcdm namespace from test_clock.cpp

Bug: 224375138
Test: GtsMediaTestCases on sunfish
Change-Id: I239b692fd2103bd3d0626a145e99fc688c446256
2022-03-16 01:37:07 -07:00
Rahul Frias
fd00a8af24 Remove old test license holder
[ Merged from http://go/wvgerrit/143750 ]

The old test license holder would generate a minimal license response,
but could not correctly mimic important server logic introduced in the
v16 server. Since all integration tests now have policies on the UAT
server, we do not need these minimalist license responses anymore.

Bug: 192700112
Test: GtsMediaTestCases on sunfish
Change-Id: I78c1b6085a6d0239840a11f2b904902210e5e61c
2022-03-16 01:36:38 -07:00
Rahul Frias
13da693dd6 Generic crypto tests: use license holder
[ Merged from http://go/wvgerrit/143635 ]

Use a license holder for the generic crypto tests.

Bug: 192700112
Test: GtsMediaTestCases on sunfish
Change-Id: Ia2c802263562b11845e55ae0a24254ea54e364c7
2022-03-16 01:36:17 -07:00