Commit Graph

5165 Commits

Author SHA1 Message Date
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
Cong Lin
4ec9cb9772 [automerger skipped] Fix L3 clock loading issue am: 61218ec6cf -s ours
am skip reason: skipped by user conglin

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

Change-Id: Idb8807462ba9213a747368fa959b463eb0dd525d
2021-06-25 23:27:55 +00:00
Cong Lin
e98c9150df [RESTRICT AUTOMERGE] Fix L3 clock loading issue
This is a manual merge of ag/14930112 to address an auto merge conflict.

Changes in the obfuscated L3 library:

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: 191988567
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: I947775dc05eb000f1860a889510927861e1d169c
2021-06-25 18:46:21 +00: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
8e8cbfac39 Update VersionNumberTest.VersionNumberChangeCanary am: 52d3c9f7c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14899053

Change-Id: I2fb9f742375cc7191aed1a7748126f36f4ff9b40
2021-06-15 18:07:47 +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
a411834f7e [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: eced697d90 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I71986a273396c56a4a169c619fe77f0169df8652
2021-06-10 00:07:10 +00:00
Cong Lin
acdcdf386f [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: 2ed99512eb -s ours
am skip reason: subject contains skip directive

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

Change-Id: I16b5358b8083bc70db15192ba6ff4f0b202715b2
2021-06-10 00:07:09 +00:00
TreeHugger Robot
4b41e03258 [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: 6665272f76 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I859665a74799b70e04c87db2cc0193a4806d0116
2021-06-10 00:06:52 +00:00
Cong Lin
d6613faf71 [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: a01dd26e32 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I9a76bd8cdb6a245fef15504020d08e2e8300a062
2021-06-10 00:06:51 +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
9ad55ec73e [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: e9695a79ef -s ours
am skip reason: subject contains skip directive

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

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

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

Change-Id: If629e60de002b5622f64b9f315f0ef82b271619e
2021-06-09 22:12:29 +00:00
TreeHugger Robot
6d1ae460b9 [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: f8645d9966 -s ours
am skip reason: subject contains skip directive

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

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

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

Change-Id: I8ea99ce98283a359a68a9f71658f7da6710a50b5
2021-06-09 22:12:23 +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
616e2f171e [automerger skipped] Merge "[RESTRICT AUTOMERGE] L3 Load RSA key from two parts and re-generate build" into sc-dev am: 1f1f35f56a -s ours
am skip reason: subject contains skip directive

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

Change-Id: If3ac1bd341fb305880bd993537263222ae1d8e9e
2021-06-09 21:42:27 +00:00
TreeHugger Robot
13a64ea3cc [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 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I60809018483ef09a42d7287507e47ca7b8f05284
2021-06-09 21:42:24 +00:00
TreeHugger Robot
7bcf74adc9 Merge "L3 Load RSA private key from two parts [sc-dev]" into sc-v2-dev 2021-06-09 21:42:14 +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
44e24b148f 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: I0fce9d92e4babe3756fd044f4b7e1f6f41a4eb66
2021-06-09 00:59:17 +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
612f8bc0a9 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: Iabf693abbe60ec39b7b0a67939961d507b45a9a6
2021-06-09 00:30:49 +00:00