Commit Graph

6182 Commits

Author SHA1 Message Date
Edwin
3da1d24a1d Integration tests: add license holder
Merged from http://go/wvgerrit/146154

Many integration tests require a license from a license server. This
CL creates a helper class to fetch, load, and hold a license.

Test: ./build_and_run_all_unit_tests.sh

Bug: 194342800
Bug: 194342778
Change-Id: I0de7bcab4db1b365f074bad29fc157a5eca135d8
2022-03-16 01:35:01 -07:00
Rahul Frias
6cda6717a9 Reboot test: Initialize fake clock
[ Merge of http://go/wvgerrit/143630 ]

When we run a test with the fake clock, the clock had been initialized
to the current time, or to 0. This causes a problem for reboot tests
because the clock might go backwards over the reboot. With this
change, we monitor the clock at the end of one reboot pass and
initialize the clock for the next pass based on the previous value.

Bug: 26163469
Test: GtsMediaTestCases on sunfish
Change-Id: Ibd0024f963634382af70553fced38da6e1d857d2
2022-03-16 01:34:36 -07:00
Rahul Frias
520368cea2 Reboot test: save large files
[ Merge of http://go/wvgerrit/143629 ]

The standard b2a_hex only saves about 2k, so we need a special version
that can handle larger strings. This is needed because a license file
is about 7k.

Bug: 194342751
Test: GtsMediaTestCases on sunfish
Change-Id: I6a6ac3f8f4fa6d9cd8a0119fc64fc8f3cc5f3ae8
2022-03-16 01:34:12 -07:00
Rahul Frias
57353b4941 Test max number of DRM private keys
[ Merge of http://go/wvgerrit/143909 ]

The max. number of DRM keys that can be loaded depends on the resource
rating.

Add a test to verify:
1. We can load up to MAX. drm keys
2. Loading the MAX+1 key can fail
3. The loaded keys should work even if loading other keys failed

Bug: 209084113
Test: opk_ta, run_x86_64_tests, run_level3_static_tests,
run_fake_l1_tests
Test: GtsMediaTestCases on sunfish

Change-Id: Ib9821e8a1994d41d3e9c2063440c109a2332ba89
2022-03-16 01:33:48 -07:00
Rahul Frias
5f45485175 Merge oemcrypto-v17 to master
[ Merge of http://go/wvgerrit/144530 ]

It's time to copy all the v17 work to our main branch.
I had to re-run clang-format to match local style.

Merge from commit b14f08374f9a48aed49850cc230daf384725b15f
Fix allow_null for key control iv in L3 v17

Bug: 161477208
Test: GtsMediaTestCases on sunfish
Change-Id: I97caa851e9e65eb0e42034d2f4a28dfb7499df0d
2022-03-16 01:33:23 -07:00
Rahul Frias
83a4100d11 Update cipher mode elsewhere
[ Merge of http://go/wvgerrit/144696 ]

In v17,
OEMCrypto_CipherMode_CTR renamed to OEMCrypto_CipherMode_CENC
OEMCrypto_CipherMode_CBC renamed to OEMCrypto_CipherMode_CBCS

Bug: 224375138
Test: GtsMediaTestCases on sunfish
Change-Id: I2d96e9c6d22a9d9e2fbbd15a8aea3f2d5dac6dcb
2022-03-16 01:33:02 -07:00
Rahul Frias
4532802ea0 Fix 1 ClangTidyBuild finding:
[ Merge of http://go/wvgerrit/145289 ]

* missing #include <string> for 'std::string' For more info see go/clang_tidy/checks/google3-build-missing-std-includes

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/clang-tidy-bug for category ClangTidyBuild if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

Tested:
    Local presubmit tests passed.

Bug: 224375138
Test: GtsTestCases on sunfish

PiperOrigin-RevId: 426761099
Merged from https://widevine-internal-review.googlesource.com/145250

Change-Id: I5a66b6eccc2b08ee11f92f90ce3b725f24c8d33c
2022-03-16 01:31:53 -07:00
Rahul Frias
bc6e841ccd Add out of bounds testing for LoadKeys()
[ Merge of http://go/wvgerrit/146249 ]

Update the OEMCryptoMemoryLoadLicense* tests so they cover LoadKeys()
for v15 and prior and LoadLicense() for v16 and later versions.

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

Bug: 190749256
Test: GtsMediaTestCases on sunfish
Change-Id: If90f7afd82819375f52a2fe619675bf0c4c4dd3a
2022-03-16 01:30:39 -07:00
Rahul Frias
8350badbb5 Separate invalid session test for ReuseUsageEntry
[ Merge of http://go/wvgerrit/144729 ]

Since OEMCrypto_ReuseUsageEntry() was introduced in v17, splitting the
test case for an invalid session from the other usage entry methods
since they were implemented in v15/16 as well.

Bug: 216193739
Test: GtsMediaTestCases on a sunfish
Change-Id: I7f4399c07a19227495a15807228b930066f6a794
2022-03-16 01:20:02 -07:00
Edwin Wong
bb26fe14e2 Merge "Build both AIDL and HIDL targets." into tm-dev am: 9361eb803b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17158449

Change-Id: Ie172294840317e8b7385889b26057c83fa41e305
2022-03-14 21:10:47 +00:00
Edwin Wong
9361eb803b Merge "Build both AIDL and HIDL targets." into tm-dev 2022-03-14 20:31:42 +00:00
Edwin
77f1fedde2 Build both AIDL and HIDL targets.
Merged from http://go/wvgerrit/147689

The default is to build for AIDL Widevine service.
Use "-t hidl" in build_and_run_all_unit_tests.sh or
build_all_unit_tests.sh to build for HIDL service.

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

Bug: 217247987
Change-Id: Ie7c51033f4aba341c829ccc8f846a6cfeab76df3
2022-03-11 15:36:55 -08:00
TreeHugger Robot
90b85ced5a Merge "wv aidl: fix native handle memory leak 2" into tm-dev am: 6eb5161dc1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16987763

Change-Id: I784272f962db3ef9c017c1e33385c1c9d63925eb
2022-03-11 05:40:49 +00:00
TreeHugger Robot
6eb5161dc1 Merge "wv aidl: fix native handle memory leak 2" into tm-dev 2022-03-11 05:20:59 +00:00
Edwin
0bf6d6a469 Add lazy service for Widevine AIDL HAL. am: 28feb283f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17091932

Change-Id: I25ee15d212c33385ea418f31012e4b4ecddf2f98
2022-03-10 19:27:46 +00:00
Edwin
28feb283f3 Add lazy service for Widevine AIDL HAL.
Merged from http://go/wvgerrit/147329

Test: atest VtsAidlHalDrmTargetTest
Test: atest GtsMediaTestCases

Bug: 221078453
Change-Id: I4345816f18c44de4187f03a087d58e890a6d6b01
2022-03-09 23:30:31 +00:00
TreeHugger Robot
f8ac8e07d4 Merge "Update dump() for Aidl HALs." into tm-dev am: f2384c1b22
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16994828

Change-Id: Iba64235e754aaef9619871615bce1e2e9bcf4d8b
2022-02-28 18:19:49 +00:00
TreeHugger Robot
f2384c1b22 Merge "Update dump() for Aidl HALs." into tm-dev 2022-02-28 17:55:35 +00:00
Sam Dubey
bb3db4073a Revert "Enable Widevine Aidl service." am: 304da5e399
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17030421

Change-Id: Ia22fec5d563b919d195241174f4baaccef688d07
2022-02-28 08:25:31 +00:00
Sam Dubey
304da5e399 Revert "Enable Widevine Aidl service."
This reverts commit 2269503129.

Reason for revert: Breaking hal_implementation_test

Bug: 221773661
Change-Id: I85e483fe1fc4f7d71c2cc5c2fc8892b1a57476ab
2022-02-28 05:57:22 +00:00
Edwin
b5284c5376 Update dump() for Aidl HALs.
Merged from http://go/wvgerrit/146589

lshal is for hidl HALs only, dumpsys is for aidl HALs.
Add option "-a" to dump both CDM metrics and properties
because adb bugreport calls dump() with option "-a".

Test: adb bugreport

Bug: 220996660
Change-Id: Ib2a73f3f9f353b8435735dd019a547b62b066725
2022-02-25 14:00:31 -08:00
Edwin
a3a6f1e853 Enable Widevine Aidl service. am: 2269503129
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16984707

Change-Id: I8623d82f74e72194ce04b8369ad88c1bda076206
2022-02-25 20:17:49 +00:00
Robert Shih
89cd3b2b46 [automerger skipped] Merge "aidl drm: independent min/max SecurityLevel for each supported mime" into tm-dev am: 3fa23b250b -s ours
am skip reason: Merged-In I5c0d511358c394aff6885135de851395f199dac0 with SHA-1 f2d89aaf77 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16952668

Change-Id: I357e466041cc8b4fa28e53306646da42daf5eeff
2022-02-23 17:14:02 +00:00
Edwin
2269503129 Enable Widevine Aidl service.
Merged from http://go/wvgerrit/146409

Bug: 219538389
Test: atest GtsMediaTestCases
Change-Id: I93f1270b304816636babe5a8d76325835793a137
2022-02-23 17:06:11 +00:00
Robert Shih
c5aa870dbd wv aidl: fix native handle memory leak 2
[ Merge of go/wvgerrit/146369 ]

Bug: 219754570
Test: atest GtsMediaTestCases
Change-Id: Id3e443d5e39ae416d6e566a129ebed423e19e98d
2022-02-23 09:40:15 +00:00
Robert Shih
3fa23b250b Merge "aidl drm: independent min/max SecurityLevel for each supported mime" into tm-dev 2022-02-23 02:08:46 +00:00
Robert Shih
438a40b016 Merge changes from topic "cherrypick-SupportedContentType-myxl3uejg2" into tm-mainline-prod
* changes:
  [automerge] aidl drm: independent min/max SecurityLevel for each supported mime 2p: f2d89aaf77
  aidl drm: independent min/max SecurityLevel for each supported mime
2022-02-23 02:08:46 +00:00
Robert Shih
14a161b77a [automerger skipped] Merge "wv aidl: fix native handle memory leak" into tm-dev am: 06587fd100 -s ours
am skip reason: Merged-In Id4705d5bc10ba6dfbe878f2d95fdd9ae9d2e9f1d with SHA-1 c6d7d6e69b is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16952669

Change-Id: I42274b45020a53514a492fd10a1c4ac8757e3e7d
2022-02-22 20:38:15 +00:00
Robert Shih
c668b798ec [automerger skipped] Merge "Update cipher mode enumeration in AIDL WvDrmPlugin" into tm-dev am: 7b3a37fa2f -s ours
am skip reason: Merged-In I7eb25a5db30a82cf8015e3c19af419c02a1d5002 with SHA-1 0684df3b6c is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16961547

Change-Id: Ieb5bb175ceb186f60de44056a05cf150a2edbbad
2022-02-22 20:37:55 +00:00
Robert Shih
06587fd100 Merge "wv aidl: fix native handle memory leak" into tm-dev 2022-02-22 20:23:44 +00:00
Robert Shih
176c4f4e2a Merge changes from topic "presubmit-am-53eaa6b33a3a42bba34a4724a8ebe4b0" into tm-mainline-prod
* changes:
  [automerge] wv aidl: fix native handle memory leak 2p: c6d7d6e69b
  wv aidl: fix native handle memory leak
2022-02-22 20:23:44 +00:00
Robert Shih
7b3a37fa2f Merge "Update cipher mode enumeration in AIDL WvDrmPlugin" into tm-dev 2022-02-22 20:22:11 +00:00
Robert Shih
c5c74fa36d Merge changes from topic "presubmit-am-69964c88cf1f4ba9b4fac91dde2f2412" into tm-mainline-prod
* changes:
  [automerge] Update cipher mode enumeration in AIDL WvDrmPlugin 2p: 0684df3b6c
  Update cipher mode enumeration in AIDL WvDrmPlugin
2022-02-22 20:22:11 +00:00
Presubmit Automerger Backend
29c148914e [automerge] aidl drm: independent min/max SecurityLevel for each supported mime 2p: f2d89aaf77
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16952668

Bug: 219528925
Change-Id: Iaaef182b8774feb612a129305c316fb92d3086b2
Merged-In: I5c0d511358c394aff6885135de851395f199dac0
2022-02-20 19:36:22 +00:00
Robert Shih
f2d89aaf77 aidl drm: independent min/max SecurityLevel for each supported mime
Interface change 16873294

[Merge of go/wvgerrit/145969]

Bug: 219528925
Test: atest MediaDrmTest.testIsCryptoSchemeSupportedForSecurityLevels
Change-Id: I5c0d511358c394aff6885135de851395f199dac0
Merged-In: I5c0d511358c394aff6885135de851395f199dac0
2022-02-20 19:36:07 +00:00
Robert Shih
892a8c39de [automerge] Update cipher mode enumeration in AIDL WvDrmPlugin 2p: 0684df3b6c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16961547

Bug: 216585596
Change-Id: Icc232eba7dd2f118c8a9e0276bc8698f8d208322
Merged-In: I7eb25a5db30a82cf8015e3c19af419c02a1d5002
2022-02-20 16:04:22 +00:00
Robert Shih
0684df3b6c Update cipher mode enumeration in AIDL WvDrmPlugin
To match the v17 change.

[ Merge of go/wvgerrit/146231 ]

Bug: 216585596
Test: atset WidevineGenericOpsTests
Change-Id: I7eb25a5db30a82cf8015e3c19af419c02a1d5002
Merged-In: I7eb25a5db30a82cf8015e3c19af419c02a1d5002
2022-02-20 16:04:11 +00:00
Robert Shih
88aa7509d7 [automerge] wv aidl: no set security level opening default session 2p: ea1d5d6891
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16961544

Bug: 219538389
Change-Id: I3c96abb4f814822b7e0f01f467fa4859315c11a6
2022-02-20 16:02:31 +00:00
Robert Shih
ea1d5d6891 wv aidl: no set security level opening default session
Bug: 219538389
Test: atest WidevineDashPolicyTests#testL3ValidateKeyOutputProtection
Change-Id: I5912a93fd0b7a144694ec3b251a129d839b8b149
2022-02-20 16:02:24 +00:00
Presubmit Automerger Backend
f0a49cd60d [automerge] wv aidl: fix native handle memory leak 2p: c6d7d6e69b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16952669

Bug: 219754570
Change-Id: Ic7972d7e58fea3d4388bc18c29fe76ed4f36d2ae
Merged-In: Id4705d5bc10ba6dfbe878f2d95fdd9ae9d2e9f1d
2022-02-20 16:00:03 +00:00
Robert Shih
c6d7d6e69b wv aidl: fix native handle memory leak
[ Merge of go/wvgerrit/145971 ]

Bug: 219754570
Test: atest GtsMediaTestCases
Change-Id: Id4705d5bc10ba6dfbe878f2d95fdd9ae9d2e9f1d
Merged-In: Id4705d5bc10ba6dfbe878f2d95fdd9ae9d2e9f1d
2022-02-20 15:59:51 +00:00
Edwin
93b5514a27 Fix gts issues.
Fix the conversion from in_args.keyId to Cdm format
which causes nullptr dereference signal 11 faults.

Test: atest
  atest-dev GtsMediaTestCases:com.google.android.media.gts.WidevineGenericOpsTests

Bug: 214410088
Change-Id: If84863e2501d4ccae7b8b38dceb707bb4bfa12fb
2022-02-14 10:42:52 -08:00
Edwin
9654d29be6 Widevine drm aidl: address API review
Interface update in change 16810770

Bug: 214410088
Test: atest VtsAidlHalDrmTargetTest
Change-Id: I19da51ef75952f5ff6c7c02e0393f574e69ee30b
2022-02-09 22:19:36 -08:00
Edwin
6112060529 Ran google3 clang-format on cdm source.
Merge from http://go/wvgerrit/144969

Test: build
  m android.hardware.drm-service.widevine -j128

Test: atest VtsAidlHalDrmTargetTest

Bug: 216720425
Change-Id: Ie1872d2a48e3b3645853e9831816afecffac747f
2022-02-03 20:33:05 -08:00
TreeHugger Robot
f4d6ef3858 Merge "Add new test binaries to device-tests.zip package" 2022-02-03 22:00:06 +00:00
Robert Shih
f1bfd6f202 misc wv aidl bug fix to pass vts
* handle default security level
* init ScopedAStatus before sending events

Bug: 205845199
Test: atest VtsAidlHalDrmTargetTest
Change-Id: Ie72d837bb2b7caa1da2721262b76bd47d5bdab03
2022-02-01 23:26:15 -08:00
Edwin
3c3da01d58 Use aidl interface for Widevine service.
The interface is defined in
hardware/interfaces/drm/aidl(http://go/ag/15329852).

Test: build
  m android.hardware.drm-service.widevine -j128

Test: build_and_run_all_unit_tests.sh
  for hidl tests

Test: atest VtsAidlHalDrmTargetTest

Test:   atest vts_treble_vintf_vendor_test:vts_treble_vintf_vendor_test.DeviceManifest/SingleManifestTest#ManifestAidlHalsServed/0 -- --abi x86_64

Bug: 200055138
Bug: 170964303
Change-Id: I5654d90d8a4b0bae4b4a78e79b27c1cafec36be7
2022-02-01 22:20:04 -08:00
Kyle Zhang
627c8d6855 Merge "Fix files mis-synced from cdm repo to Android" 2022-02-02 06:07:45 +00:00
Kyle Zhang
fdc585a55d Fix files mis-synced from cdm repo to Android
Test: build
Bug: 161477208
Change-Id: I2d48dff987fe37a54ffdfc47a7896fba975a0e20
2022-02-01 18:08:38 +00:00
Cong Lin
efbe13ea36 Update Android L3 after cipher mode fix
This is a merge of
https://widevine-internal-review.googlesource.com/c/cdm/+/144790

Updated cipher mode to allow playback in v17;
Added check for key selection before decrypting.

Merge from Widevine repo of http://go/wvgerrit/144779
Fix allow_null for key control iv in L3 v17

Merge from Widevine repo of http://go/wvgerrit/144792
Fix api version check in L3 v17

Test: L3 unit tests
Bug: 217145027
Change-Id: I584bd57e26407cbf4d4b94eb1bc5cf80839377be
2022-02-01 10:00:40 -08:00