Commit Graph

5033 Commits

Author SHA1 Message Date
Alex Dale
16a0ab2309 Merge "Updated integration test to handle unlimited license durations." into sc-dev 2021-07-01 05:35:29 +00:00
Fred Gylys-Colwell
47324cc6fe Merge "Cache security level" into sc-dev 2021-06-30 21:35:36 +00:00
TreeHugger Robot
853ab51cb3 Merge "Add extra RSA private keys to unit tests" into sc-dev 2021-06-30 21:32:01 +00:00
TreeHugger Robot
6d1898f20f Merge "Sync oemcrypto reference code" into sc-dev 2021-06-30 21:20:58 +00:00
TreeHugger Robot
99c4d463d9 Merge "Allow delayed error code in generic crypto" into sc-dev 2021-06-30 21:06:17 +00:00
TreeHugger Robot
41d7b74558 Merge "Update OEMCrypto buffer offset tests" into sc-dev 2021-06-30 20:49:57 +00:00
Rahul Frias
5271d95ce4 Merge "Address unit test failures" into sc-dev 2021-06-30 19:30:22 +00:00
Fred Gylys-Colwell
2d9bdfea58 Update OEMCrypto buffer offset tests
Merge from Widevine repo of http://go/wvgerrit/127524

Some unit tests used the response buffer size before the size had been
computed. This CL updates the tests.

Bug: 183440999
Bug: 184866351
Test: Ran unit tests on Prov 3.0 device.
Change-Id: I0b23dc7b0dafa9b9eab3cdbd7f29074898e4709b
2021-06-30 17:46:18 +00:00
Fred Gylys-Colwell
052016eb57 Add extra RSA private keys to unit tests
Merge from Widevine repo of http://go/wvgerrit/128047

There have been some failures with various RSA private keys. We add
them to the unit tests to make sure that OEMCrypto is able to load
these types of keys:
* Shorter: than normal private exponents. This seems to occur
  occasionally even with Euler totients. But it occurs more with
  Carmichael totients.
* 0-leading-byte: private exponents. This also occurs naturally for
  both Euler and Carmichael totients.
* Carmichael: vs Euler totients. I think we may already have tests for
  this. But just in case.

Bug: 190450051
Test: ran unit tests on bonito (and they passed!)
Change-Id: Id64ec738479eb8a0f77e253bace319cebe918d3f
2021-06-29 16:47:20 +00:00
Fred Gylys-Colwell
58c1ea1fa2 Cache security level
Merge from Widevine repo of http://go/wvgerrit/127743

There was some confusion about who owned the OEMCrypto security level
string in a multithreaded environment. This is solved by caching the
security level at initialization time.

