Commit graph

78 commits

Author SHA1 Message Date
Edwin Wong
c312e21b5e Add tests to validate key length for clearkey plugin.
AesCtrDecryptor::decrypt() doesn't check whether the size of "key"  is
equal to 16 bytes,  which may lead to an OOB read problem in the context
of mediadrmserver. The fix is in clearkey plugin. Add tests to validate
the fix.

Test: VTS test
  adb shell /data/nativetest/VtsHalDrmV1_0TargetTest/VtsHalDrmV1_0TargetTest

bug: 63982768

Merged-In: Ife2da17e7f39d8031bc36b83c3b27ba5e9d83eb7
Change-Id: Ife2da17e7f39d8031bc36b83c3b27ba5e9d83eb7
(cherry picked from commit cc77a50e96)
2018-01-23 22:33:24 +00:00
Jeff Tinker
95cf540a79 Allow clearkey tests to run if no vendor modules
DRM cannot skip all tests when vendor modules are
not present. Currently even the clearkey tests are
skipping when there is no vendor lib. This can be
replicated by just pushing the DRM VTS test binary
build from master (or DR or MR) and executing the
binary without VTS. All test cases skip (including
clearkey).

This change prevents exiting when no vendor
modules are found.

Test: Push the test binary and confirm that the
clearkey tests run.

bug:64459011
Merged-In: Ic5f554d9b223d6ca4bf26f92f072254cc18f4620
Change-Id: Ic5f554d9b223d6ca4bf26f92f072254cc18f4620
(cherry picked from commit 5db2e67293)
2018-01-23 22:22:25 +00:00
Yahan Zhou
8a85370679 Fix ICryptoFactory service
BUG: 62642564
BUG: 62138343

Test: vts -m VtsHalDrmV1_0Target

Merged-In: Ic697a32b111804fc3dc78f1b6e6b77538d7eeea9
Change-Id: Ic697a32b111804fc3dc78f1b6e6b77538d7eeea9
(cherry picked from commit 85a5d8855b07aec3727532983de38c324960d6d1)
(cherry picked from commit ccc11be665)
2018-01-23 20:45:14 +00:00
Steven Moreland
76cfb84140 Update makefiles. (2/2)
Adds default configuration for all hals.

Bug: 38415912
Test: pass
Change-Id: Idd1f3a2b7b16ad956d31784a513e93a066cdd02e
2017-05-19 15:54:03 -07:00
Jeff Tinker
db15c4b6ee Merge "Revert "Fix resource leaks in drm hal"" into oc-dev 2017-05-16 18:25:51 +00:00
Jeff Tinker
e3b6ae14f5 Revert "Fix resource leaks in drm hal"
This caused b/38343526 which is a chase list issue, reverting for now.

This reverts commit 4e1fe736af.

Change-Id: Ib9ffcd11e575e3f05f54cbea17fda2f2eb3780b5
2017-05-16 18:21:39 +00:00
TreeHugger Robot
14b91049a7 Merge "Fix resource leaks in drm hal" into oc-dev 2017-05-15 19:54:16 +00:00
Steven Moreland
bc71124120 Update makefiles for c++-sources and c++-headers. (2/2)
Test: pass
Bug: 38174080
Change-Id: Icad451f9f9ad5f46412356a4171a8a1222f8e545
2017-05-09 19:58:43 -07:00
Jeff Tinker
4e1fe736af Fix resource leaks in drm hal
bug:36408047
test: manual tests to verify leaks are fixed
Change-Id: Idd79e99e211d81f8b3e58cf52c9b01ce9d370dc4
2017-05-09 11:24:49 -07:00
John W. Bruce
467c0db62c Prefix ENABLE_MEDIADRM_64 with TARGET_
This build-time flag should be prefixed.

Bug: 37039525
Test: Built OS
Change-Id: If6f6cd1ad2df5f000a4264cabeb7d9eb77e194ea
2017-04-27 18:50:05 -07:00
Jeff Tinker
a33256b811 Fix VtsHalDrmV1_0Target test failure
DrmHalVendorFactoryTest.EmptyPluginUUIDNotSupported
was failing on 64 bit builds. The test was using
an uninitialized hidl_array as the empty UUID which
was incorrect. This change initializes the array
contents to null values.

