Commit graph

185 commits

Author SHA1 Message Date
Chih-Hung Hsieh
65ab67312b Fix performance-for-range-copy warnings
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I1b76a22eab100a31e77048626e48169fe7eeaf92
2018-12-17 19:57:21 +00:00
Keun Soo YIM
68ae05dd2d pack VTS cc_test binaries as general-tests
Test: make general-tests
Bug: 120093339
Merged-In: I363450d205868f900e4925ccff1430e2a569f2a4
Change-Id: I363450d205868f900e4925ccff1430e2a569f2a4
2018-12-07 10:49:56 -08:00
Yifan Hong
3baef77daa DRM 1.1: Add VINTF doc
Test: none
Bug: 73556059
Bug: 111192666
Bug: 111096955
Bug: 117636317
Bug: 112150995
Fixes: 112282263

Change-Id: I361f50b5af19094c36f928939ca6d764ce59a205
2018-10-25 16:50:06 -07:00
Jeff Tinker
5c2e29de11 Fix failing drm 1.0 vts tests
The shared library path was incorrectly set based on
the drm.64bit.enabled flag. It should be set based
on whether the drm service is running as 32-bit or
64-bit.

Test: vts-tradefed run commandAndExit vts -m VtsHalDrmV1_0Target

bug:111289939
Change-Id: I388dc87bd4566211dc2901feccf1e6e1c90bfe67
Merged-In: I388dc87bd4566211dc2901feccf1e6e1c90bfe67
2018-09-13 00:39:42 +00:00
Jeff Tinker
2b46111ec8 Add more drm@1.1 VTS structure tests
Adding tests for:
 getKeyRequest_1_1
 getSecureStopIds
 releaseSecureStops
 removeSecureStop
 removeAllSecureStops

test:vts-tradefed run commandAndExit vts-staging-default -m VtsHalDrmV1_1Target
bug:73330999

Change-Id: Icd6c3e679ea674f899563a8d8e428321a7783633
2018-03-27 16:30:34 -07:00
Nathan Harold
c893754c0d Update Makefiles Missed In Previous Commits
When calling update-makefiles.sh there are
some unrelated changes that were missed in
previous commits.

Bug: 8675309
Test: compilation
Change-Id: I5bf67fbcc809de36bde1869ada7b835566a5198b
2018-03-19 16:37:46 -07:00
Zhuoyao Zhang
b83c4f2e12 Merge "Convert drm hal test to use VtsHalHidlTargetTestEnvBase" 2018-02-20 01:45:42 +00:00
Zhuoyao Zhang
cf50a32e57 Convert drm hal test to use VtsHalHidlTargetTestEnvBase
* The testEnvBase template is only used to register the testing hal.
* The service name is specifically determined by the test logic, so
  disable the feature for vts to run the test against all service
  instance (by setting HalServiceCombMode::NO_COMBINATION)

Bug: 64203181
Test: make vts
      vts-tradefed run vts -m VtsHalDrmV1_0Target
      vts-tradefed run vts -m VtsHalDrmV1_1Target

Change-Id: Ib2e005e8ccbc815067f0e9455fcd3e6c5ec151fb
2018-02-13 15:25:59 -08:00
TreeHugger Robot
1233c1046d Merge "Revert "Revert "VTS tests for fixed MediaDrm security level APIs""" 2018-02-12 17:55:50 +00:00
Jeff Tinker
6c2589f524 Revert "Revert "VTS tests for fixed MediaDrm security level APIs""
This reverts commit 6ec159b780.

Change-Id: I7e54e28c5e4b4c9f70d53d045bbfec57f7ef58c3
2018-02-11 18:58:55 +00:00
Jeff Tinker
199d60da8c Revert "Revert "Fix MediaDrm security level APIs""
This reverts commit a824afa9c4.

Change-Id: Ia8f3090454f010a507ac386767b2c2a11dce1ac4
2018-02-11 18:58:21 +00:00
Tobias Thierer
6ec159b780 Revert "VTS tests for fixed MediaDrm security level APIs"
This reverts commit 45c3855f4f.

Reason for revert: Build cop here. The CL topic that I'm reverting broke several builds: Drm.h's openSession(Vector<uint8_t> &sessionId) hides overloaded virtual function openSession(DrmPlugin::SecurityLevel securityLevel, ..) from IDrm.h.

