Commit Graph

1234 Commits

Author SHA1 Message Date
Fred Gylys-Colwell
8138df1c86 Use mac keys from usage entry if keys are not loaded
Merge from Widevine repo of http://go/wvgerrit/27461

In order to sign a license release message, the mac keys from the
usage entry should be used whenever keys have not been loaded.

This CL updates the reference code, the unit tests, and the level 3
oemcrypto.

b/38203566
Test: unit tests passing on bullhead.

Change-Id: Ic71fee4b4b7b45801548ab80fbbbf8f4ccab3e6e
2017-05-19 15:56:11 -07:00
Jeff Tinker
da390f605a Merge "Revert "Fix widevine drm hal resource leaks"" into oc-dev am: 45c98e47f2
am: d4d3732aac

Change-Id: Ida0ae910dc68fdeb7758261cd3440414ba654949
2017-05-18 00:03:14 +00:00
Jeff Tinker
d4d3732aac Merge "Revert "Fix widevine drm hal resource leaks"" into oc-dev
am: 45c98e47f2

Change-Id: I5230438c6389769b67719590d2483727e8dc3941
2017-05-17 23:59:15 +00:00
TreeHugger Robot
45c98e47f2 Merge "Revert "Fix widevine drm hal resource leaks"" into oc-dev 2017-05-17 23:47:19 +00:00
Jeff Tinker
d2080a8b9f Revert "Fix widevine drm hal resource leaks"
This reverts commit 006506278a.

It needs to be reverted to fix b/38343960 on marlin.

This change is not needed since the root cause of the
resource leak was addressed in ag/2226738. 

Change-Id: I93b64d39103d574b7dcde6b1477839a50b64aefd
2017-05-16 22:20:20 +00:00
Tomasz Wasilczyk
2d4ba36414 Merge "Convert libwvdrmengine to soong." 2017-05-16 21:20:33 +00:00
Jeff Tinker
34db182735 Merge "Fix widevine drm hal resource leaks" into oc-dev am: 27deb32b79
am: d5934a8af4

Change-Id: If64712e19cc2a5d18b565b9a830ba5877c12d567
2017-05-15 20:32:55 +00:00
Jeff Tinker
d5934a8af4 Merge "Fix widevine drm hal resource leaks" into oc-dev
am: 27deb32b79

Change-Id: I38c2af0efde3c95c8399e0cb5118c8880864f2df
2017-05-15 20:09:19 +00:00
TreeHugger Robot
27deb32b79 Merge "Fix widevine drm hal resource leaks" into oc-dev 2017-05-15 19:53:54 +00:00
Fred Gylys-Colwell
2cd640d95d Merge "Avoid calling DeleteUsageEntry for OEMCrypto v13" into oc-dev am: 0a02017009
am: 0947339468

Change-Id: I88982d49e05c22a3faae69bb78b5deaa5dff23cb
2017-05-13 05:46:35 +00:00
Fred Gylys-Colwell
0947339468 Merge "Avoid calling DeleteUsageEntry for OEMCrypto v13" into oc-dev
am: 0a02017009

Change-Id: I93b6587c97d8325cc1b2ccbb88e585e5f4053d11
2017-05-13 05:44:05 +00:00
Fred Gylys-Colwell
0a02017009 Merge "Avoid calling DeleteUsageEntry for OEMCrypto v13" into oc-dev 2017-05-13 05:39:10 +00:00
Edwin Wong
0db7bc633d Merge "Fix GTS testL3PlayHDCPV* tests." into oc-dev am: dcf78b1062
am: fd71455558

Change-Id: Id0bb03cd4f1c3b1b1896a6bdeb643bc9a7539aac
2017-05-13 04:22:00 +00:00
Edwin Wong
fd71455558 Merge "Fix GTS testL3PlayHDCPV* tests." into oc-dev
am: dcf78b1062

Change-Id: I0a8ad43b626e7ed1e99833dd3d32c8f4bc479f81
2017-05-13 04:19:29 +00:00
Edwin Wong
dcf78b1062 Merge "Fix GTS testL3PlayHDCPV* tests." into oc-dev 2017-05-13 04:15:55 +00:00
Fred Gylys-Colwell
7d5b88a06a Avoid calling DeleteUsageEntry for OEMCrypto v13
Merge from Widevine repo of http://go/wvgerrit/27182

This function is not defined for v13, and should not be called by the
adapter.

b/38203780
Test: Ran unit tests specified in bug, on sailfish.