Test: drm hal tests pass

bug: 37172151
Change-Id: I0acb86921f0daceba30fa7879980ce819db64a74
2017-04-24 17:02:17 -07:00
TreeHugger Robot
c68698337c Merge "VtsHalDrmV1_0Target test failure" into oc-dev 2017-04-15 07:53:27 +00:00
Jeff Tinker
fdde895c34 Merge "Skip tests when the drm scheme is not installed" into oc-dev 2017-04-14 23:41:49 +00:00
Jeff Tinker
779678f559 VtsHalDrmV1_0Target test failure
The DrmHalVendorPluginTest.RestoreKeysClosedSession test wasn't
taking into account the policy of the asset, so both streaming
and offline assets were included in the test which is incorrect.

Test: drm vts test passes

bug:37358379
Change-Id: I41116e77a1ae306bb1a484e3714360c8553590f0
2017-04-14 16:13:19 -07:00
TreeHugger Robot
007d23e7cb Merge "Add testcases for restoreKeys API." into oc-dev 2017-04-14 21:38:30 +00:00
Jeff Tinker
be310b2b77 Skip tests when the drm scheme is not installed
Not all drm hal implmentations will be present on every device,
but the vendor modules will be. This change allows tests to be skipped
when a drm hal implementation isn't present.

Test: drm vts tests pass with widevine on a gms
device (tests executed) and tests pass on an aosp
device (tests skipped).

Change-Id: I0b87f501a45103960193279eb5b4b2cd1c113acd
2017-04-14 13:28:32 -07:00
Iliyan Malchev
136b5e46ec Route DRM HAL libbinder traffic to /dev/vndbinder
b/37309712
Test: marlin

Change-Id: I72c2304842bd21b5393c17be5beeeb90a74d5345
Signed-off-by: Iliyan Malchev <malchev@google.com>
2017-04-14 15:25:16 +00:00
Ryan Campbell
6799c3a5c5 Add testcases for restoreKeys API.
Add a positive and two negative test cases for the restoreKeys
function in DRM vendor plugin.

Test: vts-tradefed run commandAndExit vts -m VtsHalDrmV1_0Target
--primary-abi-only --skip-all-system-status-check
Bug: 34178477
Change-Id: Ia7f323dbd92e7281efa96b9b7d07b85123e819f4
2017-04-14 00:18:16 -07:00
TreeHugger Robot
ca7205fa61 Merge "DRM vts test bug fixes" into oc-dev 2017-04-13 17:53:05 +00:00
Jeff Tinker
9dee7287e8 DRM vts test bug fixes
A session wasn't being closed in the ListenerKeysChange
test, that was causing erratic behavior on subsequent tests.
The expected return code was incorrect in the test
AttemptDecryptWithKeysRemoved.

bug:37272108
Change-Id: I11590b85c81548622359d91ebc9af75276a7b58c
2017-04-13 00:56:34 -07:00
TreeHugger Robot
8eb3a1ea59 Merge "Change drm/crypto service names to "default"" into oc-dev 2017-04-13 02:25:25 +00:00
Jeff Tinker
a0b44e644a Change drm/crypto service names to "default"
bug: 36371166

Test: vts drm hidl test

Change-Id: Iae98708c4f9b58dc697fb54c9f9b67d99e7ed0cf
2017-04-11 16:25:15 -07:00
Steven Moreland
3b36a83a2e Update makefiles (2/2).
Test: pass
Change-Id: Ic7e6289c7b69785491708ce0acbb657f4c704229
2017-04-11 09:58:03 -07:00
TreeHugger Robot
25197f0f6f Merge "Support binderized and passthrough vendor services" into oc-dev 2017-04-10 22:14:20 +00:00
TreeHugger Robot
61fd056380 Merge "Fix event listener timeout issues" into oc-dev 2017-04-10 18:10:15 +00:00
Jeff Tinker
cf3916a1fd Support binderized and passthrough vendor services
Previously only the vendor service name was used
to get the drm and crypto services, which would work
either for binderized or passthrough devices, but not
both. With this change, the vendor service name is
tried first, and failing that the default passthrough
service is used.

