Commit Graph

3386 Commits

Author SHA1 Message Date
Robert Shih
b1ee517ff1 Add odk_test to platform tests
Bug: 150158890
Test: build & inspect platform_tests.zip
Change-Id: I06c0acd0f7fed168e8e2ad876a58983b11d9b43f
2020-02-27 21:35:30 +00:00
Fred Gylys-Colwell
0947bd185b Fix nonce problem in license renewal
Merge from Widevine repo of http://go/wvgerrit/94523

For OEMCrypto v16, a renewal does not get a new nonce.

Bug: 149856581
Test: WvCdmRequestLicenseTest.StreamingLicenseRenewal
Change-Id: I258f0bcb9c9a417310785f130d32d66fa7430185
2020-02-26 14:32:24 -08:00
Fred Gylys-Colwell
7f006997cb Change some test EXPECT to ASSERT to avoid segfaults
Merge from Widevine repo of http://go/wvgerrit/94505

Some tests use an EXPECT when checking an array size or to verify a
pointer is not null. Then they access the pointer or array. When they
use an EXPECT, this access results in a segfault.

I also removed a compiler warning about unused parameters.

Bug: 149856581
Test: request_license_test (now lists failed tests)
Change-Id: I08ac11250921245c89ed5c0c43cc5f4321e0a9cc
2020-02-26 13:11:25 -08:00
Alex Dale
9c60d1e1ae Adding app package name to license request.
[ Merge of http://go/wvgerrit/94323 ]

Content providers wish to know the application package name that is
requesting a license from the content server.  The app package name that
is provided to the CDM during initialization is provided to the client
identification message as a key-value pair during license request
generation.  App packages names are keyed under 'application_name'.

This feature was tested manually by scraping the content of the license
request for YouTube TV.

Bug: 148689078
Test: manual
Change-Id: I6b65f2ab9845dbea37aaaab76ecea25c228bde5b
2020-02-20 13:23:16 -08:00
TreeHugger Robot
f13cbff0cd Merge "Adjust provisioning retry" 2020-02-20 04:36:48 +00:00
Robert Shih
838788cf00 Merge "wv hidl: only mediashell/mediadrmserver can call signRSA" 2020-02-20 00:46:35 +00:00
Fred Gylys-Colwell
18da273c42 Adjust provisioning retry
Merge from Widevine repo of http://go/wvgerrit/94243

When generating a second provisioning request, a new session should be
opened because a session can only have one nonce for v16.

For Provisioning 3.0 devices, the OEM Cert's private key must be
loaded in the new session.

Test: WvCdmRequestLicenseTest.ProvisioningInterposedRetryTest
Bug: 135288420 Nonce reuse
Bug: 141655126 Cert reload
Change-Id: I8a96566142c4d4380e2bdd571e8d363a7a1f74d4
2020-02-19 13:42:55 -08:00
Robert Shih
be7b89e155 wv hidl: only mediashell/mediadrmserver can call signRSA
Merge of go/wvgerrit/93524

Bug: 134787536
Bug: 148895349
Test: VtsHalDrmV1_3TargetTest
Change-Id: I48fb63d044271243fa1d290443d437f0697994d3
2020-02-19 13:38:23 -08:00
John W. Bruce
a62886b925 Combined Decrypt Calls
(This is a merge of http://go/wvgerrit/93829,
http://go/wvgerrit/93830, http://go/wvgerrit/93832,
http://go/wvgerrit/93833, and http://go/wvgerrit/93834 from the
Widevine repo.)

This implements the CDM code changes necessary to take advantage of
Combined Decrypt Calls on OEMCrypto v16. The result of this is that
WVCryptoPlugin is much lighter now because it can pass the full sample
down to the core in one call, but CryptoSession is heavier, as it now
has to handle more complex fallback logic when devices can't handle
multiple subsamples at once.

This patch also removes support for the 'cens' and 'cbc1' schema, which
are being dropped in OEMCrypto v16. This fixes an overflow in the code
for handling those schemas by removing it entirely.

This patch also fixes the "in chunks" legacy decrypt path to use larger
chunk sizes on devices with higher resource rating tiers.

Bug: 135285640
Bug: 123435824
Bug: 138584971
Bug: 139257871
Bug: 78289910
Bug: 149361893
Test: no new CE CDM Unit Test failures
Test: Google Play plays
Test: Netflix plays
Test: no new GTS failures
Change-Id: Ic4952c9fa3bc7fd5ed08698e88254380a7a18514
2020-02-19 11:44:35 -08:00
Rahul Frias
3708c4d53f Merge changes I442b7919,Ie5b4ff75
* changes:
  Improve android MediaDrm property latency
  Delay OEMCrypto Termination
2020-02-19 15:51:14 +00:00
Rahul Frias
0e02d6a1f6 Merge changes Iacbbd51a,Id925ddcc
* changes:
  Add policy handling for v16
  More policy engine/timers refactoring
2020-02-19 15:37:35 +00:00
Rahul Frias
c033892f2a Add policy handling for v16
[ Merge of http://go/wvgerrit/93865 ]

This allows for handling of timer and clock values as supported when both
the license service and the OEMCrypto on the device support v16.
A flag based on a value in the SignedResponse license indicates
whether this support should be enabled. A new class PolicyTimerV16
performs the duration value evaluation.

Bug: 139372190
Test: Android WV unit/integration tests
Change-Id: Iacbbd51ad26c9f29cb5418ff832f8822982644b7
2020-02-18 22:33:47 -08:00
Rahul Frias
68587be8a0 More policy engine/timers refactoring
[ Merge of http://go/wvgerrit/93838 ]

Some more rework of policy engine/policy timers code to support
timer and clock value handling introduced by OEMCrypto v16.

Changes are
* renamed methods to include rental duration since policies for v16 use
  rental and playback duration for all licenses. Previously rental and
  playback durations enforced timing for persistent licenses and license
  duration was used for streaming licenses.
* Moved some common code to the base PolicyTimer class from
  PolicyTimerV15.
* Corrected data member naming (policy_timers -> policy_timers_)
* Updated comments

Bug: 139372190
Test: Android WV unit/integration tests
Change-Id: Id925ddcc14608a8500f30c2c68486d91608a9abe
2020-02-18 22:29:49 -08:00
TreeHugger Robot
5a08937110 Merge "Remove unused parameters" 2020-02-19 05:52:39 +00:00
Alex Dale
c1cb64a0dc Merge "LRU algorithm adapts to usage table capacity." 2020-02-19 02:18:03 +00:00
Fred Gylys-Colwell
3012ff29bd Use staging provisioning server
Merge from Widevine repo of http://go/wvgerrit/94067

The android tests should use the staging provisioning server until
production is able to support core messages.

Test: ran WvCdmRequestLicenseTest.ProvisioningTest with v16 mod mock
Bug: 149622735
Change-Id: I4ec0cc8e8474dc4250e092473fef90d7358260de
2020-02-18 14:26:29 -08:00
Alex Dale
4a8aeb29ef LRU algorithm adapts to usage table capacity.
[ Merge of http://go/wvgerrit/93564 ]

OEMCrypto v16 introduced the ability to report the maximum possible
size of the usage table to the CDM.  The LRU algorithm will take the
table capacity into account when deciding which entry is removed.

Bug: 148795097
Bug: 135298906
Test: CDM unit tests
Change-Id: Ibba88813618c13a9bf1121e560b8cc02b1c7e7a6
2020-02-18 12:22:23 -08:00
Rahul Frias
78d2fa5e9e Improve android MediaDrm property latency
[ Merge of http://go/wvgerrit/89848 ]

Apps query a number of properties at initialization. The mediaDrm
API getProperty allows the query of a single property at a time.
This causes a series of requests. If no crypto
sessions are concurrently open, a series of expensive OEMCrypto
Initialization and Termination calls will occur.

In this change OEMCrypto termination is delayed. If an OEMCrypto
Terminate is followed in close succession by an Initialize, neither
will occur avoiding the overhead. A timer enables a countdown process.
If no session activity occurs, the timer will eventually terminate
OEMCrypto and exit.

Bug: 136282358
Test: Android unit/integration tests
Change-Id: I442b7919b4e7835c52583516c8bc64d0c150241d
2020-02-17 20:50:32 -08:00
Rahul Frias
ea2e110213 Log test name
[ Merge of http://go/wvgerrit/94083 ]

Logs the test case and test name when widevine android unit/integration
tests are run.

Bug: 149664134
Test: wv unit/integration tests
Change-Id: I446b88aa2954a386765e4559358d386b1a263913
2020-02-16 23:30:26 -08:00
Fred Gylys-Colwell
2446b85322 Remove unused parameters
Merge from Widevine repo of http://go/wvgerrit/94043

Remove some unused parameters from test code. These had been
generating compiler warnings.

Bug: 149592532
Test: built and ran unit tests on crosshatch
Change-Id: If1325edc3418f77d620ce3765496ef17156bc624
2020-02-15 12:15:06 -08:00
Rahul Frias
068035140b Delay OEMCrypto Termination
[ Merge of http://go/wvgerrit/89847 ]

This adds a platform specific property that allows OEMCrypto Termination
calls to be delayed. On android this allows a way to avoid
expensive back to back OEMCrypto_Terminate followed by Initialize
calls.

Bug: 136282358
Test: wv unit/integration tests
Change-Id: Ie5b4ff7503dafe77d974caac9c52fc1f169dec89
2020-02-15 01:34:02 -08:00
Fred Gylys-Colwell
d7492082c6 Fix logging for buildbot
Merge from Widevine repo of http://go/wvgerrit/93686

This CL changes some test logging so that it is always on a single
line, even if verbose logging is turned on.

Test: unit tests
Bug: 149119926

Change-Id: I9473f6e559ff543ced47a7fa3900615866a25688
2020-02-14 23:00:28 +00:00
Alex Dale
c9f586f81a Updated expected resource rating for integration tests.
[ Merge of http://go/wvgerrit/93603 ]

When the new "very high" resource rating tier was introduced, the
Android integration test was not updated to accept this value.  The
integration test has now been updated to use "min" and "max" instead
of fixed levels.  This will make future updates easier.

Bug: 140831533
Test: Android integration test (on master)
Change-Id: Ib92bf0afbfbfd81b46c90243651396dfcb74b91f
2020-02-14 10:08:32 -08:00
Rahul Frias
2068fa4a2b Merge "Query Usage Table Size bug" 2020-02-14 17:51:17 +00:00
Rahul Frias
a85a0726a3 Merge changes I420fb181,Id0c38b45
* changes:
  Policy Engine refactoring
  Update license proto
2020-02-14 01:47:59 +00:00
Fred Gylys-Colwell
eeeb0304ed Don't use empty core message
Merge from Widevine repo of http://go/wvgerrit/93824

This treats an empty core message as not having a core message.

Bug: 149110740
Change-Id: Icacfc5d9a5bdce9b136c25c59205eee575cfba72
Tests: Ran ExoPlayer on taimen
2020-02-12 14:36:45 -08:00
Rahul Frias
c2cee8406e Policy Engine refactoring
[ Merge of http://go/wvgerrit/93743 ]

Reworks policy engine in preparation for changes to support timer and
clock value handling by OEMCrypto core messages in OEMCrypto v16.

No major functional changes have yet been introduced. Time and duration
evaluation has been devolved to a new policy timer class. Policy
specific to licenses that do not support OEMCrypto core messages
is handled by a Policy Timer V15 class. This ensures backward compatibility.

Backward compatibility may be needed if
 * OEMCrypto has not been upgraded to v16
 * Licenses were persisted before the device was upgraded to v16
 * License service does not yet support core messages

Some minor changes to when the current time was retrieved required
minor modification to test expectations.

Bug: 139372190
Test: Android unit/integration tests
Change-Id: I420fb181f656ed9a6bfe54f09e8b398c130d23da
2020-02-12 01:00:08 -08:00
Rahul Frias
c2cea58d0b Update license proto
[ Merge of http://go/wvgerrit/93506 ]

This updates the license_protocol.proto to match the one used by
the license service. It introduces new fields such as
|soft_enforce_rental_duration|. Additional changes address proto field
naming changes.

Bug: 139372190
Test: WV android unit/integration tests
Change-Id: Id0c38b457e9079c0afc6848c355c07f96a19e073
2020-02-11 13:19:05 -08:00
Rahul Frias
2303341cb4 Query Usage Table Size bug
[ Merge of http://go/wvgerrit/93745 ]

Address a missing return statement.

Bug: 139397537
Test: WV unit/integration tests
Change-Id: I35cfc432766c7ba90d97fea5eb2d1a4f15ca0942
2020-02-10 10:18:30 -08:00
TreeHugger Robot
6a0cc01e0f Merge "Address review comments and sync branches" 2020-02-07 23:27:36 +00:00
Fred Gylys-Colwell
a3477aab03 Address review comments and sync branches
This CL merges some missed pieces of the merge from Widevine repo of
http://go/wvgerrit/93405

Test: unit tests
Bug: 147879734, 147396294, 141247171
Change-Id: I3b92b983f68f6a529f109bc5dec91b313e3fd7fb
2020-02-07 14:12:26 -08:00
Alex Dale
d07a784afa Merge "Small fixes leftover from V16 merge." 2020-02-07 21:25:17 +00:00
Alex Dale
8977119d05 Small fixes leftover from V16 merge.
[ Merge of http://go/wvgerrit/93505 ]

During the merge process there were a few CL comments (ag/10122083)
that were not able to be addressed.  Most changes in the CL are
spelling / grammar corrections.

Bug: 148907684
Bug: 141247171
Test: CDM unit tests
Change-Id: I9a8648525bbe5ed319521ebf01741a958ab69ae2
2020-02-06 17:44:45 -08:00
TreeHugger Robot
8f9e5d7bb2 Merge "Update Pi document" 2020-02-06 02:40:10 +00:00
TreeHugger Robot
85f7822385 Merge "Update version number in OEMCrypto header" 2020-02-06 02:08:30 +00:00
Fred Gylys-Colwell
3787504466 Update Pi document
Merge from Widevine repo of http://go/wvgerrit/92103

The document "docs/Upgrading_Widevine_Drm_to_Pi.pdf" has been updated
to version 1.1, which includes comments about updating level 3 data
when a device is updated from N to P, skipping O.

Bug: 137045379
Test: docs only.
Change-Id: I448efa34d1d3a40aec0b1aa14cf40ddd58846e63
2020-02-05 17:02:56 -08:00
Fred Gylys-Colwell
de06052c7c Update version number in OEMCrypto header
Merge from Widevine repo of http://go/wvgerrit/93507

Test: comment only change
Bug: 147038692
Change-Id: I5a5f1818594dfd95d916c7d1d3ae2795d3b6477f
2020-02-05 16:30:27 -08:00
Fred Gylys-Colwell
0d0235ae0e Merge changes from topic "oemcrypto-v16"
* changes:
  OEMCrypto v16.2
  OEMCrypto v16.1
2020-02-05 16:10:47 +00:00
Fred Gylys-Colwell
db2050dff1 OEMCrypto v16.2
Merge from Widevine repo of http://go/wvgerrit/93404

This is the unit tests, reference code, and documentation for
OEMCrypto v16.2. Backwards compatibility should work for a v15
OEMCrypto.

Some review comments will be addressed in future CLs.

Bug: 141247171
Test: Unit tests
Test: Media GTS tests on bonito
Change-Id: I9d427c07580e180c0a4cfdc4a68f538d351c0ddd
2020-02-04 20:33:16 -08:00
Fred Gylys-Colwell
7665614b2e OEMCrypto v16.1
Merge of http://go/wvgerrit/93404

This CL updates the Widevine CDM to support OEMCrypto v16.1

Test: Tested in 16.2 CL
Bug: 141247171
Change-Id: I69bd993500f6fb63bf6010c8b0250dc7acc3d71b
2020-02-03 14:45:32 -08:00
Alex Dale
d5bee31c24 Added HDCP V2.3 to known supported values in GTS.
[ Merge of http://go/wvgerrit/92546 ]

The integration test for L1 and L3 HDCP levels was missing an
acceptable value of QUERY_VALUE_HDCP_V2_3.

Bug: 147396294
Test: Android integration test
Change-Id: I66f7164b7b6a6d63f81fdcfffff0d2d891fd5699
2020-02-03 10:37:12 -08:00
John Bruce
7e2619e379 Merge "Improvements to TestBase" 2020-01-31 01:48:37 +00:00
John W. Bruce
1bc1bad1f0 Improvements to TestBase
This patch merges some features that were added to TestBase in
http://go/wvgerrit/92349 in the Widevine Repo. Certain parameters to
TestBase that could have been const but weren't now are. The caller to
Initialize() can now specify additional, platform-specific help text to
be displayed after the generic help text. And some missing headers were
added to test_base.h.

The Android code does not yet take advantage of any of this, but it
could in the future.

Bug: 145013234
Test: Android Unit Tests
Change-Id: I3c54532a39641622d454256b25979ad89727d43f
2020-01-30 16:15:46 -08:00
Automerger Merge Worker
80b5b74683 Fix warnings on 64-bit-only builds am: 42fa6275e2
Change-Id: I05c4ca1d8849636d2950e1d52e4d42a46438dbfc
2020-01-30 19:14:58 +00:00
Dan Willemsen
42fa6275e2 Fix warnings on 64-bit-only builds
These tests set `LOCAL_MODULE_TARGET_ARCH := arm x86` unless
TARGET_ENABLE_MEDIADRM_64 is true, so for 64-bit-only configurations
that don't set this, these tests are disabled.

Test: lunch armv8-eng; m nothing  -> see fewer warnings
Change-Id: I7ca0e8c382eb9930b8b1477ee8c9f1ea40c6888f
2020-01-30 01:38:54 +00:00
Rahul Frias
aeb41ef5b3 Address cdm_extended_duration_test failures
[ Merge of http://go/wvgerrit/92783 ]

The integration test suite cdm_extended_duration_test are failing to run
successfully. This is an interim step which corrects a few failures
including the the PSSH used by some of the tests. Follow on CLs will
address other test failures.

Bug: 148090831
Test: cdm_extended_duration_test (VerifyLicenseRequestTest,
      VerifyLicenseRenewalTest, MaxUsageEntryOfflineRecoveryTest)

Change-Id: I918353bfcd6ad2442c40bf0ddb8e3b07232af03d
2020-01-27 11:45:53 -08:00
John W. Bruce
169c5b3d10 Revert "Fix IV handling for pattern encryption."
(This is a merge of http://go/wvgerrit/92191)

This reverts commit 8fe569cc1265021e275a9bccbc362ebd2ba3be5f.

The ISO-CENC spec is ambiguous about how to handle the early truncation
of the pattern in the 'cens' and 'cbcs' schema. We originally
interpreted it to mean "follow the pattern until you run out of full
crypto blocks" and shipped the Android and OEMCrypto code accordingly.
Later, however, other engineers at Google asserted that it should mean
"follow the pattern until you run out of enough crypto blocks to follow
the encrypted part of the pattern", which is subtly different when the
number of encrypted blocks in the pattern is greater than 1. We made
changes to start accommodating this. However, after further discussion,
everyone is in agreement that the original behavior was correct. So I am
reverting the "fixes" that had already been made.

This has no practical effect, since it only affects 'cens' content with
a pattern that has more than one encrypted block, and as far as we know,
no one has ever generated content like that. Shaka Packager is not
capable of generating content like that.

Bug: 111001481
Test: No new Android Unit Tests failures
Change-Id: I8f0292b1222d6af9a0ae33d6cb91707fd40101f4
2020-01-15 16:42:52 -08:00
Marco Nelissen
13a2504840 Link with actual headers instead of symlinks
Bug: 143245419
Test: build
Change-Id: I5981593697229c1f3314a4a8a4d0c447d7cbe808
2020-01-07 15:26:14 -08:00
Marco Nelissen
8af30972b2 Link with actual headers instead of symlinks
Bug: 143245419
Test: build
Change-Id: Iff096c2d3568f2db4260a1d2a86d2746ea4824ed
2020-01-07 13:21:05 -08:00
Alex Dale
75ecbc4dd2 Merge "Included metrics for LRU replacement." 2019-12-18 18:38:34 +00:00