https://android-build.googleplex.com/builds/submitted/4598692/full-eng/latest/view/logs/build_error.log

Change-Id: Ie61888464a2ac17b1ee6f47b23f5bb84fdbfa095
2018-02-11 15:01:58 +00:00
Tobias Thierer
a824afa9c4 Revert "Fix MediaDrm security level APIs"
This reverts commit 6a5934aee3.


Reason for revert: Build cop here. The CL topic that I'm reverting broke several builds: Drm.h's openSession(Vector<uint8_t> &sessionId) hides overloaded virtual function openSession(DrmPlugin::SecurityLevel securityLevel, ..) from IDrm.h.

https://android-build.googleplex.com/builds/submitted/4598692/full-eng/latest/view/logs/build_error.log

Change-Id: I8a1ce95ca6f48bec6c46f84a0fef7a48f975c406
2018-02-11 15:01:51 +00:00
Jeff Tinker
45c3855f4f VTS tests for fixed MediaDrm security level APIs
Vendors implementing the newly added MediaDrm.setSecurityLevel
HAL found that it was difficult to implement properly. Also the
semantics are somewhat ambiguous from the Java platform API
level. The APIs have changed to bind the security level
assignment to openSession which clarifies the API for apps as
well as making it more natural to implement in HAL modules. This
CL updates the VTS tests to account for those changes.

bug:72831697
bug:64001680

test: VtsHalDrmV1_1TargetTest, GTS media tests
Change-Id: I2adf13f9da7726b206df6fcc82b1e2e11fc94674
2018-02-08 01:48:03 +00:00
Jeff Tinker
6a5934aee3 Fix MediaDrm security level APIs
During development of the vendor/widevine HAL module, the newly added
MediaDrm.setSecurityLevel method was found to be difficult to
implement efficiently since the security level is needed at the time
a session is opened. This CL moves the security level parameter to
openSession to resolve this problem.

bug:72831697
bug:64001680

test: VtsHalDrmV1_1TargetTest, GTS media tests
Change-Id: Id9c765131d0ee6fa85f83d098955acf603229b46
2018-02-08 01:47:45 +00:00
Adam Stone
9d127768d1 Add getMetrics test to drm vts test.
Adds test cases for the getMetrics call in the DRM 1.1 HAL clear key
implementation.

Bug: 64001680
Test: VtsHalDrmV1_1TargetTest

Change-Id: I7c292f79f7477a6a88296aa62eae02cc70e35102
2018-02-02 17:44:53 -08:00
TreeHugger Robot
635d13fff4 Merge "Add vts tests for new drm@1.1 methods" 2018-02-02 21:50:30 +00:00
Jeff Tinker
6a465fda8c Merge "Fix incorrect comment in ICryptoFactory.hal" 2018-02-02 21:38:46 +00:00
Jeff Tinker
203c8514e2 Add vts tests for new drm@1.1 methods
Test: VtsHalDrmV1_1TargetTest

Methods are for querying HDCP, security levels
and number of sessions.

Change-Id: Iaa865a0201a4c10b0c6b055aabab146dd31a2d01
2018-02-02 10:31:21 -08:00
Jeff Tinker
c707779488 Fix incorrect comment in ICryptoFactory.hal
The comment referenced drm@1.1::ICryptoPlugin which
doesn't exist.

bug:64001680
bug:33657579
Change-Id: I6905fb4b8e3e1386b999ba64a6ca5f160d1c4eff
2018-02-01 12:26:43 -08:00
Jeff Tinker
80da0aa06f Add new secure stop methods
Methods are needed to release a secure stop by ID and
return a list of secure stops.

Tests: gts media tests

bug:67361434
bug:64001680
Change-Id: I53cb0671b9b775e8da16bcc61008e1700466180b
2018-01-29 14:27:29 -08:00
Adam Stone
a3face544a Merge "Added definition for getMetrics to IDrmPlugin." 2018-01-24 21:45:37 +00:00
Adam Stone
6a04d658b0 Added definition for getMetrics to IDrmPlugin.
Also added the appropriate type information for exporting metrics from a
plugin.

Bug: 64001676
Bug: 64001680

Change-Id: I9ccd4fbcf7201990e6d08c24e814e24833459a23
Test: Verified that the interface builds. No implementation, yet.
2018-01-23 16:23:30 -08:00
Rahul Frias
173d4fb93b Add new values to KeyRequestType
Two additional KeyRequestTypes have been added, None and Update. None
indicates that no key request is needed as keys have already been loaded.
Update indicates that while keys have previously been loaded, an
additional (non-renewal) license request is needed.