Change-Id: I38b1cc8493dd22da724f415f28d94f47d6d9c942
2017-05-12 17:26:24 -07:00
Edwin Wong
d751e81790 Fix GTS testL3PlayHDCPV* tests.
These tests verify whether a L3 device respects the HDCP policy set in the
license request. L3 device should only play the clear lead, and stop at
encrypted content. MeidaDrm should throw an ERROR_INSUFFICIENT_OUTPUT_PROTECTION
exception. This is because L3 device always returns current HDCP connection
status as HDCP_NONE.

This CL modifies the policy engine CanDecryptContent method to return
CdmResponseType instead of a boolean, so the app can generate the correct
error response if HDCP constriants are not met.

Test: GTS tests
  ANDROID_BUILD_TOP= ./android-gts/tooadefed run gts -m GtsMediaTestCases --test
  com.google.android.media.gts.WidevineDashPolicyTests#testL3PlayHDCPV*Required

Test: unit tests
  adb shell /data/app/policy_engine_unittest
  adb shell /data/app/policy_engine_constraints_unittest

Test: Play Movies

bug: 34258607
Change-Id: I11fc9da1e077e18e38f34159daae9d8ebcd948b6
2017-05-12 16:55:26 -07:00
Rahul Frias
adce58d758 Fix deadlock when pending key release sessions are deallocated am: 02fe2ef693
am: 54876569de

Change-Id: I86596123026ea88bb95178fbd48182101cc4ea1c
2017-05-12 22:29:26 +00:00
Rahul Frias
54876569de Fix deadlock when pending key release sessions are deallocated
am: 02fe2ef693

