Commit Graph

4883 Commits

Author SHA1 Message Date
Alex Dale
cbb1d11a72 Merge "Include "origin" in license request client ID" 2020-11-03 00:52:45 +00:00
Rahul Frias
37be367712 Merge "Address test failures" 2020-11-03 00:52:05 +00:00
TreeHugger Robot
4447748573 Merge "Avoid setting OEMCrypto_Algorithm enum vars with invalid values" 2020-11-03 00:49:11 +00:00
Rahul Frias
b1f54bbba8 Add Duration Use Case integration tests
Cherry pick from http://go/wvgerrit/102986, rvc-dev branch of
http://go/wvgerrit/105825, rvc-widevine-release of http://go/ag/12561661

This CL adds several integration tests that match the duration use
cases. The test classes are designed for the core cdm, but the test
cases match those found in oemcrypto/odk/test/odk_timer_test.cpp.

See this document for a list of use cases:
libwvdrmengine/docs/License_Duration_and_Renewal.pdf

Test: Ran the tests against v16 OEMCrypto. Some fail against v15.
Bug: 161463952
Change-Id: I7cd424ae241d3897fbd06956e87dd9da0752cb6d
2020-11-02 23:10:41 +00:00
Rahul Frias
d1dff772d3 Add some policy integration tests
Cherry-pick from branch rvc-dev of http://go/wvgerrit/105824 and
rvc-widevine-release http://go/ag/12561660

This adds two policy integration tests to verify that we are handling offline
licenses correctly.

Bug: 161023174
Bug: 129301787
Test: WV unit/integration tests
Change-Id: I20f5d6a9fbfd2ff8cff361e1005e45b46c700704
2020-11-02 00:44:02 -08:00
TreeHugger Robot
440fa8e164 Merge "Fix OpenSSL Builds" am: 712784055b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12905382