Bug: 188706160
Test: ran unit tests on bonito
Change-Id: I93af3bb2e5a8bf190627ee568f752b5ea9543306
2021-06-29 05:42:41 +00:00
Alex Dale
a9e26bdc2b Updated integration test to handle unlimited license durations.
[ Merge of http://go/wvgerrit/128046 ]

Test case WvCdmStreamingUsageReportTest.WvCdmStreamingUsageReportTest
was failing comparing "license duration" values returned when querying
for key information for licenses with unlimited "rental duration".

This is due to the new license duration model used for V16 licenses.

From the Widevine MediaDrm doc for "LicenseDurationRemaining":

  For OEMCrypto v16+ (Android 11 and later), license duration is no
  longer being enforced. If rental duration is set to never expire,
  ”9223372036854775807” (LLONG_MAX) will be returned.

Similarly, the test has been updated for "playback duration" queries
of the same case.

Bug: 163542905
Test: cdm_extended_duration_test

Change-Id: I57e0e435631a151fac45c963d865de256a773644
2021-06-28 22:35:52 -07:00
Fred Gylys-Colwell
830a7acc48 Sync oemcrypto reference code
This is a merge from the Widevine repo of
http://go/wvgerrit/117311
Update backwards compatibility builds

http://go/wvgerrit/117423
Restrict maximum size of key id
To protect from out-of-memory found by fuzz testing.

http://go/wvgerrit/117683
Generation number should wrap

The master generation number should wrap around on overflow. This
means that we cannot use less than to check for a skew of 1.

http://go/wvgerrit/119232
Replace 0 with nullptr

Bug: 176234903
Bug: 184866351
Bug: 161243686
Test: ran unit tests (CL affects test code only)
Merged-In: Ie787bcf9c66a7605700c3dc29a8aa16406926ce3
Change-Id: I2b02a36a70a0920f31ffc00de102a23516d4b20e
2021-06-24 03:38:55 +00:00
Cong Lin
61218ec6cf Fix L3 clock loading issue
This is a merge of http://go/wvgerrit/126703
Only obfuscated libraries for Android are included in this CL.

L3 loads clock info from an encrypted file during initialization. There
is a bug which calls the clock loading function before the decryption
key gets intialized in InitializeEngine(). Clock will be loaded with bad
decrypted data, which caused playback failure after system reboot.

The fix is to move clock loading after InitializeEngine() to ensure
decryption key is ready.

Bug: 188873354
Bug: 188892717
Test: L3 unit tests;
Test: Manual playback tests on Netflix
      Download, play, reboot device, play again
Test: GTS tests https://android-build.googleplex.com/builds/tests/view?invocationId=I02800009363823424&testResultId=TR23225132004211909&redirect=http://sponge2/73efa8e8-951a-48bb-b2a9-0b09d5038ed3

Change-Id: Icf34aa3135fdcb77dea8104a90ce90f14e79e61c
2021-06-21 22:15:18 +00:00
Fred Gylys-Colwell
50a52710fa Allow delayed error code in generic crypto
Merge from Widevine repo of http://go/wvgerrit/127246

The unit tests WvGenericCryptoTest expected an error code to be
returned from SelectKey. But we allow an invalid key to be signaled
either at SelectKey or later when the decrypt operation occurs.

This CL just updates the tests.

Bug: 190745519
Test: ran tests on bonito
Change-Id: Ibacc92d6a6e708f2f104cb549b5845335f6c8cf5
2021-06-17 04:33:50 +00:00
Rahul Frias
52d3c9f7c1 Update VersionNumberTest.VersionNumberChangeCanary
[ Merge of http://go/wvgerrit/126463 ]

The Version Number in the test is being updated to 12 to reflect
android OS version (Test only change)

Bug: 190467766
Test: WV request_license_test:
      requestVersionNumberTest.VersionNumberChangeCanary
Change-Id: Iad4bb3f178fb2dcb454027c1323e51fe34dfdfff
2021-06-15 03:01:55 -07:00
Rahul Frias
8e92fef410 Address unit test failures
[ Merge of http://go/wvgerrit/126744 ]

* EngineMetrics previous_oemcrypto_initialization_failure is set only
  on a previous failure. Removing it from the list of expectations
  as we cannot be certain that it will or will not be set unless we
  know the previous state of the device.

* Corrected client_capabililties expectations in
  CdmLicenseTest.PrepareKeyRequestValidation

* Correct error expected in
  - WVDrmPluginTest.RejectsAtscProvisioningRequests
  - WVDrmPluginTest.RejectsAtscUnprovisionDeviceRequests

* Correct expectations
  - CdmSessionTest.InitWithBuiltInCertificate,
  - CdmSessionTest.InitWithCertificate
  - CdmSessionTest.ReInitFail,
  - CdmSessionTest.InitFailCryptoError

Bug: 181693982
Test: WV unit/integration tests
Change-Id: I2f1e1c38604d768e0532b30d8551c77ea45e63f4
2021-06-14 08:04:40 +00:00
TreeHugger Robot
eced697d90 [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into qt-dev am: 35b1be117e am: 1ea8bee2a1 -s ours am: 49462e3f0d am: 21b722330a -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ieb11acff89bb02d7f0ab3fbb41ce2b1349311c33
2021-06-09 23:46:10 +00:00
Cong Lin
2ed99512eb [automerger skipped] [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: f10acda463 am: ae49fad32b -s ours am: 6c16096c18 am: f11c581b5b -s ours
am skip reason: subject contains skip directive

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

Change-Id: I1b8e78cac099447cdce0371ce1baf3cacea823f3
2021-06-09 23:46:09 +00:00
TreeHugger Robot
6665272f76 [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into qt-dev am: 35b1be117e am: 1ea8bee2a1 -s ours am: 49462e3f0d am: 816a7cd53b -s ours
am skip reason: subject contains skip directive

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

Change-Id: I9c27ee37767cd0a7cb994878e6a6f93e8a49ebc0
2021-06-09 23:45:45 +00:00
Cong Lin
a01dd26e32 [automerger skipped] [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: f10acda463 am: ae49fad32b -s ours am: 6c16096c18 am: 708c24e406 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I7e3d4c0cd74cbc13a80f5e4c1daa1ba665bf43d5
2021-06-09 23:45:43 +00:00
TreeHugger Robot
21b722330a [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into qt-dev am: 35b1be117e am: 1ea8bee2a1 -s ours am: 49462e3f0d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629081

Change-Id: I3e0484621df15a693a4bf868f1c229e5e04b9615
2021-06-09 23:27:08 +00:00
Cong Lin
f11c581b5b [automerger skipped] [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: f10acda463 am: ae49fad32b -s ours am: 6c16096c18
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629081

Change-Id: I445c5a1535c4ef78205093e396362dc587b5c754
2021-06-09 23:27:07 +00:00
TreeHugger Robot
816a7cd53b [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into qt-dev am: 35b1be117e am: 1ea8bee2a1 -s ours am: 49462e3f0d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629081

Change-Id: Ibf6230dfed09760bbd16f56526cb2055f7a6055e
2021-06-09 23:26:39 +00:00
Cong Lin
708c24e406 [automerger skipped] [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: f10acda463 am: ae49fad32b -s ours am: 6c16096c18
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629081

Change-Id: Ia0335af4bf828a273579b1a7bc5a10eab78ef07c
2021-06-09 23:26:38 +00:00
TreeHugger Robot
49462e3f0d [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into qt-dev am: 35b1be117e am: 1ea8bee2a1 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I78845333f380e606b7a05e34835b32b34df63df2
2021-06-09 23:15:16 +00:00
Cong Lin
6c16096c18 [automerger skipped] [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: f10acda463 am: ae49fad32b -s ours
am skip reason: subject contains skip directive

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

Change-Id: I1d4f60902b573d8f7ba76fc24406fc34db71a7d0
2021-06-09 23:14:27 +00:00
TreeHugger Robot
1ea8bee2a1 Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into qt-dev am: 35b1be117e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629081

Change-Id: I6383c0dc15866b3ccad0b7b8a097fb4208f7d25d
2021-06-09 23:02:47 +00:00
Cong Lin
ae49fad32b [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: f10acda463
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629081

Change-Id: I4bcbdfd8fe317277901c52f3e8fbd1a420b2f2b8
2021-06-09 23:02:46 +00:00
TreeHugger Robot
35b1be117e Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into qt-dev 2021-06-09 22:40:20 +00:00
TreeHugger Robot
e9695a79ef [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into rvc-dev am: d8851ceda3 am: 0fa815a51e -s ours
am skip reason: subject contains skip directive

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

Change-Id: I6bae43f503cdae9d92ced1cd77e0cc5d821ac93a
2021-06-09 22:07:11 +00:00
Cong Lin
ede4ffed7f [automerger skipped] [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: e4cfcab140 -s ours am: 7dd96a13a7 -s ours
am skip reason: subject contains skip directive

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

Change-Id: If76f0263de86d368584584c9fb358ac622ce25cd
2021-06-09 22:05:26 +00:00
TreeHugger Robot
f8645d9966 [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into rvc-dev am: d8851ceda3 am: c276a94eac -s ours
am skip reason: subject contains skip directive

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

Change-Id: Icbd063a89907a4f55efd57044675fef62ddbb7b1
2021-06-09 21:54:29 +00:00
Cong Lin
216e8317d4 [automerger skipped] [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: e4cfcab140 am: 23fa208349 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ie87e47438089ddcfb6883ee54db97b17c878e5a0
2021-06-09 21:53:49 +00:00
TreeHugger Robot
0fa815a51e Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into rvc-dev am: d8851ceda3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629074

Change-Id: Idb1c7af62e6eb1bfefe1ced67d96f2ff8830d3d3
2021-06-09 21:53:47 +00:00
Cong Lin
7dd96a13a7 [automerger skipped] [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: e4cfcab140 -s ours
am skip reason: skipped by user conglin

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

Change-Id: I5b8d1c9e69b06cf15cba25c11cbc066a9aa8b382
2021-06-09 21:53:40 +00:00
TreeHugger Robot
c276a94eac Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into rvc-dev am: d8851ceda3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629074

Change-Id: I32986d4d5aeef67ef43e99f34250c8b2bee16d63
2021-06-09 21:36:50 +00:00
Cong Lin
23fa208349 [RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate am: e4cfcab140
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14629074

Change-Id: Id73aea48ba5962021cbf6d200a55936b0ce824f7
2021-06-09 21:36:48 +00:00
TreeHugger Robot
1f1f35f56a Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into sc-dev 2021-06-09 21:33:04 +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
d8851ceda3 Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into rvc-dev 2021-06-09 21:19:20 +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
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
d1d0fa431a Merge "Disallow restoring an offline license multiple times" into sc-dev 2021-06-08 23:57:23 +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
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