Change-Id: I05e9552da992e8d9dbba0f8dde485406262410a9
related-to-bug:34178477
Test: drm vts test
2017-04-07 17:41:49 -07:00
Jeff Tinker
3da372af67 Fix event listener timeout issues
The drm vts event listener tests would hang if event
callouts failed to work as expected. Use the vts test
callback template instead.

Change-Id: I5234f5760d90c1e884badc25cd251da27c2c672d
related-to-bug:34178477
2017-04-06 16:09:02 -07:00
Steven Moreland
4e7a307730 Fix transitive includes.
Files relying on transitive include of utils/Log.h (and things that it
includes) from MQDescriptor.h

Test: pass
Merged-In: Iff316b21bef556bb026378b7f89e97ded3febef4
Change-Id: Iff316b21bef556bb026378b7f89e97ded3febef4
2017-04-06 22:04:05 +00:00
TreeHugger Robot
69571ba233 Merge "Add additional drm hal tests" into oc-dev 2017-04-06 18:21:00 +00:00
Scott Randolph
f059ae420d Merge "Use explicit .c_str() for hidl_string" into oc-dev 2017-04-06 18:01:48 +00:00
TreeHugger Robot
7ba8df9b7c Merge "Correct comment on getProvisionRequest" into oc-dev 2017-04-06 15:37:51 +00:00
John W. Bruce
fcde9ff3a0 Add Flag for Enabling 64-bit Legacy DRM Plugins
We are ready for devices to begin migrating to a 64-bit Legacy DRM
Loader. However, not all devices are ready to make this jump yet. A
device needs to have all of its Legacy DRM Plugins ready to run as
64-bit before it can do this. This includes having 64-bit hardware
integrations.

So that devices can turn on 64-bit support as they get ready, I am
adding flags that can be set in a device's device.mk file. There are two
parts:

* ENABLE_MEDIADRM_64 enables building the Legacy DRM Plugin HAL as
  64-bit.

* Setting drm.64bit.enabled=true in PRODUCT_PROPERTY_OVERRIDES switches
  the Legacy DRM Plugin HAL to searching for DRM Plugins in the 64-bit
  directory.

Test: Validated that turning on these flags enables a 64-bit Legacy DRM
      Plugin HAL that loads 64-bit Legacy DRM Plugins from the lib64
      directory.
Bug: 36076017
Change-Id: I8d21fc7e7c0357eb6755839d41caa0f37ca20aff
2017-04-06 01:04:27 -07:00
Jeff Tinker
f20aa0c485 Add additional drm hal tests
Test: VTS tests passing

bug:34178477
Change-Id: Ie8fa5f2ad193b717b0564bb3046de8a64ccd8d85
2017-04-05 23:21:13 -07:00
Jeff Tinker
1da5b1a987 Correct comment on getProvisionRequest
There is no session ID in the parameter list.

Test: Compiles, it's a comment change

bug: 36735099
Change-Id: I0eccfcb3aa312a694b391c0b5a76e3b8425a7d36
2017-04-05 22:11:27 +00:00
TreeHugger Robot
fdfb81ebb6 Merge "Fix DRM prebuilt vendor module handling" into oc-dev 2017-04-05 18:31:02 +00:00
Jeff Tinker
f50e7a7495 Fix DRM prebuilt vendor module handling
bug:36817233
Change-Id: I93659a9901198d05fd43bf95804067a244533808
2017-04-04 22:46:37 -07:00
Scott Randolph
8997880087 Use explicit .c_str() for hidl_string
hidl_string no longer will provide an implicit cast to const char* as it
interfers with other expected behaviors of the class.  It now emulated
std::string in requiring a call to .c_str() to get the same behavior.

Bug:  36532780
Test:  Build the tree
Change-Id: I265590c7c18f425e44863df062a56b67519a932a
2017-04-04 10:53:26 -07:00
Ryan Campbell
5a07bab793 Update DRM makefile.
Change module name to VTS format.

