Commit Graph

5022 Commits

Author SHA1 Message Date
Cong Lin
b1ab253abe [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: 563a79bd8b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14645772

Change-Id: Ic4f65ee841073da74452a3cc43eff7e8992b07ca
2021-06-09 21:41:05 +00:00
TreeHugger Robot
9144ae5f57 [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into rvc-qpr-dev am: c3ba913a07 -s ours am: 8dcf2887f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14628748

Change-Id: I4d21a4de514810ff2324178876fb67eae3fa050c
2021-06-09 21:41:01 +00:00
TreeHugger Robot
8dcf2887f1 [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into rvc-qpr-dev am: c3ba913a07 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ibb8f8d2daa1f37e3cd2c631176441b9c7469942e
2021-06-09 21:23:06 +00:00
TreeHugger Robot
c3ba913a07 Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into rvc-qpr-dev 2021-06-09 21:09:40 +00:00
TreeHugger Robot
c874985938 Merge "Use drm@1.4 vintf fragments for drm@1.3" into sc-dev am: b791286119
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14842900

Change-Id: I5254bcb4aa55ba7e0e68aad045a1a0a33daaa437
2021-06-09 00:57:40 +00:00
TreeHugger Robot
b791286119 Merge "Use drm@1.4 vintf fragments for drm@1.3" into sc-dev 2021-06-09 00:40:00 +00:00
Rahul Frias
2aa4c5ad7d Merge "Disallow restoring an offline license multiple times" into sc-dev am: d1d0fa431a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14731758

Change-Id: If1323538ca2d345469363066022487dae493fd64
2021-06-09 00:30:17 +00:00
Rahul Frias
d1d0fa431a Merge "Disallow restoring an offline license multiple times" into sc-dev 2021-06-08 23:57:23 +00:00
TreeHugger Robot
fbd98b5852 Merge "[DO NOT MERGE] Revert "Restructed reference root of trust (1/3 Keybox)"" into sc-dev am: 25de0c7c32
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14804251

Change-Id: I3105fd60380b0032d24a5f7f080da7c7e7680c87
2021-06-04 23:56:05 +00:00
Alex Dale
f972e9b6ad [DO NOT MERGE] Revert "Restructed reference root of trust (1/3 Keybox)" am: ad0d66c7e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14804251

Change-Id: I0ae95eeb1112cb1746da0a85c1e739b33b3981f9
2021-06-04 23:56:04 +00:00
TreeHugger Robot
25de0c7c32 Merge "[DO NOT MERGE] Revert "Restructed reference root of trust (1/3 Keybox)"" into sc-dev 2021-06-04 23:40:05 +00:00
Robert Shih
a81ace2ea4 Use drm@1.4 vintf fragments for drm@1.3
This avoids widevine crashloops in case partners updated
vendor/widevine without updating device makefiles.

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

Bug: 178110290
Bug: 186502089
Test: GtsMediaTestCases
Change-Id: Iafd9e62beadf5a099a76ab6a987ffd9598e5ef25
2021-06-04 19:45:16 +00:00
Rahul Frias
999fbeb666 Disallow restoring an offline license multiple times
[ Merge of http://go/wvgerrit/126063 ]

As a side-effect of fixing b/161865160 CDM checks to flag reloading
of an offline license were removed. This left it to the OEMCrypto
which varied by device implementation. Checks are being reintroduced
to the CDM and will help MediaDrm return the expected error
ERROR_LICENSE_STATE.

In addition restoring an offline liense to a session where a license
is already loaded will be rejected.

Bug: 184608310
Bug: 182208685
Test: WV unit/integration tests
      MediaDrmTest.testMultipleLoadKeys
Change-Id: Id8ee069d22819f7823aa6af11a41f35f0a04ce0a
2021-06-04 03:20:15 -07:00
Edwin Wong
6d7fb95c90 [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: b2ebc85c7e -s ours am: ffbc1dfdd2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13424496

Change-Id: I2b1bbcb8b4d3d5232332d8e37d97ff4f1b521ce1
2021-06-02 23:40:34 +00:00
Edwin Wong
b616798ff7 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: a5c14b7afb -s ours am: 787f7e2158 am: d74cf5a35f -s ours am: e75f7c63b5 am: 6f307fb311 -s ours am: 255f525c31
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13412308

Change-Id: Ia48e0e631ff396b63d6fe526b51473e53fe57b26
2021-06-02 23:27:30 +00:00
Edwin Wong
4527a65122 [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: 17c2aaabb4
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13424496

Change-Id: Icc58febeb32d5c6d50a5491f05606e72d4211bf8
2021-06-02 23:26:15 +00:00
Edwin Wong
0726cebfad [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: 81ecbed63a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13412308

Change-Id: Id620972719e7df47cbde546c6a5788b390e9e9ff
2021-06-02 23:25:43 +00:00
Edwin Wong
ffbc1dfdd2 [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: b2ebc85c7e -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ic0fefdfafdfa0024f12d307f4d3736ade2b570a7
2021-06-02 23:18:47 +00:00
Edwin Wong
255f525c31 [automerger skipped] [RESTRICT AUTOMERGE] Fix potential decrypt srcPtr overflow. am: a5c14b7afb -s ours am: 787f7e2158 am: d74cf5a35f -s ours am: e75f7c63b5 am: 6f307fb311 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Id300ffcd7ed8b9f37d4758ac802ae3427111c0b5
2021-06-02 23:18:39 +00:00
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
b2ebc85c7e [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: I7ae3b31b31288419a45b585ae5dae196d80bcdfb
2021-06-02 23:04:49 +00:00
Edwin Wong
6f307fb311 [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: Iac6fa4a12541c9e95c733186e4607d7c52973e1d
2021-06-02 23:04:37 +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
f5917c0704 [DO NOT MERGE] Revert "Restructed reference root of trust (2/3 DRM Cert)" am: 06b637ed95
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14605397

Change-Id: I4517d183e287da0b053dd7045c44139f74ded5dc
2021-06-02 20:13:00 +00:00
Alex Dale
ad0d66c7e6 [DO NOT MERGE] Revert "Restructed reference root of trust (1/3 Keybox)"
This reverts commit e4ee4eb404.

Reason for revert: Feature missed deadline

Bug: 135283522
Change-Id: I4ee2caac2dadfcc3e145b9c9b977d216d4edd929
2021-06-02 20:00:16 +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
0c32615d69 Merge "New usage entries are moved lower after creation." into sc-dev am: 9c47be6aa8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14354899

Change-Id: If9e45c38e7408811abd7c78ee10536ddbeb71a54
2021-05-26 22:45:33 +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
818d93da2b Merge "Sync L3 headers in sc-dev" into sc-dev am: 5af95f48ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14669194

Change-Id: I29f7456d0afe12b2a4f578e290dde5b2c6643c0c
2021-05-26 00:21:09 +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
0f39baa33c Add fudge to duration tests am: 20833734e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14664668

Change-Id: Icf3d6a82b7c537839dbee2d7dcb6145f8fc4b1b5
2021-05-25 22:22:11 +00:00
Fred Gylys-Colwell
042a715e93 Merge "LUCI: Add build fuzz tests script to presubmits" into sc-dev am: eaa1e6d4a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14486069

Change-Id: Ie54dd7ffc4f354cb368fb23fbeb672feb67ad0f1
2021-05-25 20:36:19 +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
e0f31dc2b5 Check for open session when initializing usage table. am: 023b06eded
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14296026

Change-Id: I4b0b46d585f99c492e30e608a0a18708fc40b042
2021-05-24 21:30:44 +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
Cong Lin
563a79bd8b [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate
build

This is a merge of CL from widevine repo (obfuscated code only):
https://widevine-internal-review.googlesource.com/c/cdm/+/124965

The source code change that produced the obfucated code is here:
https://widevine-internal-review.googlesource.com/c/cdm/+/121763

Original commit message from the fix above:
"This is a security improvement against an L3 exploit b/182584472.
The change is to store RSA private key in two parts instead of one,
and load it separately when the key is needed. This will make it
more difficult to find the entire RSA key.

This CL does the key loading part only. Key splitting is done
in Haystack in CL: cl/367515385"

New L3 system IDs included in the obfuscated code:
ID     Description
22593  Android S ARM L3 Field Provisioning 3.0
22594  Android S ARM 64 L3 Field Provisioning 3.0
22595  Android S x86 L3 Field Provisioning 3.0
22596  Android S x86 64 L3 Field Provisioning 3.0

Bug: 182584472
Test: L3 unit tests
Test: GTS tests
https://android-build.googleplex.com/builds/forrest/run/L16300000887061939
The only failed case is a test issue due to the new IDs not being added
to the allow list of the test yet. This test passed on local run with
the updated allow list.

Change-Id: If8b8b2cb9291ede0cb2dcc892f5557c3a68c4b96
2021-05-19 10:20:02 -07:00
Cong Lin
a54beb67e5 [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate
build

This is a merge of CL from widevine repo (obfuscated code only):
https://widevine-internal-review.googlesource.com/c/cdm/+/124886

The source code change that produced the obfucated code is also included
in the CL above but will not be merged to Android.

Original commit message from the fix above:
"This is a security improvement against an L3 exploit b/182584472.
The change is to store RSA private key in two parts instead of one,
and load it separately when the key is needed. This will make it
more difficult to find the entire RSA key.

This CL does the key loading part only. Key splitting is done
in Haystack in CL: cl/367515385"

New L3 system IDs included in the obfuscated code:
22589  Android R ARM L3 Field Provisioning 3.0
22590  Android R ARM 64 L3 Field Provisioning 3.0
22591  Android R x86 L3 Field Provisioning 3.0
22592  Android R x86 64 L3 Field Provisioning 3.0

Bug: 182584472
Test: L3 unit tests
Test: GTS tests
run gts --module GtsMediaTestCases
run gts --module GtsExoPlayerTestCases
run gts --module GtsYouTubeTestCases

Change-Id: Ide6962fcaf902bcf31431f9067a89ad75087add6
2021-05-18 15:03:39 -07:00
TreeHugger Robot
ea6f596e96 Merge "Validate decryption with entitled keys in OEC tests" into sc-dev am: e233e68de1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14506727

Change-Id: Iae742c9f96d689c05970c8630555f03b976d351b
2021-05-17 22:13:41 +00:00
TreeHugger Robot
69d18ebcf9 Merge "Remove asserts from GenerateSimpleSampleDescription()" into sc-dev am: 418d322961
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14506726

Change-Id: If04536a13255810ddcb9416ce17daec641fa7fcd
2021-05-17 22:13:37 +00:00