Change-Id: Ic6ac79dbb24ffd3fd137c4149167618f74f398b6
2017-05-12 22:27:21 +00:00
Rahul Frias
02fe2ef693 Fix deadlock when pending key release sessions are deallocated
[ Merge from http://go/wvgerrit/27261/ ]

Sessions created to release keys are periodically cleaned up if the
key release operation does not complete within a specific
amount of time. If other sessions are open, they will be released
through the timer thread. This would result in deadlock as a mutex
was taken twice.

Test: Verified by cdm_extended_duration_test
(AutomatedOfflineSessionReleaseOnOpenSession and
AutomatedOfflineSessionReleaseOnTimerEvent tests)

b/37546078

Change-Id: I7d45f939bdce77e5db461a401364da4f42c1c034
2017-05-11 20:12:33 -07:00
Tomasz Wasilczyk
33f9979b2b Convert libwvdrmengine to soong.
Bug: 37512442
Test: mmm -j50 vendor/widevine/libwvdrmengine/
Change-Id: I45b06b7f14ca4f65031bbc3806808a191156ee7b
2017-05-11 11:10:37 -07:00
Jeff Tinker
006506278a Fix widevine drm hal resource leaks
A strong pointer cycle was preventing the drm plugin
from being released.  This change converts the listener
to a weak pointer to break the cycle.

bug:36408047
test: manual testing to verify leaks are fixed
Change-Id: I2e2af392c2b263b7b0943d61dcaee5e94089ce27
2017-05-09 14:31:07 -07:00
Fred Gylys-Colwell
751d4b0d71 Remove TODO logs from dynamic adapter am: ee283ec61c
am: e76930cf14

Change-Id: Id4f6c9cd0dc8f303e11609b2530ec288764ac0e6
2017-05-06 01:39:17 +00:00
Fred Gylys-Colwell
e76930cf14 Remove TODO logs from dynamic adapter
am: ee283ec61c

Change-Id: I9c1fbea53e5fb94738ba4159772d891628a85986
2017-05-06 01:31:16 +00:00
Fred Gylys-Colwell
ee283ec61c Remove TODO logs from dynamic adapter
Merge from Widevine repo of http://go/wvgerrit/26943

b/37987506

Test: built and run unit tests on sailfish -- no new failures.  Ran
Netflix on sailfish.

Change-Id: I96f8bb7a5c060fefd116b165406ce6bfad29f59d
2017-05-05 17:00:08 -07:00
Fred Gylys-Colwell
b0740b5965 Remove unused variables from mips build am: 35fc4edc11
am: 8a66118d7a

Change-Id: Ibcc045eadfa4ea48082148bdab3e7b482b9454a9
2017-05-05 17:13:31 +00:00
Fred Gylys-Colwell
8a66118d7a Remove unused variables from mips build
am: 35fc4edc11

Change-Id: I25e9f2deb3b729c7bd303fd08dc91aea66922f75
2017-05-05 17:03:56 +00:00
Fred Gylys-Colwell
35fc4edc11 Remove unused variables from mips build
Merge from Widevine repo of http://go/wvgerrit/26940

b/38014227
b/38016711
Test: built sdk_phone_mips

Change-Id: Ibcdbf49f96e976f51c38db25a944268a86a1671e
2017-05-05 07:55:36 -07:00
Fred Gylys-Colwell
5f1e21e1f1 Refresh Current Key in Level 3 am: 38b5e8c71c
am: 9dec53c46c

Change-Id: I93173fbb539bc1ac5ed1e41b3693d4bc9fede542
2017-05-05 01:56:10 +00:00
Fred Gylys-Colwell
9dec53c46c Refresh Current Key in Level 3
am: 38b5e8c71c

Change-Id: I2c133746b2775649df5dbc140b55ee5992f68036
2017-05-05 01:48:10 +00:00
Fred Gylys-Colwell
7b2732169c Deliver oem_certificate_generator
Merge from Widevine repo of http://go/wvgerrit/26880
and http://go/wvgerrit/26062

Deliver oem_certificate_generator

b/37996004
Testing: Tool delivery only

Change-Id: Id95bd3cdd7cf5b48d225624747ab1f8499e4f438
2017-05-05 00:12:26 +00:00
Fred Gylys-Colwell
38b5e8c71c Refresh Current Key in Level 3
Merge from Widevine repo of http://go/wvgerrit/26780
and http://go/wvgerrit/26740

Previously, in oemcrypto level 3, a session's current key's duration
was not updated until the next call to SelectKey.  This caused
problems with license that only used one key.  This CL fixes that.

arm64/libwvlevel3.a            Level3 Library 7283 May  2 2017 13:16:21
arm/libwvlevel3.a              Level3 Library 4445 May  2 2017 11:49:34
x86_64/libwvlevel3.a           Level3 Library 7284 May  2 2017 12:09:21
x86/libwvlevel3.a              Level3 Library 4464 May  2 2017 11:53:46

Test: unit tests run on emulator.
b/37481239
b/37523523

Change-Id: Ife90a3358b6620c8fb81324ec2331d3775a38191
2017-05-03 11:53:49 -07:00
Steven Moreland
680f23d350 Remove redundant dependencies
android.hidl.base@1.0 and android.hidlmanager@1.0 are built into libhidltransport.

Test: links
Bug: 33276472
Change-Id: Id9053e4484275e3404f31a72d2037884ff6bef5b
(cherry picked from commit 80ec937545)
2017-05-02 21:52:59 +00:00
Fred Gylys-Colwell
b37ab7eead Merge changes I10721146,I5ab5f554,Ie92379dc
* changes:
  OEMCrypto Mock should not downgrade SRM
  Fix SRM Version in mock
  OEMCrypto Logging
2017-05-02 18:38:32 +00:00
Fred Gylys-Colwell
fb10272f55 OEMCrypto Mock should not downgrade SRM
Merge from Widevine repo of http://go/wvgerrit/26560

With this CL, the modifiable oemcrypto mock will only update the SRM
version number if the new number is greater than or equal to the
current one.

b/37744957

Change-Id: I10721146ca0ce24b1087657e18569a434e5d53b8
2017-05-01 14:49:10 -07:00
Fred Gylys-Colwell
1e451340ba Fix SRM Version in mock
Merge from Widevine repo of http://go/wvgerrit/26522

The modifiable OEMCrypto mock did not use the correct initial SRM
version as specified in the options file.  This CL fixes that.

b/37713658

Change-Id: I5ab5f5549dd7815edd4a3d69b804440faedeb657
2017-05-01 14:42:48 -07:00
Steven Moreland
80ec937545 Remove redundant dependencies
android.hidl.base@1.0 and android.hidlmanager@1.0 are built into libhidltransport.

Test: links
Bug: 33276472
Change-Id: Id9053e4484275e3404f31a72d2037884ff6bef5b
2017-05-01 11:25:23 -07:00
John W. Bruce
a5310bcf0c Prefix ENABLE_MEDIADRM_64 with TARGET_ am: 6262f3721f
am: 2e337abdfb

Change-Id: Iae43cc735930b4d04f7990e7b7c28fd3dd74d7e5
2017-04-29 00:02:00 +00:00
John W. Bruce
6262f3721f Prefix ENABLE_MEDIADRM_64 with TARGET_
This build-time flag should be prefixed.

Bug: 37039525
Test: Built OS
Change-Id: Ie1db1f05bdaf43e4066d26a41391af0d7c729128
2017-04-27 18:50:05 -07:00
Fred Gylys-Colwell
ad94e69d03 OEMCrypto Logging
Merge from Widevine repo of http://go/wvgerrit/26521

This CL adds some missing logging when TraceOEMCryptoCalls is set.
Several SRM functions were not properly logged.

It also changes SelectKey from the TraceOEMCryptoCalls flag to the
TraceDecryptCalls.  This reduces flooding the logs when content is
actually playing.

b/37751139

Change-Id: Ie92379dc295c83d8ec9bacb2445b1ef47377e4cf
2017-04-27 21:47:56 +00:00
John Bruce
f76986d707 Merge changes I490befba,I32512a3e into oc-dev am: e434bb3975
am: 64cbdf8204

Change-Id: I88e8d382c6057f23973656a4cbf767bf00dc0ba1
2017-04-21 05:49:37 +00:00
John Bruce
e434bb3975 Merge changes I490befba,I32512a3e into oc-dev
* changes:
  Remove API Version TODO Comments
  Define Provisioning-Unique ID for New Device IDs
2017-04-21 05:38:38 +00:00
Fred Gylys-Colwell
426e53bbbf OEMCrypto Mock SRM functionality
Merge from Widevine repo of http://go/wvgerrit/24730

This CL adds SRM functionality to the modable version of oemcrypto
mock.  This can be used for end-to-end testing.

b/28955873
b/37353534

Change-Id: I2c6f513495ccfd42f7a3d7a3449db6f810563c04
2017-04-20 14:50:43 -07:00
Fred Gylys-Colwell
5c768c896e Modifiable OEMCrypto
Merge from Widevine repo of http://go/wvgerrit/24729

This CL adds a new variant of the OEMCrypto mock code that adjusts its
behaviour based on a configuration file.  This is intended for
testing.

For example, a tester can set current_hdcp to 2 in the options.txt
file, push it to the device, and verify that a license is granted for
HDCP 2.0.  Then the tester can edit the value of current_hdcp to 1 and
push the file to the device.  Playback should stop because the license
is no longer valid.

This variant uses a real level 1 liboemcrypto.so to push data to a
secure buffer.  That means we can test playback for a license that
requires secure buffers on an Android device with real secure buffers.

b/35141278
b/37353534

Change-Id: Id12f2800c6395d9da7cffebd6797aac17414b38d
2017-04-20 14:50:43 -07:00
Fred Gylys-Colwell
ab0d00b92a Use Inheritence for OEMCrypto Mock Properties
Merge from Widevine repo of http://go/wvgerrit/24728

We use compiler options to set different properties in the oemcrypto
mock.  With this CL, we define a base class that has default
properties.  All other variants need only define the properties that
they change.

b/35141278
b/37353534

Change-Id: Id38ec5bf35dcd83cea9a066ebe201e6da7c1a2b0
2017-04-20 14:48:48 -07:00
Fred Gylys-Colwell
86db60d097 Refine OEMCrypto Mock Logging
Merge from Widevine repo of http://go/wvgerrit/24727

This separates out the logging of decrypt calls from all other calls.
This is useful because we sometimes want to trace all the calls in a
license request, but we don't want logging of decrypt calls which
would slow down playback.

b/37353534
b/35141278

Change-Id: I3f172c02778d86e66d0e1f90344a34c4d3b15a9e
2017-04-20 14:40:38 -07:00
John Bruce
7ef74bf0bc Merge changes Ib82cf7a1,Ice6a8eab into oc-dev am: 3c37343e5c
am: cd3fd8c24b

Change-Id: I628b98c3c02b4367dfc460e040c576c2b131d614
2017-04-20 19:05:07 +00:00
John Bruce
2c963f242d Merge "Move SPOID Enable/Disable Logic Out of WVDrmPlugin" into oc-dev am: 9574bc849a
am: 37e7e51090

Change-Id: Iccb9c0ed6a373fa02758c899242e02aa63195271
2017-04-20 19:04:57 +00:00
Rahul Frias
54b2b6a595 Merge "Prevent segfaults when a session is deallocated" into oc-dev am: 518ce632f7
am: 1627bd1b41

Change-Id: Iba8053f83a17f5ca181c1410cf02f513903c0395
2017-04-20 19:04:45 +00:00
John Bruce
3c37343e5c Merge changes Ib82cf7a1,Ice6a8eab into oc-dev
* changes:
  Hash OEM Certificate
  Maxing Out Sessions Can Cause SPOID Failures
2017-04-20 17:21:46 +00:00