Commit Graph

4978 Commits

Author SHA1 Message Date
Edwin Wong
17c2aaabb4 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: 0253cb580e -s ours am: ad1d8778e4 -s ours am: 62e23e0369 am: 85bbf55e91 -s ours am: a9fbf4de43 am: 38654a3fd7 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I6782e4de8ddc7bf62d38790f7f9d24b64b02f63d
2021-06-02 23:18:00 +00:00
Edwin Wong
81ecbed63a [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: a5c14b7afb -s ours am: 787f7e2158 am: d74cf5a35f -s ours am: e75f7c63b5 am: 1a04368a9e -s ours
am skip reason: subject contains skip directive

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

Change-Id: I63f905b093c4f151a026adc123ae66120483cb17
2021-06-02 23:17:46 +00:00
Edwin Wong
38654a3fd7 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: 0253cb580e -s ours am: ad1d8778e4 -s ours am: 62e23e0369 am: 85bbf55e91 -s ours am: a9fbf4de43
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13424496

Change-Id: I2c246da19bedc2440e777c8edddf2e5619d8fa74
2021-06-02 23:03:37 +00:00
Edwin Wong
1a04368a9e [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: a5c14b7afb -s ours am: 787f7e2158 am: d74cf5a35f -s ours am: e75f7c63b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13412308

Change-Id: Ida8db64dddf24fcfcc2ee83d035e6bd79ec240ea
2021-06-02 23:03:23 +00:00
Edwin Wong
a9fbf4de43 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: 0253cb580e -s ours am: ad1d8778e4 -s ours am: 62e23e0369 am: 85bbf55e91 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Id5014667cb634351d19e8b4012d2db0c7f32d365
2021-06-02 22:47:40 +00:00
Edwin Wong
e75f7c63b5 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: a5c14b7afb -s ours am: 787f7e2158 am: d74cf5a35f -s ours
am skip reason: subject contains skip directive

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

Change-Id: I983a6944369ff77e27c8d64fba5937dffc3554de
2021-06-02 22:47:30 +00:00
Edwin Wong
85bbf55e91 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: 0253cb580e -s ours am: ad1d8778e4 -s ours am: 62e23e0369
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13424496

Change-Id: Ib88e34bacd5afb0ead74ba2a6526083366ea2822
2021-06-02 22:25:40 +00:00
Edwin Wong
d74cf5a35f [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: a5c14b7afb -s ours am: 787f7e2158
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13412308

Change-Id: I84bf657fa0999fda46a89c02260ce31323164b9e
2021-06-02 22:25:26 +00:00
Edwin Wong
62e23e0369 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: 0253cb580e -s ours am: ad1d8778e4 -s ours
am skip reason: subject contains skip directive

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

Change-Id: If6f783b3af331eedd1b9f1a1a887990978c0c52e
2021-06-02 22:04:34 +00:00
Edwin Wong
787f7e2158 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: a5c14b7afb -s ours
am skip reason: subject contains skip directive

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

Change-Id: I3fa1dadd8d1294eff10ba86b9a7adf49e08e3bca
2021-06-02 22:04:24 +00:00
Alex Dale
06b637ed95 [DO NOT MERGE] Revert "Restructed reference root of trust (2/3 DRM Cert)"
This reverts commit f6f5099604.

Reason for revert: Feature missed deadline

Bug: 135283522
Change-Id: Ic86930ee3444c5a6aa1d78ae3a12a9030c29ef92
2021-06-02 17:41:53 +00:00
Alex Dale
9c47be6aa8 Merge "New usage entries are moved lower after creation." into sc-dev 2021-05-26 22:31:03 +00:00
TreeHugger Robot
5af95f48ed Merge "Sync L3 headers in sc-dev" into sc-dev 2021-05-26 00:02:54 +00:00
Fred Gylys-Colwell
20833734e1 Add fudge to duration tests
Merge from Widevine repo of http://go/wvgerrit/125046

Add some extra fudge to the termination time. This assumes that flaky
tests were caused by roundoff error.

Bug: 175741647
Change-Id: I9bcc86f9b9540e5985df647dd1b5c5d439556e2b
2021-05-25 20:26:43 +00:00
Fred Gylys-Colwell
eaa1e6d4a0 Merge "LUCI: Add build fuzz tests script to presubmits" into sc-dev 2021-05-25 20:19:49 +00:00
Alex Dale
884550333d New usage entries are moved lower after creation.
[ Merge of http://go/wvgerrit/124004 ]

When the CDM creates a new usage entry for an offline or streaming
license, the new entry is immediately moved to the lowest available
entry index that has been marked as vacant (kStorageTypeUnknown).

When a license is released, its meta data that is managed by the CDM
is cleared; however, the usage entry's index is marked vacant, but it
is not released.  This creates wasted entry space in the usage table.
Unfortunately, defragging the table is computationally expensive and
may not be able to actually free up much space depending on when it
is performed.

For a typical user, this will likely not be an issue as the table
can get quite large compared to the number of licenses an app uses
and the table is partially cleaned on each boot.

GTS tests, however, have reached a point where they fill the usage
table before all tests are complete.  This is causing many unexpected
failures for devices.  Most of these tests release their license, but
the CDM never reaches a state where it can clean up the table.

By moving newly created entries to the lowest available index directly
after creating the entries, the table never needs to grow unless all
entries are in use.  Clean up is now almost never required.

Bug: 180639135
Bug: 180638990
Bug: 180638530
Test: MediaDrmTest#testWidevineApi28
Change-Id: I1a68d90d51384094298b27037778747ce7435374
2021-05-24 12:51:44 -07:00
Cong Lin
d542cb91b5 Sync L3 headers in sc-dev
Merge of these CLs from Widevine sc-dev:

modified:   libwvdrmengine/level3/include/clear_cache_function.h
  Add cache flush assembly for arm64 L3 to Android header | http://go/wvgerrit/124828
  Address compilation errors | http://go/wvgerrit/113083

modified:   libwvdrmengine/level3/include/level3_file_system_android.h
  Update Widevine Copyright header for android | http://go/wvgerrit/108084

Bug: 184866351
Test: Header changes for clearing cache is verified by one of the partners on their arm64 target;
https: //b.corp.google.com/issues/175432203#comment13

Change-Id: I0ac8f339f65d02abb3080020fbc715b9c0db85b2
2021-05-20 14:56:20 -07:00
Alex Dale
023b06eded Check for open session when initializing usage table.
[ Merge of http://go/wvgerrit/122984 ]

There was an issue encountered by some vendors with how the usage
table was initialized on some devices.  Previously, the CDM would
open an OEMCrypto session first, then initialize the usage table
(loading existing or creating a new one).  On these devices,
OEMCrypto_CreateUsageTableHeader() and OEMCrypto_LoadUsageTableHeader()
would fail if there were any open sessions.

This CL changes the initialization process to create/load the usage
table before opening an OEMCrypto session.

This change also lays the ground work for another usage table fix
to address GTS tests failure.

In the process, several of the functions for the usage table have been
split up into smaller chunks of code.  This required additional changes
to the usage table unittest to keep them up to date.

Bug: 169195093
Bug: 180639135
Test: Linux unittests and MediaDrmTest
Change-Id: Ifbf35f5d8cff5b89fea9b16edb998c84803f4fbe
2021-05-19 10:39:51 -07:00
TreeHugger Robot
e233e68de1 Merge "Validate decryption with entitled keys in OEC tests" into sc-dev 2021-05-17 22:09:52 +00:00
TreeHugger Robot
418d322961 Merge "Remove asserts from GenerateSimpleSampleDescription()" into sc-dev 2021-05-17 22:09:21 +00:00
TreeHugger Robot
4948331656 Merge "[DO NOT MERGE] Revert "Restructed reference root of trust (3/3 OEM Cert)"" into sc-dev 2021-05-17 21:50:36 +00:00
Alex Dale
fe28d4cafc [DO NOT MERGE] Revert "Restructed reference root of trust (3/3 OEM Cert)"
This reverts commit 9f7e2c4413.

Reason for revert: Feature missed deadline

Bug: 135283522
Change-Id: I63eb0431762fd13c64bef926fb1e64b6edacb156
2021-05-17 19:08:53 +00:00
John W. Bruce
d742daf9c7 Validate decryption with entitled keys in OEC tests
(This change is merged from http://go/wvgerrit/124825)

The OEMCrypto tests have tests that verify that entitled keys can be
loaded but not that they can be successfully used for decrypt. This
patch adds a decrypt portion to the existing tests.

As part of this, the existing Session::EncryptCTR() method and portions
of Session::TestDecryptCTR() are lifted to be static functions so they
can be shared across unrelated classes in oec_session_util.cpp.
EncryptCTR() had no dependence on its enclosing class and is unchanged
other than being moved outside the class.

To reduce ambiguity with the new decrypt verification, this patch also
renames EntitledMessage::VerifyEntitlementTestKeys() to the
more-specific EntitledMessage::VerifyKCBs(). Its behavior is unchanged.

Bug: 186782279
Test: x86-64 platform
Test: opk_ta platform
Test: build_and_run_all_unit_tests
Change-Id: I15156882907b0987215087aaf43b4666fedc171a
2021-05-11 12:52:24 -07:00
John W. Bruce
ed17d09c1b Remove asserts from GenerateSimpleSampleDescription()
(This change is merged from http://go/wvgerrit/124824)

GenerateSimpleSampleDescription() only had asserts to check parameters
that only came from other test code, so they weren't testing anything of
use. With the asserts removed, it's no longer necessary to wrap calls to
GenerateSimpleSampleDescription() with ASSERT_NO_FATAL_FAILURE(), which
a lot of callers were already forgetting to do anyway. This also
simplifies a future patch that will generalize the decryption test code
to work with entitlement licenses.

Bug: 186782279
Test: x86-64 platform
Test: build_and_run_all_unit_tests
Change-Id: I987427fdfee4826d77ab95344f9aca8c374b2001
2021-05-11 12:49:22 -07:00
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