Test: cd hardware/interfaces && mma
Bug: 34178477
Change-Id: I33490627e1254ec1b1d36ebb7778e20680005910
2017-03-31 14:55:32 -07:00
TreeHugger Robot
ebf7f3213b Merge "Add VTS tests for drm+crypto HALs" into oc-dev 2017-03-31 05:29:55 +00:00
Jeff Tinker
0ea406920a Add VTS tests for drm+crypto HALs
Tests: drm vts tests are passing

related-to-bug: 32815560

Change-Id: I2b36f27fbb42eba37f3e5a26acea0e359e60b3af
2017-03-30 20:17:18 -07:00
Jeff Tinker
fea340f1fe Fix getKeyRequest legacy HAL returning invalid status
bug: 36006198

Test: drm hal vts test
Change-Id: Ie3125b4459add4fd30dc418f92ab0f51d8fcc73b
2017-03-30 16:00:12 -07:00
Steven Moreland
561b602a99 Update makefiles for hwtypes.h
Test: pass
Change-Id: I8e17eb8fec5d2f04c526476a866c8dd54ccb556c
2017-03-28 15:18:20 +00:00
Edwin Wong
c7170174d4 Check registerPassthroughServiceImplementation return status
Should abort program if registerPassthroughServiceImplementation returns
something other than OK.

Test: Play Movies & TV in non-binderized mode.

bug: 34640335
Change-Id: I94be98e7ae66cdb777a7d182123c8692aef915b7
2017-03-16 09:43:29 -07:00
Jeff Tinker
e5fbc46ef2 Fix CTS post submit failures
MediaCodecTest.android.media.cts.MediaCodecTest.testCryptoError
was failing due to incorrect error code translation introduced
by the drm hidl hal.

bug: 35137940
Change-Id: Ibd02425a55194f3cb0acc0e53f90b156023fb1ab
2017-03-15 20:35:37 +00:00
TreeHugger Robot
a652f5fc1d Merge "Remove warning from DrmFactory.cpp" 2017-03-08 18:28:29 +00:00
Steven Moreland
542f434dc2 Remove warning from DrmFactory.cpp
Test: pass
Change-Id: Ie5d37a257bfb1f4f5d9173bbe41e734161941954
2017-03-08 08:34:00 -08:00
Jeff Tinker
7e0a4e54ad Allow drm hal implementations to not require provisioning
Not all drm schemes require provisioning. This change
updates the documentation to explicitly support it.

bug:36007160
Change-Id: Ia4dc471314d2cce92ce8d69258bf1d16d5104302
2017-03-07 02:55:27 +00:00
Rahul Frias
abd4e11c9d Correct reporting of errors in MediaCrypto
Legacy error codes need to be converted into new Status values before
being reported. Decryption errors (that were negative) were changed to
absolute values. This caused their translation to new Status values to
fail.

b/35634335

Test: Verified with GtsExoPlayerTestCases. Some failures, but those
      are unrelated to this CL and will be addressed separately.

Change-Id: I995cac33cb2725d02b0f1a3922e522ce07a9d1be
2017-02-28 20:56:13 +00:00
Rahul Frias
89437fbdd9 Correct propagation of asynchonous events
The legacy plugin listener was not set when used in
passthrough mode in Treble. This caused events (session renewal,
key expired etc) not to be propagated to the app.

b/35375500

Test: In progress

Change-Id: I7d74b3320c82e22f67d3c804ee93f9b9791080b2
2017-02-27 15:07:34 -08:00
Steven Moreland
7e73d5b908 Remove viral dependency on libhwbinder. (2/2)
find hardware/interfaces -name Android.mk -exec sed -i -e '/libhwbinder
\\/d' {} \;
find hardware/interfaces -name Android.bp -exec sed -i -e
'/"libhwbinder"/d' {} \;
./hardware/interfaces/update-makefiles.sh

Note, automotive has some actual dependencies on libhwbinder, filed
b/35758626 for this.

Test: everything links
Test: (sanity) booted marlin on internal master with these changes
Bug: 35710429
Change-Id: I6d0726c8130d00684b978efbdd48e3ae396f12e5
2017-02-24 12:18:01 -08:00