Bug: 70335058
Test: make
Change-Id: I43b7491110871332c3a79573773c441c2a4f5ccb
2018-01-23 13:33:59 -08:00
Jeff Tinker
1637e00b05 Create drm 1.1 HAL
New methods are for querying HDCP, security levels and
number of sessions

bug:64001680
bug:33657579

Change-Id: Idb3d66a805ac530221536058614e0df8460e627b
2018-01-21 16:06:49 -08:00
Jeff Tinker
5fee182384 Fix potential memory leak in default drm crypto plugin
bug:70205403

Test: manual play movies test forcing the legacy default
  widevine plugin to be used, instead of the widevine hidl
  service.

Change-Id: Icb5b234999c5bf49b31d967814e48d42d9dd767f
2018-01-05 11:18:00 -08:00
Steven Moreland
fcca4e23b7 Remove subdirs
Removing whenever I see these in code reviews.

Test: none
Merged-In: I4322f533a837d55618ec2ed2125e8966ace9d61d
Change-Id: I4322f533a837d55618ec2ed2125e8966ace9d61d
2017-11-28 14:22:43 -08:00
TreeHugger Robot
7c258c36cd Merge "Cleanup drm_hal_clearkey_test." 2017-11-15 01:02:11 +00:00
Edwin Wong
31a86d2847 Cleanup drm_hal_clearkey_test.
To stay close to the original test, the only time the test will abort is
when it encounters errors in Setup.

The following changes are applied in this CL:

- #include <openssl/aes.h> should be sorted alphabetically
- gtest macro should follow convention of ASSERT_EQ(expected, actual)
- removed unused variables: num, ecount_buf and kNotSecure
- TestQueryKeyStatus needs to call closeSession()
- moved and renamed test dependent global constants:
   e.g. k256SubSampleByteCount, k512SubSampleClearBytes and k512SubSampleEncryptedBytes
- use isOK() for checking Status::OK, e.g.
   ASSERT_TRUE(cryptoPlugin->setMediaDrmSession(sessionId).isOk());

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

bug: 68735305
Change-Id: Ic8f43b4c35644bf7223f24a531eae818e59e0f4a
2017-11-13 14:13:26 -08:00
Steven Moreland
8db261bc99 Updating makefiles for hidl_interface.
Bug: 64487114
Test: manual
Merged-In: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
Change-Id: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
2017-11-13 10:00:18 -08:00
Edwin Wong
c1512b4577 Add tests to validate key length for clearkey plugin. am: cc77a50e96 am: 01802815eb am: 36c9c34bdb
am: d29bc78ec9

Change-Id: Idbae7b29df1f71b331a13d31e47de925bceb4514
2017-11-03 05:46:59 +00:00
Edwin Wong
d29bc78ec9 Add tests to validate key length for clearkey plugin. am: cc77a50e96 am: 01802815eb
am: 36c9c34bdb

Change-Id: Ibb92aa618ceec88721ed807819d31516ab70595c
2017-11-03 05:44:56 +00:00
Edwin Wong
36c9c34bdb Add tests to validate key length for clearkey plugin. am: cc77a50e96
am: 01802815eb

Change-Id: I298891316951cc6ba5f000b796fb60c0b4f76290
2017-11-03 05:42:54 +00:00
Edwin Wong
01802815eb Add tests to validate key length for clearkey plugin.
am: cc77a50e96

Change-Id: Id61b8d76ef30a6c66edd10cd48b4ecdad795165d
2017-11-03 05:40:23 +00:00
Edwin Wong
cc77a50e96 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
2017-11-02 14:46:43 -07:00
Steven Moreland
1d7374c5e1 Update for Soong java makefiles. am: c3e80fa01e am: 0fff75dee1 am: 6c811964a1
am: 116161d94e

Change-Id: I33643636e2511de77fdf7de57777eb67edee2e52
2017-10-11 16:39:21 +00:00
Steven Moreland
116161d94e Update for Soong java makefiles. am: c3e80fa01e am: 0fff75dee1
am: 6c811964a1

Change-Id: I85ccbb4a15cd18938607f5bca4e065b9d7e0182b
2017-10-11 16:31:07 +00:00
Steven Moreland
0fff75dee1 Update for Soong java makefiles.
am: c3e80fa01e

