Commit Graph

953 Commits

Author SHA1 Message Date
Rahul Frias
518ce632f7 Merge "Prevent segfaults when a session is deallocated" into oc-dev 2017-04-20 17:19:45 +00:00
Fred Gylys-Colwell
45bf89ff8b Replace mips library with stubs file
Merge from Widevine repo of http://go/wvgerrit/26202

This is a workaround to fix a broken mips build.

Test: Built for sdk_phone_mips.
b/37523523

Change-Id: I56ce65919303113f712d422d33e335b594292d42
2017-04-19 21:16:57 -07:00
Rahul Frias
f2fccc20cd Prevent segfaults when a session is deallocated
[ Merge of http://go/wvgerrit/26201 ]

Race conditions arose when a session was closed while data was
still queued for decryption in MediaCodec buffers. If a session
is closed while data is still queued for decryption, subsequent
decryption requests will be rejected with a CryptoException
ERROR_SESSION_NOT_OPENED.

Test: Verified by wv unit/integration test and
      WvCdmExtendedDurationTest.DecryptionCloseSessionConcurrencyTest

b/36747801

Change-Id: I044d1d6b9fc886a1c353d20b9c6365319aa71e80
2017-04-19 19:24:04 -07:00
Rahul Frias
c2969ef0f4 Merge changes I9039bc1f,I43758cd2 into oc-dev
* changes:
  Allow decryption of unencrypted data before key has been retrieved
  Correct CryptoException error returned before keys have been loaded
2017-04-19 23:40:51 +00:00
John W. Bruce
76d3ca9091 Rebuild Haystack and Store L3 Keybox in /data/vendor
(This is a merge of http://go/wvgerrit/25900 and http://go/wvgerrit/25920)

This commit contains the latest Haystack prebuilt binaries based on
the latest OEMCrypto code in the Widevine tree. This is to pick up the
change "Report error OEMCrypto_ERROR_ENTRY_IN_USE", which fixes
several failing unit tests. This CL also adjusts the L3 library so
that it stores its data in the directory specified by the layer above.

level3/x86_64/libwvlevel3.a    Level3 Library 7284 Apr 13 2017 16:58:07
level3/arm/libwvlevel3.a       Level3 Library 4445 Apr 13 2017 16:48:19
level3/mips64/libwvlevel3.a    Level3 Library 7285 Apr 13 2017 23:52:51
level3/mips/libwvlevel3.a      Level3 Library 4465 Apr 13 2017 23:16:02
level3/arm64/libwvlevel3.a     Level3 Library 7283 Apr 13 2017 17:05:12
level3/x86/libwvlevel3.a       Level3 Library 4464 Apr 13 2017 16:36:25

Bug: 36656178
Bug: 37210088
Test: build_and_run_all_unit_tests.sh and GTS tests
Change-Id: Ia5b272cd945f0c9f2fe37ecd0f3ccd2f2ff398bc
2017-04-19 11:23:06 -07:00
Rahul Frias
6260d4d628 Merge "Allow OfflineLicenseRenewal test to be repeatedly invoked" into oc-dev 2017-04-19 18:11:48 +00:00
Rahul Frias
3b68424d1f Merge "Add usage information tests to device files unit tests" into oc-dev 2017-04-19 18:09:40 +00:00
Rahul Frias
0f374af4ab Allow decryption of unencrypted data before key has been retrieved
[ Merge of http://go/wvgerrit/25987 ]

Test: Added Cdm/WvCdmSessionSharingNoKeyTest to request_license_test.
      Verified by wv unit and integration tests.

b/28182987

Change-Id: I9039bc1fca83e2c1044c3af2f47f31dc4fb5c910
2017-04-19 00:47:40 -07:00
Rahul Frias
3d599197be Correct CryptoException error returned before keys have been loaded
[ Merge of http://go/wvgerrit/25983 ]

Earlier versions of android returned CryptoException with
error code ERROR_NO_KEY, when a decrypt call was received before keys were
loaded. Changes to O resulted in ERROR_SESSION_NOT_OPENED being returned
instead. This CL reverts the behaviour.

Also a change to correct CDM error code numbering in comments.

Test: Verified by unit and integration tests

b/37219830

Change-Id: I43758cd29cf9d1945f878ac352a5f26538b48cdb
2017-04-19 00:40:48 -07:00
Rahul Frias
80798ae11c Merge "Revert "Detect when unable to meet policy requirements"" into oc-dev 2017-04-18 20:37:22 +00:00
Rahul Frias
e733943729 Revert "Detect when unable to meet policy requirements"
This reverts commit 1223330ccc.

b/37460568

Change-Id: I936c06f679126ac50fb2d4753b4270b4ba42def5
2017-04-18 20:03:56 +00:00
Rahul Frias
551f4cb474 Merge "Detect when unable to meet policy requirements" into oc-dev 2017-04-15 06:50:05 +00:00
Rahul Frias
f655f329e2 Merge "Correct KeySetId value when returned by AddKey" into oc-dev 2017-04-15 06:37:06 +00:00
Rahul Frias
57bb6c29ca Add usage information tests to device files unit tests
[ Merge of http://go/wvgerrit/24445 ]

Test: Verified by wv unit and integration tests

b/36048120

Change-Id: I9d067e79654331e8e58df5dce5411fbadc73e575
2017-04-14 15:12:25 -07:00
TreeHugger Robot
6116fdb97a Merge "Translate CDM session not opened errors" into oc-dev 2017-04-14 21:38:30 +00:00
TreeHugger Robot
45910edd19 Merge "Add an offline test asset for the drm vts test" into oc-dev 2017-04-14 21:38:30 +00:00
Rahul Frias
5321b96623 Correct KeySetId value when returned by AddKey
[ Merge of http://go/wvgerrit/25643 ]

The MediaDrm#provideKeyResponse API states that an empty byte array is
returned when the license type is streaming or release but a non-empty
value was being returned in some cases.

The KeySetId is now returned when the license type is offline or when
the license is streaming and has a secure stop associated with it.

Test: Verified by request_license_test integration tests. Tests have been
      modified to validate the returned Key Set Id values.

b/36093612

Change-Id: I82dba537c77ddd1d1876cbce58729f3db901ee51
2017-04-14 07:54:01 -07:00
Iliyan Malchev
28b89a9b4f Route drm@1.0-service.widevine libbinder to /dev/vndbinder
b/37309712: [Marlin/Sailfish] Fatal signal 6 (SIGABRT) when playing Exo
	    Player L1 encrypted content
Test: marlin

Change-Id: I05b12ea334138498be13bca92c9b1db6ed1b9870
Signed-off-by: Iliyan Malchev <malchev@google.com>
2017-04-14 01:22:04 -07:00
Jeff Tinker
3914953bff Add an offline test asset for the drm vts test
To test restoreKeys, a content configuration with a
license policy allowing offline playaback was needed.

Test: drm vts test

bug:34178477
Change-Id: Ib90d7a878c0f310569abb09f21138c7a6ac9daae
2017-04-14 00:30:07 -07:00
Jeff Tinker
f5240b69e4 Translate CDM session not opened errors
The drm hidl hal specifies that operations on sessions that
are not opened return ERROR_DRM_SESSION_NOT_OPENED.  This
change adds that translation, previously they were mapped
to unknown error.

Test: drm vts test

bug:34178477
Change-Id: I3777dd90eea7061f3fa5413a5732d7d58b85b49b
2017-04-14 00:28:47 -07:00
TreeHugger Robot
c3ea64aa89 Merge "Corrections to widevine plugin for vts tests" into oc-dev 2017-04-14 00:05:42 +00:00
Rahul Frias
1223330ccc Detect when unable to meet policy requirements
[ Merge of http://go/wvgerrit/25781 ]

The security level (software/hardware, decryption/decode)
in the policy that specified how the key was to be used was
not being respected for L3. Playback would either continue or
a vendor specific error would be thrown.

If the device cannot use the key as permitted by the policy
CryptoException#ERROR_INSUFFICIENT_OUTPUT_PROTECTION will be thrown.

Test: Verified by WV unit+integration tests.
      Verified by WidevineDashPolicyTests
      Verified by WidevineDashPolicyTests#testL3SoftwareSecureDecoderRequired,
      testL3HardwareSecureCryptoRequired, testL3HardwareSecureDecodeRequired,
      testL3SecureVideoPathRequired.

b/31913737
b/31913439

Change-Id: Ibfc7f3dd6fc7264e8cf9b0d33f6f8d619eed6c00
2017-04-13 16:50:10 -07:00
Jeff Tinker
6c15ea673d Corrections to widevine plugin for vts tests
Add a check for invalid session size in restoreKeys
and correct the return code when attempting to create a
plugin with an invalid uuid. Also correct the return code
when attempting to decrypt after keys have been removed.

bug:37172151
Change-Id: I7e832ffe04081471a0cdb3a9329808f47f12cfc3
2017-04-13 14:53:12 -07:00
Rahul Frias
ce62e1d7e7 Correct error returned when license is for the future
[ Merge of http://go/wvgerrit/25721 ]

Return CryptoException with errorCode ERROR_NO_KEY when an attempt is made
to make use of a license whose start time is in the future.

Test: Verified by WidevineDashPolicyTests#testL1LicenseStart2030

b/31914841

Change-Id: I2a157c227550a2391b6536365f34f1dfec3dea0c
2017-04-12 13:20:44 -07:00
John Bruce
1b0d67f368 Merge "Always Report OEMCrypto_ERROR_KEY_EXPIRED as NEED_KEY" into oc-dev 2017-04-12 17:48:58 +00:00
TreeHugger Robot
cc28abea0b Merge "Disable MinVersionNumber13 Test *DO NOT MERGE*" into oc-dev 2017-04-12 01:37:18 +00:00
TreeHugger Robot
dbaacf9232 Merge "Address merge comments" into oc-dev 2017-04-11 23:57:19 +00:00
Rahul Frias
b474ba042e Allow OfflineLicenseRenewal test to be repeatedly invoked
[ Merge of http://go/wvgerrit/25720 ]

Test: Repeatedly invoke WvCdmRequestLicenseTest.OfflineLicenseRenewal

b/28915200

Change-Id: I5be6be02d09ced1a7ba8bac2c8706f199d063db8
2017-04-11 16:40:16 -07:00
TreeHugger Robot
eef94c002f Merge "Report binderized vendor service name" into oc-dev 2017-04-11 21:02:21 +00:00
TreeHugger Robot
9a69579330 Merge "Add checks for invalid parameters" into oc-dev 2017-04-11 21:01:25 +00:00
Fred Gylys-Colwell
f9d08a30a4 Disable MinVersionNumber13 Test *DO NOT MERGE*
Merge from Widevine repo of http://go/wvgerrit/25662

OEMCrypto v13 is required for OC MR1, and is not needed for OC.  This
CL disables the unit tests MinVersionNumber13 for OC.  This CL should
not be merged to master.

b/36866361

Test: all unit tests pass on sailfish.

Change-Id: I04d7b468ac9479257c25519acb6ac13204acabd5
2017-04-10 18:04:58 -07:00
John W. Bruce
7f27e5a266 Always Report OEMCrypto_ERROR_KEY_EXPIRED as NEED_KEY
(This is a merge of wvgerrit/25422)

OEMCrypto_ERROR_KEY_EXPIRED was not always being reported to the higher
layers as a NEED_KEY error, which could cause inconsistent error
handling.

Bug: 28294273
Test: Unit tests
Change-Id: Idf5642ea0f0ba915bc1f53025a1f14691d142aed
2017-04-10 16:49:44 -07:00
Jeff Tinker
bd87217173 Add checks for invalid parameters
Part of VTS test suite validation for
the binderized Widevine service

Test: Drm VTS test

bug:32815560
Change-Id: I0913c0e72487b5fdbf579b9ea3409c13264888fd
2017-04-10 10:06:26 -07:00
Jeff Tinker
dff3a13d6c Report binderized vendor service name
Update the vts vendor module to
return the service name instead of the
default passthrough service name to
support binderized mode.

Part of VTS test suite validation for
the binderized Widevine service

Test: drm vts test

Change-Id: I04c9fa6f66af43db6c405ecc8d714b712d87a45a
related-to-bug:34178477
2017-04-07 18:04:36 -07:00
Steven Moreland
20f8368f9c Fix transitive include.
Test: checkbuild
Change-Id: Iea1de496007556d2efac76092ef87ec2ec78b9bf
2017-04-06 17:39:39 -07:00
TreeHugger Robot
70d15e286f Merge "Add additional VTS drm tests for widevine" into oc-dev 2017-04-06 18:20:59 +00:00
Scott Randolph
cfcdceaa4f 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: I2ce4354619a99d7c5ae8b39762d5506891ccd1ed
2017-04-06 10:58:56 -07:00
Edwin Wong
72f89a3b7f Merge "Remove dependencies from frameworks C++ containers." into oc-dev 2017-04-06 04:18:27 +00:00
TreeHugger Robot
8e041f9fd3 Merge "Fix compiler warnings" into oc-dev 2017-04-06 00:19:38 +00:00
Edwin Wong
d9e7070de7 Remove dependencies from frameworks C++ containers.
Replace AString, KeyedVector, List, String8 and Vector
with stl containers. Remove corresponding frameworks
libraries.

Test: Play Movies & TV (streaming and pinning)
Test: Netflix
Test: unit tests

bug: 34677927
Change-Id: I125f45054987d69bbca59c1ffdcbe8add38c3c13
2017-04-05 22:46:04 +00:00
Jeff Tinker
cfe80bc234 Add additional VTS drm tests for widevine
Also fixes a few cases where invalid inputs were
not checked.

bug: 34178477
Change-Id: I15c1e5f96e0843f484d8d3e29f548eac30d9dd80
2017-04-04 22:38:55 -07:00
TreeHugger Robot
82a0ed59fe Merge "Build libvtswidevine to relative directory." into oc-dev 2017-04-04 23:05:29 +00:00
Ryan Campbell
cdaeb0716c Build libvtswidevine to relative directory.
Build libvtswidevine module relative to the directory
drm-vts-test-libs.

Test: make vts; libvtswidevine.so is in correct place.
Bug: 36889176
Bug: 36817233
Change-Id: Iadb5bd6e71a1a7c99a69feff2ecb7bded90af24d
2017-04-04 13:26:01 -07:00
Fred Gylys-Colwell
d0a3568338 Address merge comments
Merge from Widevine repo of http://go/wvgerrit/24723

Several review comments were uncovered in the merge from oc-dev to
master. This CL addresses them.  This is just style changes in test
code.

http://go/wvgerrit/24318
http://go/wvgerrit/24301
http://go/wvgerrit/24316

Test: ran unit tests.

b/36451451

Change-Id: I257f8bf9b4fb5797e3da69578b48cd040cf61bfb
2017-04-04 12:31:59 -07:00
John W. Bruce
b99a4c736f Turn on 64-bit Executables on Supported Platforms
This commit changes the unit tests and HAL Service to run as 64-bit on
devices that have enabled 64-bit DRM Plugins.

Bug: 36076017
Test: Turned on the flag for a device and used the file command to
      verify that all binaries were built as 64-bit.
Test: Turned the flag back off and verified that all binaries were built
      as 32-bit. This should affect no current devices.
Change-Id: Ieb7218f15b9359f2038a6f60b8c994b16d2b5b53
2017-04-01 19:05:30 -07:00
Jeff Tinker
749ce0efcf Fix compiler warnings
Formats for size_t were incorrect

Change-Id: Ibdfdd734b9fe9e74e014fe10152ad8b9baf2d6f2
2017-03-31 16:19:41 -07:00
TreeHugger Robot
b3ea54b6dc Merge "Add checks for invalid parameters" into oc-dev 2017-03-31 05:29:54 +00:00
TreeHugger Robot
2b49e7c4ec Merge "DRM VTS Vendor module for widevine" into oc-dev 2017-03-31 05:29:54 +00:00
John Bruce
0fba3719e7 Merge "Fix & Improve Test-Building and -Running Scripts" into oc-dev 2017-03-31 00:56:55 +00:00
Jeff Tinker
76f43abcbe Add checks for invalid parameters
Part of VTS test suite validation

related-to-bug: 32815560

Test: drm hal vts test
Change-Id: I52be29cd46f535482a761f98acf6ff28870c061c
2017-03-30 16:15:01 -07:00