Commit Graph

5165 Commits

Author SHA1 Message Date
TreeHugger Robot
ddaae9a17b Merge "[RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix sc-dev" into sc-dev 2021-05-10 22:02:06 +00:00
Fred Gylys-Colwell
d3942b242c LUCI: Add build fuzz tests script to presubmits
Merge from Widevine repo of http://go/wvgerrit/123803

Update fuzz build script to use gyp from third_party folder.

Test: ran fuzz tests on luci
bug: 186271314
bug: 184866351
Change-Id: If530872aa1e60d2108932610415aa5315979390c
2021-05-10 17:44:50 +00:00
Rahul Frias
bb0b6b4ba5 Merge "Disallow the ability to load offline licenses more than once" into sc-dev 2021-05-07 22:21:03 +00:00
Cong Lin
1e032deed0 [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix qt-dev am: eb9a027f0a am: b6b2367e9d -s ours am: 9fbcb7f1ba am: 8b84dd36a1 am: 5ed13c2c28 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I0d40134cf46b8362ada5feb640154a3c6d3de2c6
2021-05-06 22:26:02 +00:00
Cong Lin
1a3c6d7228 [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix am: 5ea6b86f79 -s ours am: 1fb5b4d68c am: 6514bde77e -s ours
am skip reason: subject contains skip directive

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

Change-Id: I140d768a4af03f7b5d9a216007a3b252ae27f28d
2021-05-06 22:24:26 +00:00
Cong Lin
23558d65b4 [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix qt-dev am: eb9a027f0a am: b6b2367e9d -s ours am: 9fbcb7f1ba am: 5d1b215cb7 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I3bb67f7b01ff3ac4522f0bfd5943e259c4d2c3bd
2021-05-06 22:14:09 +00:00
Cong Lin
5ed13c2c28 [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix qt-dev am: eb9a027f0a am: b6b2367e9d -s ours am: 9fbcb7f1ba am: 8b84dd36a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14238888

Change-Id: Iaf8cceab7ea631943c110149eb1bfdfd62830db2
2021-05-06 22:13:30 +00:00
Cong Lin
6514bde77e [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix am: 5ea6b86f79 -s ours am: 1fb5b4d68c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14283069

Change-Id: Ibe45158298b415d67de3132f598095d983d8af81
2021-05-06 22:13:27 +00:00
Cong Lin
5d1b215cb7 [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix qt-dev am: eb9a027f0a am: b6b2367e9d -s ours am: 9fbcb7f1ba
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14238888

Change-Id: I4ab4f7c5a15822960cd6f6c9d35e3292a726db40
2021-05-06 21:57:38 +00:00
Cong Lin
8b84dd36a1 [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix qt-dev am: eb9a027f0a am: b6b2367e9d -s ours am: 9fbcb7f1ba
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14238888

Change-Id: I6d284a16c6e5d40d0d39489d9853d032dec8e043
2021-05-06 21:56:09 +00:00
Cong Lin
1fb5b4d68c [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix am: 5ea6b86f79 -s ours
am skip reason: skipped by user conglin

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

Change-Id: Iab364aea4690819a484a8527e73dcc4e0da358d6
2021-05-06 21:56:03 +00:00
Cong Lin
cff7fd681e [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix am: 5ea6b86f79 am: bc7c7a971d -s ours
am skip reason: subject contains skip directive

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

Change-Id: I306847744a3a54ed68f63ae07b005302d66196ab
2021-05-06 21:38:05 +00:00
Cong Lin
9fbcb7f1ba [automerger skipped] [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix qt-dev am: eb9a027f0a am: b6b2367e9d -s ours
am skip reason: subject contains skip directive

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

Change-Id: I0ff731accf0aba941a7b0bffd237f21ec2e34891
2021-05-06 21:37:22 +00:00
Cong Lin
bc7c7a971d [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix am: 5ea6b86f79
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14283069

Change-Id: Ia2d991d9513e17b98944256297e4caaabc96dd21
2021-05-06 21:21:40 +00:00
Cong Lin
b6b2367e9d [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix qt-dev am: eb9a027f0a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14238888

Change-Id: I53e5d60e293cbb0bb0072bd111aea2eb0547de57
2021-05-06 21:20:09 +00:00
TreeHugger Robot
4057559ae5 Merge "Report Rental duration remaining" into sc-dev 2021-05-01 00:50:13 +00:00
TreeHugger Robot
b7662fcbf2 Merge "Use Usage information from OEMCrypto on clock rollback" into sc-dev 2021-04-30 19:18:35 +00:00
Rahul Frias
2404500ceb Report Rental duration remaining
[ Merge of http://go/wvgerrit/124063 ]

LicenseDurationRemaining used to indicate the minimum of rental or
license duration till OEMCrypto v16. OEMCrypto v16 onwards it began
reporting rental duration alone.

This is confusing for app developers and content partners. Keeping
LicenseDurationRemaining as apps may depend on it but adding
RentalDurationRemaining for clarity.

Bug: 186838303
Test: WV unit/integration tests, WvCdmRequestLicenseTest.QueryKeyStatus
Change-Id: I6c507150a0945ee36716b4da189f5741b092c0ec
2021-04-30 04:52:39 -07:00
Rahul Frias
0921b04e41 Disallow the ability to load offline licenses more than once
[ Merge of http://go/wvgerrit/123263 ]

In b/65839890 we discovered that an android app loaded an offline
license more than once in a session. We did not intend to allow
this behavior but did not prohibit it. OEMCrypto v16 disallowed
this behavior at the OEMCrypto level but we worked around it
within the CDM to maintain the bad behavior. Now that we have confirmed
that the app no longer relies on that behavior, we are reverting
the CDM workaround.

Bug: 161865160
Test: WV unit/integration test, GtsMediaTestCases
      Amazon, Netflix, Google TV streaming and offline playback.
Change-Id: I31254e4c13b81587f88c6c684d08d5aa5c18e39d
2021-04-29 16:20:30 -07:00
Cong Lin
eb9a027f0a [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix qt-dev
Merge of [http://go/wvgerrit/123643]. Fix included:

http://go/wvgerrit/111603
Fix L3 block offset test and re-enable buffer overflow tests

http://go/wvgerrit/111784
Fix heap overflow test in L3 and OEMCrypto ref

Test: Ran L3 unit tests
Test: GTS tests https://android-build.googleplex.com/builds/forrest/run/L68100000872640856
Bug: 182584472

Change-Id: I237f52c715e691a52256bf01fa2422aeb34e45f3
2021-04-29 09:20:52 -07:00
Alex Dale
0579fe805e Clean up other core CDM logs.
[ Merge of http://go/wvgerrit/122613 ]

Further log clean up in the core CDM code.
- Changed several INFO logs to DEBUG and VERBOSE
- Added more identifiers to the DEBUG logs to help match resource
  associations
- Added more enum-to-string functions
- Unknown enum values will be formatted to contain their numeric
  value

Key areas improved are the UsageTableHeader and CdmSession.

Bug: 183576879
Test: CE CDM unittests
Change-Id: I2d11e714d419e0736d3e2f7a7668e8d36d7ef449
2021-04-28 20:39:21 -07:00
Robert Shih
85afe8c0b0 Merge "metrics: set OEMCrypto initialization errors correctly" into sc-dev 2021-04-28 21:31:23 +00:00
Ulyana Trafimovich
4b9ec9eab6 Merge "Disable dexpreopt and <uses-library> check for tests." into sc-dev 2021-04-28 09:38:17 +00:00
Robert Shih
7a061b503f Merge "Update Android WVCdm version to 16.1.0" into sc-dev 2021-04-27 20:59:28 +00:00
Rahul Frias
9b3e37b038 Merge "Address CE CDM code review comments" into sc-dev 2021-04-27 20:27:35 +00:00
TreeHugger Robot
03dff71bd8 Merge changes I6dd829f4,Id8384c58,I9228b9cc,I744a1e89 into sc-dev
* changes:
  Fix CDM Builds w/ OEMCrypto_ERROR_INVALID_ENTITLED_KEY_SESSION
  Fix unused param warnings in oemcrypto fuzz test
  Add http socket tests to other tests
  Turn on ODK tests in CE CDM test and fix test helper
2021-04-27 19:20:34 +00:00
Cong Lin
22f8ee9498 [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix sc-dev
Merge of [http://go/wvgerrit/118363]. Fixes included:

http://go/wvgerrit/111603
Fix L3 block offset test and re-enable buffer overflow tests

http://go/wvgerrit/111784
Fix heap overflow test in L3 and OEMCrypto ref

http://go/wvgerrit/113644
Check for buffer overflow when computing subsample size

http://go/wvgerrit/113946
Fix test failures caused by huge key length in L3

Test: Ran L3 unit tests
Test:
https://android-build.googleplex.com/builds/forrest/run/L81800000863169076
Bug: 182584472

Change-Id: Iae051ac2c06eb263b3b3be76d56b42917340af1d
2021-04-27 09:35:03 -07:00
Cong Lin
5ea6b86f79 [RESTRICT AUTOMERGE] Refresh L3 libraries after buffer overflow fix
rvc-dev

Merge of [http://go/wvgerrit/123644]. Fix included:

http://go/wvgerrit/111603
Fix L3 block offset test and re-enable buffer overflow tests

http://go/wvgerrit/111784
Fix heap overflow test in L3 and OEMCrypto ref

Test: Ran L3 unit tests
Test:
gts-tradefed run gts --module GtsMediaTestCases
gts-tradefed run gts --module GtsExoPlayerTestCases
Bug: 182584472

Change-Id: I70bda559c4b5158c3461dcdfee72a8953f31a942
2021-04-27 09:21:59 -07:00
Ulya Trafimovich
07440a83bf Disable dexpreopt and <uses-library> check for tests.
Bug: 132357300
Test: treehugger
Change-Id: Ia2c6cba7a4a91f6d3b0b343a44c4257817c3a4cf
2021-04-27 14:27:37 +01:00
Ereth McKnight-MacNeil
63eae1f4a4 Shell quoting in move_widevine_data.sh
Add double quotes to prevent globbing and word splitting.

Bug: crbug.com/1168550
Test: Create /data/mediadrm files and observe they are moved
Change-Id: I8d1cd70971588f903657825ea6e10c019954f403
(cherry picked from commit 8649f7a952b7e4f8edd17edfca0b0962e2fb2662)
(cherry picked from commit 84d0d73be5)
2021-04-27 00:27:27 +00:00
Robert Shih
3a503278e6 Update Android WVCdm version to 16.1.0
TODO: update VersionNumberTest.VersionNumberChangeCanary

[ Merge of http://go/wvgerrit/123403 ]

Bug: 183073374
Test: GtsMediaTestCases
Change-Id: I1773416b6f3f212bead5e6b7749da52883041d07
2021-04-26 12:00:16 -07:00
Rahul Frias
4c4e746e57 Replace DeviceFiles::LicenseState with CdmOfflineLicenseState
[ Merge of http://go/wvgerrit/123003 ]

Bug: 160006474
Test: WV unit/integration tests
Change-Id: Ied813f58405fcac44f0543f715ab2175129bbf9c
2021-04-24 00:30:20 -07:00
Rahul Frias
46a3f6c608 Merge "Correct request_license_test failures" into sc-dev 2021-04-24 01:03:49 +00:00
TreeHugger Robot
bee62d797e Merge "Clean up CdmEngine logs." into sc-dev 2021-04-23 20:35:53 +00:00
Rahul Frias
c21d40c68f Address CE CDM code review comments
Undoes a change to the buffer size from http://ag/13865723

Bug: 184813991
Test: WV unit/integration tests
Change-Id: I40cf786f149626ff65a3362020b3da859bb86159
2021-04-23 12:26:34 -07:00
Fred Gylys-Colwell
ebb7d45a25 Fix CDM Builds w/ OEMCrypto_ERROR_INVALID_ENTITLED_KEY_SESSION
Merge from Widevine repo of http://go/wvgerrit/108224

A recent Copybara merge to master broke CDM builds by introducing a
new OEMCrypto error code. This patch adds it to the test printers so
that the build can pass again.

Bug: 185597829
Test: CE CDM Build
Change-Id: I6dd829f4c618c9ebec937cf711ff57b7f1678994
2021-04-23 10:11:48 -07:00
Fred Gylys-Colwell
a87eec804c Fix unused param warnings in oemcrypto fuzz test
Merge from Widevine repo of http://go/wvgerrit/122403

Re-merge of http://go/wvgerrit/105184 which was accidentally
undone by http://go/wvgerrit/107063.

Unused params are reported as warning when built in Android.

Test: Ran oemcrypto unit tests
Bug: 160734070
Change-Id: Id8384c58c8ace0b214464380fb961d108f1b5c3b
2021-04-23 10:11:48 -07:00
Fred Gylys-Colwell
5a58b6d8d2 Add http socket tests to other tests
Merge from Widevine repo of http://go/wvgerrit/122224

This CL removes the separate main() in http_socket_test that
allowed the user to set the server on the command line.  I
don't think anybody was using this, and it conflicted with
our desire to include this suite of tests with the other CE
CDM tests running on Luci.

test: ran http_socket_test
bug: 118657876
Change-Id: I9228b9cc97a0af2afd1bb4a99bc40b88ce956d67
2021-04-23 10:11:48 -07:00
Fred Gylys-Colwell
14a034209c Turn on ODK tests in CE CDM test and fix test helper
Merge from Widevine repo of http://go/wvgerrit/122223

This adds the ODK unit tests to the CE CDM tests so that they run as
part of the presubmit tests.

The test helper had some pointer problems converting a bool to a
uint32, so it has been updated to handle this correctly.

Some other tests failed comparing signed to unsigned, to these have
also been fixed.

test: ran odk_test
bug: 118657876
Change-Id: I744a1e89f4e4729c31d3f53e729984ffac1d96fd
2021-04-23 10:11:48 -07:00
Rahul Frias
87e84d5498 Use Usage information from OEMCrypto on clock rollback
[ Merge of http://go/wvgerrit/123103 ]

This corrects setting of first and last playback times stored by the
CDM on rollback. Earlier usage information from the usage entry in
OEMCrypto would be ignored on rollback even when available.
Information stored along with the license in persistent storage would
be used instead.

A new test with longer duration expiry has been added as well as some
additional verification.

Bug: 186199213
Test: WV unit/integration test
Change-Id: I601f9584a8a0c5137ce68546f8ec833bf2e70cc5
2021-04-23 03:58:31 -07:00
Rahul Frias
2a316f65fe Correct request_license_test failures
[ Merge of http://go/wvgerrit/122885 ]

A recent change to the license service resulted in PSTs being inserted
into persistent renewable licenses even when not specified by the
content provider. This caused ReleaseOfflineKeySessionUsageDisabledTest
to fail. The asset was changed to use a policy for a persistent
license without renewal.

Offline_RollbackBeforeRestoreKey failed because the duration of the
license is short. It has expired when the clock is restored after a
rollback.

Bug: 181693982
Test: request_license_test
Change-Id: I0a2c2a09e563c81c134fba1f310deb1eb4de26a3
2021-04-23 01:52:18 -07:00
Bob Badour
99b73280e6 Merge "[LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine" into sc-dev 2021-04-23 04:07:59 +00:00
Alex Dale
5eed0446da Clean up CdmEngine logs.
[ Merge of http://go/wvgerrit/121568 ]

The CdmEngine logs had both too much and too little information.

Since our logging has been enabled to print function names natively,
many of the log information has become superfluous.  Needless
information has been removed, and many of the important INFO logs have
been reduced to only the information not present in the function name.

Some of the INFO and ERROR logs were missing identifiers to match
failures with the same session request should the failures take more
than a few milliseconds to occur.  CDM session IDs and key set IDs
have been included in all the logs that _appeared_ to have a slow
operation between the top of the method and log.

To help make enum values more readable, several enums-to-string
functions have been implemented.  These converters are intended for
INFO logging and as such, do not log any addition information should
the enum be out of range.

To help make empty and null identifiers more readable in the logs,
empty strings will be logged as <empty> and null strings will be
logged as <null>.

While working through the "cdm_engine.cpp" file, a few minor changes
have been made:
- Adjust if statements to match with Google C++ style guidelines
  - Skipped anything that was not obvious
- Added a const qualifier to variables where appropriate
- Moved some null checks to the top of the method
  - Only where sequence is non-critical to normal operation
- Removed unnecessary string to vector to string conversions
- Reject empty |force_session_id|
  - Already enforced on CE CDM code and not uesd on Android

Bug: 183576879
Test: CE CDM unittests
Change-Id: Id165373055f7ce6097c93c48f84af74bd353c8cb
2021-04-21 21:05:10 -07:00
Edwin Wong
8c0769d8a9 Merge "[RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow." into sc-dev 2021-04-21 23:16:47 +00:00
Bob Badour
7e3dcfe54a [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine
Added legacy_by_exception_only to:
  libwvdrmengine/test/castv2/Android.mk
  libwvdrmengine/test/java/MediaDrmApiTest/Android.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I71c2aaa0efb3730f56863bc9047f8794e6a9de01
2021-04-21 14:31:12 -07:00
TreeHugger Robot
347bba5261 Merge "Use either spelling of AllocateSecureBuffer in dynamic adapter" into sc-dev 2021-04-20 21:44:53 +00:00
Edwin Wong
68b5b00567 [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow.
sc-dev branch is missing this fix, it did not auto merge from
http://ag/13617980

There is a potential integer overflow to bypass the
destination base size check in decrypt. The destPtr
can then point to the outside of the destination buffer.

Test: sts-tradefed
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176444622#testPocBug_176444622

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-17644462264

Bug: 176444622
Bug: 176496353
Change-Id: I88fff54de09d6753672b2a46c029960b5c30f5e7
2021-04-20 16:36:11 +00:00
Robert Shih
9776979f75 metrics: set OEMCrypto initialization errors correctly
[ Merge of http://go/wvgerrit/122663 ]

Bug: 162763203
Test: adb shell dumpsys media.metrics
Change-Id: I4e34d2ca924e271d31952ca4258287f0c9c96f38
2021-04-19 22:18:16 +00:00
TreeHugger Robot
9c3c076cac Merge "Address review comments" into sc-dev 2021-04-17 03:49:56 +00:00
Rahul Frias
c997497aa6 Merge "Remove CBC1 and CENS test" into sc-dev 2021-04-17 00:12:17 +00:00