Change-Id: Ie4bcf32c77bf2963edee97d375fcde28e46f460f
2020-10-29 01:23:34 +00:00
Alex Dale
4028784836 Include "origin" in license request client ID
[ Merge of http://go/wvgerrit/108823 ]

Android CDM will include the session origin in the client info
component of the client ID of a license request.

The "origin" is only to be included on Android CDM, and not the CE
CDM.  The origin is provided to the license request via the app
parameters in the WVDrmPlugin.

A separate GTS test is in development and will be submitted to the
Android media GTS test set.

Bug: 164549928
Test: Manual test and GTS test
Change-Id: I67f8b064b2aefdc08328ea14551d4aa4cb57023d
2020-10-28 17:29:18 -07:00
TreeHugger Robot
712784055b Merge "Fix OpenSSL Builds" 2020-10-28 21:47:37 +00:00
Rahul Frias
42ecc6404b Address test failures
[ Merge of http://go/wvgerrit/104584 ]

This corrects failures in
* WVDrmPluginTest.ReturnsL3SpoidsWhenL3ProvisionedUsingL3Spoid
* WVDrmPluginTest.ReturnsL3SpoidsWhenL3Unprovisioned
* WVDrmPluginTest.ReturnsL1SpoidsWhenL3ProvisionedUsingL1Spoid

and a warning in
* PolicyEngineTest.PlaybackOk_RentalAndLicense0_WithPlaybackBeforeLicense_V15

Bug: 163542905
Test: WVDrmPluginTest and PolicyEngineTest
Change-Id: I3e7799175b7b289fafd2caf88bd5df4123b88973
2020-10-27 02:23:59 -07:00
Baligh Uddin
9415e9a70c [automerger skipped] Cleanup references to system/core/base -> system/libbase am: 673ca3c689 am: 2ccfaeac56 -s ours am: 43f6d79ffa -s ours
am skip reason: Change-Id I3412348b28b56b13702af14ce77238fac506efdd with SHA-1 fa9ce28dd3 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12917865

Change-Id: I2bd2b7440b227903e685cd3ecef17ed9a5c94a14
2020-10-26 23:42:34 +00:00
Baligh Uddin
43f6d79ffa [automerger skipped] Cleanup references to system/core/base -> system/libbase am: 673ca3c689 am: 2ccfaeac56 -s ours
am skip reason: Change-Id I3412348b28b56b13702af14ce77238fac506efdd with SHA-1 fa9ce28dd3 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12917865

Change-Id: Iada7de0093fff3dd77571fd6029a1c6de9e58be9
2020-10-26 23:25:27 +00:00
Baligh Uddin
2ccfaeac56 Cleanup references to system/core/base -> system/libbase am: 673ca3c689
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12917865

Change-Id: I6b48816ef96567b7c7f8aff643706f624b46a1b9
2020-10-26 23:12:52 +00:00
Baligh Uddin
563d681033 Cleanup references to system/core/base -> system/libbase am: fa9ce28dd3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12917859

Change-Id: I5b70d4775d84af64c809d6f75eb8af6390f82cce
2020-10-26 14:27:39 +00:00
Baligh Uddin
673ca3c689 Cleanup references to system/core/base -> system/libbase
BUG: 157656545
Test: TH
Merged-In: I3412348b28b56b13702af14ce77238fac506efdd
Change-Id: I9398826834a360afdf973c94afb11edcd65a6779
2020-10-26 03:32:32 +00:00
Baligh Uddin
fa9ce28dd3 Cleanup references to system/core/base -> system/libbase
BUG: 157656545
Test: TH
Change-Id: I3412348b28b56b13702af14ce77238fac506efdd
2020-10-25 18:23:39 +00:00
John W. Bruce
0f2a4a40dc Fix OpenSSL Builds
(This is a merge of the parts of http://go/wvgerrit/105985 that affect
Android.)

This patch fixes some files that, after recent changes, were no longer
building when using OpenSSL instead of BoringSSL. <memory> was missing
in a header, and a function whose return type is different on OpenSSL
was tripping up the format-string warnings.

Bug: 168553979
Test: jenkins/ce_cdm_tests
Test: Android CDM Build
Change-Id: Id6a33d0ce0d3cbe5fe33b3f22aa3ee6b03ac76dd
2020-10-22 18:00:09 -07:00
Rahul Frias
5151daec19 Avoid setting OEMCrypto_Algorithm enum vars with invalid values
[ Merge of http://go/wvgerrit/106203 ]

CdmSigningAlgorithm are converted into OEMCrypto_Algorithm enums
before being passed as parameters to OEMCrypto generic crypto functions.
The OEMCrypto_Algorithm variables should never be set to values not
specified in the enum declaration.

These private methods have also been moved to the anonymous namespace.

Bug: 168774486
Test: WV unit/integration tests
Change-Id: Ie570a3cf4447b6c133076baa0909d562824c8e4a
2020-10-22 16:39:19 -07:00
Rahul Frias
1bf0360d22 Merge changes I9a4977fd,I8ae5a10c,I0f9e6445 am: 1381746ecb
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12886534

Change-Id: I97cfa7efe2bb3e60051b0fe42fd319c51b9ed775
2020-10-22 10:41:25 +00:00
Rahul Frias
1381746ecb Merge changes I9a4977fd,I8ae5a10c,I0f9e6445
* changes:
  Update Widevine Copyright header
  Update Widevine Copyright header for core CDM
  Update Widevine Copyright header for android
2020-10-22 10:24:45 +00:00
TreeHugger Robot
fc374516b1 Merge "Merge recent doc changes for OEMCrypto" am: a53fb38be1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12566583

Change-Id: I138fafceca64b76a712b17caf2a960d7c579683f
2020-10-22 00:12:20 +00:00
TreeHugger Robot
a53fb38be1 Merge "Merge recent doc changes for OEMCrypto" 2020-10-21 23:15:27 +00:00
Rahul Frias
53019f0459 Update Widevine Copyright header
[ Merge of http://go/wvgerrit/108103 ]

The Widevine License Agreement has been renamed to use inclusive
language. This covers files in the cdm, linux, platform, util directory
in addition to some other files.

Bug: 168562298
Test: verified compilation (comment only change)
Change-Id: I9a4977fd4c2ad951769b6be84263f81bd0f22678
2020-10-21 12:54:20 -07:00
Rahul Frias
6a1f050ffc Update Widevine Copyright header for core CDM
[ Merge of http://go/wvgerrit/108064 ]

The Widevine License Agreement has been renamed to use inclusive
language. This covers files in the core directory.

Bug: 168562298
Test: verified compilation (comment only change)
Change-Id: I8ae5a10cbfdf7faae6a2735e57b33729763f10b8
2020-10-21 12:05:05 -07:00
Rahul Frias
ec8bed38f4 Update Widevine Copyright header for android
[ Merge of http://go/wvgerrit/108084 ]

The Widevine License Agreement has been renamed to use inclusive
language. This covers files in the android directory.

Bug: 168562298
Test: verified compilation (comment only change)
Change-Id: I0f9e6445e0168ebe85425baeb81371e182e5a39c
2020-10-21 02:49:05 -07:00
Alex Dale
8dec2e38d8 Merge "Query analog output capabilities." am: 471e8c900d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12850663

Change-Id: Ifff6d5613417954dc4b3541e6d97049b220d5ace
2020-10-19 23:28:08 +00:00
Alex Dale
471e8c900d Merge "Query analog output capabilities." 2020-10-19 23:01:32 +00:00
John Bruce
7ee2c28ab7 Merge changes I9432dd26,Id52b8c38 am: cc715b479d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12776079

Change-Id: Ic2b17ebd656e832dcf5775de49a1200bac4fcedf
2020-10-19 19:51:22 +00:00
John Bruce
cc715b479d Merge changes I9432dd26,Id52b8c38
* changes:
  Allow 1 or 2 GetOEMPublicCertificate Calls in Metrics Tests
  Fix TimeRollbackPrevention Test
2020-10-19 19:35:40 +00:00
Alex Dale
fb847c4704 Query analog output capabilities.
[ Merge of http://go/wvgerrit/107763 ]

This CL enables the ability to query the CDM for the analog output
capabilites of the device.  Due to the number of possibilities that
OEMCrypto can report, two queries are exposed:
- Output capabilities: None, Supported, CGMS-C, Unknown
- Can disable: True, False, Unknown

Bug: 168322023
Test: Android integration test
Change-Id: I8036a89237d698f170d2c1901c41d1d6b708c917
2020-10-15 17:46:13 -07:00
Ian Baker
a9228a2be6 Merge "Update GtsExoPlayerTestCases class name in WV script" am: be0218e48f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12717348

Change-Id: If28baa470493585cc1948d3089b4c1034f3796e2
2020-10-15 11:37:51 +00:00
Ian Baker
be0218e48f Merge "Update GtsExoPlayerTestCases class name in WV script" 2020-10-15 11:14:48 +00:00
Rahul Frias
5bd5e1d749 Merge "Avoid passing device ID when unused" am: bab666ecdc
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12545178

Change-Id: I29890a006c552897ccce70118c24b251c0674119
2020-10-11 23:47:34 +00:00
Rahul Frias
bab666ecdc Merge "Avoid passing device ID when unused" 2020-10-11 23:34:17 +00:00
John W. Bruce
25489dfa5b Allow 1 or 2 GetOEMPublicCertificate Calls in Metrics Tests
(This is a merge of http://go/wvgerrit/107263.)

The CryptoSessionMetricsTest suite assumed that GetOEMPublicCertificate
would only be called once, but in practice, it may be called twice,
since the first call can return OEMCrypto_ERROR_SHORT_BUFFER. This patch
updates the tests to accept 1 or 2 calls.

This patch also updates a few EXPECTs on vector lengths that should have
been ASSERTs, to avoid problems when later accessing the vector.

Bug: 169111969
Test: jenkins/ce_cdm_tests
Test: build_and_run_all_unit_tests.sh
Change-Id: I9432dd2694c7181ab57ed55f66ff6c8be0c867f9
2020-10-06 14:42:54 -07:00
John W. Bruce
48122e2c11 Fix TimeRollbackPrevention Test
(This is a merge of http://go/wvgerrit/107243.)

This code is based on a bug report and patch from Sony.

The TimeRollbackPrevention test was failing when run with CE CDM and the
OEC Ref, although it passed in some other configurations. The cause was
twofold:

1) The test sleep code was not accounting for rollback when calculating
   the clock drift, causing incorrect time values to elapse.
2) Fixing the previous exposed a bug in the CE CDM test host where it
   did not handle negative time passing correctly.

This patch expands Sony's fix with additional comments and some code
cleanup to try to make the code clearer and more robust against future
errors, particularly in the error-prone TestHost code.

Bug: 169942369
Test: jenkins/ce_cdm_tests
Test: build_and_run_all_unit_tests.sh
Test: x86-64, all CE CDM unit tests
Change-Id: Id52b8c38255f70b04bc2735c4e309fb90992f53e
2020-10-06 14:40:18 -07:00
Alex Dale
1569b14069 Test for creating and reloading usage entries. am: 927c2f628b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11988032

Change-Id: Iee1d1cc5fe6b597bcf3746f5f3e7df47441faf59
2020-10-02 22:36:42 +00:00
Alex Dale
927c2f628b Test for creating and reloading usage entries.
[ Merge from http://go/wvgerrit/102303 ]

This adds an OEMCrypto test that ensures that usage entries can be
loaded and reloaded without issue within the same crypto client
lifecycle.  This is in response to b/158273241 where certain entries
could not be reloaded if new entries are created and loaded in a
particular order.

Bug: 158619296
Test: OEMCrypto test on Android
Change-Id: Ib7422b2003e46a3ee27c6a591177a12d14e628bc
2020-10-02 13:20:22 -07:00
Ian Baker
f6fce167ca Update GtsExoPlayerTestCases class name in WV script
DashTest is renamed DashStreamingTest in http://ag/12675004

Test: None
Bug: b/169220487
Change-Id: I55e0abe76ecc04ffe9d896d424bbe42dcb7203fc
2020-09-28 09:15:57 +01:00
Rahul Frias
fe9ae2926d Delay license state evaluation for offline licenses am: 8543b4c903 am: 9f2363e076 am: 6d8e447696
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12646162

Change-Id: Ia844727f3d13862981a7915572b8d27e95ccb73a
2020-09-23 03:36:41 +00:00
Rahul Frias
6d8e447696 Delay license state evaluation for offline licenses am: 8543b4c903 am: 9f2363e076
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12646162

Change-Id: I0158e6b1dc2560ff28ff9379533a428f2970efeb
2020-09-23 03:03:08 +00:00
Rahul Frias
9f2363e076 Delay license state evaluation for offline licenses am: 8543b4c903
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12646162

Change-Id: I7b0f8239720e3aab7324dce8e2956e8135d0a65c
2020-09-23 02:46:20 +00:00
Rahul Frias
8543b4c903 Delay license state evaluation for offline licenses
[ Merge of http://go/wvgerrit/106325 and http://go/ag/12644840 ]

When offline licenses are restored, licenses and any renewals are processed.
License state evaluation occurs and notifications are sent to listeners.
If the license is expired, which is likely if a renewal is present,
the license state will transition to expired. Transitions out of
expired state are not allowed and the renewal has no effect.

If we work around this by allowing transitions out of expired state,
listeners will get notifications that keys have expired and then that are
usable soon after. To avoid delivering erroneous notifications we delay
evaluation of license state while the license and renewal are being processed.
Evaluation occurs at the last stage of license restoration when playback
information from the usage table is being restored.

This only need to occur for when licenses are being restored. In other
cases when a license or renewal is received, license state evaluation
and event listener notification needs to occur immediately.

Bug: 166131956

Test: WV unit/integration tests, GtsMediaTestCases tests
Change-Id: Ic8ade25316c5e20cc88de9225c43c24b28f21ac4
2020-09-22 15:36:35 -07:00
Fred Gylys-Colwell
8983b21fd5 Sign unused renewal so that offline renewal may be loaded am: 80667cbac3 am: f5896158c1 am: 5eb94cc6c6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12629547

Change-Id: Ic451a93104a9c903fce33e56ebf565e6b2bbae96
2020-09-22 22:29:58 +00:00
Fred Gylys-Colwell
5eb94cc6c6 Sign unused renewal so that offline renewal may be loaded am: 80667cbac3 am: f5896158c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12629547

Change-Id: I431e1f6607dd162809098798c20e28a35f1b88f8
2020-09-22 22:00:43 +00:00
Fred Gylys-Colwell
f5896158c1 Sign unused renewal so that offline renewal may be loaded am: 80667cbac3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12629547

Change-Id: Ic8a236e81d07bbc629cfa9a7a0e46513c2cbac1d
2020-09-22 21:31:43 +00:00
Fred Gylys-Colwell
80667cbac3 Sign unused renewal so that offline renewal may be loaded
Merge from Widevine repo of http://go/wvgerrit/105347

When reloading an offline license that has an offline renewal, we sign
a unused renewal so that the ODK library can update its clock values.

Test: WV unit/integration tests, GtsMediaTestCases tests
Bug: 166131956
Change-Id: Ib1445fd85222489f21221e00729d4989cb49a331
2020-09-22 02:44:05 +00:00
Rahul Frias
0761dd8920 Avoid passing device ID when unused
[ Merge of http://go/wvgerrit/105743 ]

Device ID is no longer reported directly in provisioning/license
request or used by ClientIdentification. It does not need to be passed
in during initialization.

Bug: 168085721
Test: WV unit/integration tests
Change-Id: I483eac963c3f40784e42e1a2b917fcc96aa76a05
2020-09-17 23:35:15 -07:00
Fred Gylys-Colwell
20bb84ffee Merge recent doc changes for OEMCrypto
This is a cherry pick of recent changes to OEMCrypto and ODK. Most of
these are part of the document migration to doxygen.

See http://go/wvgerrit/106005 and its parents for code reviews.

Bug: 144715340
Bug: 148232693
Bug: 167580674
Change-Id: I658f99c8117b974faed97322d61fac0f382283af
2020-09-15 19:10:53 -07:00
Robert Shih
f26e2ef0f2 GetDecryptHashSupport: recognize OEMCrypto_ERROR_NOT_IMPLEMENTED am: da09f4abca am: 4bf604c2d7 am: 28b13ef65e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12036417

Change-Id: I80d00065c7fd504f5d0855351c79a84e0a6aa76e
2020-09-15 02:39:33 +00:00
Alex Dale
9a2e83613a Merge "Test CDM sessions prevent multiple usage entries." into rvc-dev am: c628c5aca2 am: 7a65b6c2d4 am: 493bf5ec49
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11925460

Change-Id: I03cb03249f3f6a3dfdec750beb20e86dfa8333e1
2020-09-15 02:25:15 +00:00