Change-Id: Ia8835f9c95bd98a96f5fd3aff11191e7d3726fb9
2017-10-11 16:23:54 +00:00
Steven Moreland
c3e80fa01e Update for Soong java makefiles.
Test: pass
Bug: 33420795
Change-Id: Id9b1919a19b8ff682738cfb0869a479b4dbb4293
2017-10-10 23:07:20 +00:00
Steven Moreland
70bfb9d250 Merge "Update for hidl adapter module defaults." am: 988c977079 am: 861651985f am: b53e6ad535
am: 9a17f41f6f

Change-Id: I78d9292068b372238554fd9d35128e69f5b5f9d2
2017-10-04 21:54:11 +00:00
Steven Moreland
9a17f41f6f Merge "Update for hidl adapter module defaults." am: 988c977079 am: 861651985f
am: b53e6ad535

Change-Id: I23269fb7a9bdd352e670a80f390527d9eef31412
2017-10-04 21:51:00 +00:00
Steven Moreland
861651985f Merge "Update for hidl adapter module defaults."
am: 988c977079

Change-Id: I289818be1b30397391847ba1c532d1014fdbed27
2017-10-04 21:45:09 +00:00
Treehugger Robot
988c977079 Merge "Update for hidl adapter module defaults." 2017-10-04 21:36:25 +00:00
Chih-hung Hsieh
3ed04cd35d Merge "Use -Werror in hardware/interfaces"
am: 85bb01dd6b

Change-Id: I9169eb99a256f3a1db9e6f82e11fd96228d9558a
2017-10-04 20:40:30 +00:00
Steven Moreland
527fd76a0e Update for hidl adapter module defaults.
Test: pass
Change-Id: Idc6a943149a279bf17cfcfd0f2571473e53bbbbf
2017-10-04 12:47:03 -07:00
Chih-Hung Hsieh
3da5b01946 Use -Werror in hardware/interfaces
* Remove unused local variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I48dbbf670cc9eeff2391983788983420f8547cc9
2017-10-04 11:16:31 -07:00
Edwin Wong
0182fc2c24 Merge "Fix VtsHalDrmV1_0Target clearkey tests." into oc-mr1-dev am: d85a098767
am: cd6c66c430

Change-Id: Ie2c9939fa3b9f26cd9c0f64006fd8f9912f795cd
2017-10-04 16:47:42 +00:00
Edwin Wong
cd6c66c430 Merge "Fix VtsHalDrmV1_0Target clearkey tests." into oc-mr1-dev
am: d85a098767

Change-Id: I29d4ea563a7d855bfd07c4624faf0d89577d6515
2017-10-04 16:42:47 +00:00
Edwin Wong
48311a8c27 Fix VtsHalDrmV1_0Target clearkey tests.
1. Fix the following issues:
  - queryKeyStatus is now implemented, do not return
    ERROR_DRM_CANNOT_HANDLE anymore
  - expectedKeyRequest and knownKeyResponse should use
    '-' and '_' instead of '+' and '/' for base64Url encode;
    one uint8_t change from 0x2b to 0x2d for each vector

2. Add tests to create clearkey drm and crypto plugin using
both common pssh box format system ID and clearkey scheme
UUID.

Test: Vts test on Marlin and Taimen
  adb shell /data/nativetest/VtsHalDrmV1_0TargetTest/
  VtsHalDrmV1_0TargetTest

Test: Cts ClearKeyTest on Marlin and Taimen
  ANDROIOP= ./android-cts/tools/cts-tradefed run cts
  -m CtsMediaTestCases
  --test android.media.cts.ClearKeySystemTest

Test: ClearKey plugin unit tests
  adb shell LD_LIBRARY_PATH="/vendor/lib/mediadrm"
  /data/nativetest/ClearKeyDrmUnitTest/ClearKeyDrmUnitTest

Test: netflix and Play Movies & TV for sanity check

bug: 66327050
Change-Id: Icfbe715cf246a7c5253d5f104d0fd446618b18bd
2017-10-04 03:31:27 +00:00
Steven Moreland
91799c6cc7 Merge "Fix typo in update makefiles." am: 9960148420 am: f07e364ce3 am: 71a193a425
am: 9fdd241905

Change-Id: I1c852fa6600fecc44d5afd1a65a5f51c43ecf71c
2017-09-27 00:02:52 +00:00