Commit Graph

5103 Commits

Author SHA1 Message Date
Robert Shih
20b7762982 Add 1.3 widevine hidl target
libwvhidl picked from the following builds:
+--------+---------+
| arch   | build   |
+--------+---------+
| arm    | 7520386 |
| arm64  | 7511028 |
| x86    | 7511028 |
| x86_64 | 7511028 |
+--------+---------+

Ran patchelf to set DT_SONAME to libwvhidl@1.3.so

Bug: 191881462
Test: atest MediaDrmTest#testOemCryptoVersion
Change-Id: I0f6c6750124d89145ef54c47d7dc8c95a7207063
2021-07-02 23:24:38 -07:00
Alex Dale
b6cdd12394 Added write protection for session to engine map.
[ Merge of http://go/wvgerrit/128325 ]

There were a few cases where |cdm_by_session_id_| was being iterated
over and the CDM did not acquire any write-protection locks to prevent
other threads from changing the map simultaneously.

In particular, it was possible that while cleaning up a CDM, and
removing all the associated session in |cdm_by_session_id_| another
CDM could have been opening a session and creating a new association
in |cdm_by_session_id_| at the same time.

Cases where |cdms_| and/or |cdm_by_session_id_| is being written to or
iteratively read from should require a lock.  The iterator of
std::map maintains a "view" into the map's tree structure.  Modifying
the map (inserting or deleting elements) can potentially change the
structure of the map and the underlying assumptions built into an
iterator's view (ex, the iterator thinking there is an element to the
left or right).

Modifying the value within the map can potentially cause problems, but
is not applicable in our case (we modify the object pointed to by the
map element, but not the pointer itself).

Bug: 190405462
Test: build_and_run_all_unit_tests.sh and MediaDrmTest
Change-Id: I043e238570dac9a0db990f8fe66be271062b965c
2021-07-01 18:37:18 -07:00
Rahul Frias
a3657ab200 Merge "Disable expiration for legacy DRM certificates" into sc-dev 2021-07-01 21:00:14 +00:00
Rahul Frias
151d0b15d3 Disable expiration for legacy DRM certificates
[ Merge of http://go/wvgerrit/128163 ]

In android S, we added a feature b/169740403 [Limited lifespan DRM
certificates with license preservation]

Due to uncertainties of when the provisioning service will
launch, we are disabling expiration for legacy DRM certificates.
If the feature does not launch in time, existing DRM certificates
will expire and be replaced. Offline licenses associated with these
expired DRM certificates will fail to load.

Expiration of legacy certificates will be reenabled at a later time.
The main portion of feature, the issuing of new DRM certificates with
expiration time will still be supported.

Bug: 192428783
Bug: 169740403
Test: WV unit/integration tests
Change-Id: I1d1184249848f215953a837f369528d3b74c9618
2021-07-01 19:24:02 +00:00
Rahul Frias
d30c5043d1 Merge "Correct an error reported when a license is restored and then released" into sc-dev 2021-07-01 19:17:21 +00:00
Alex Dale
1229aedcea Merge "PST and non PST can handle unlimited license durations." into sc-dev 2021-07-01 06:45:07 +00:00
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
Alex Dale
14bd15a08c PST and non PST can handle unlimited license durations.
[ Merge of http://go/wvgerrit/128183  ]

As was the case with WvCdmStreamingUsageReportTest.ReportTest, the
following tests were also updated to handle the case where "license
duration" is unlimited:
- WvCdmStreamingNoPstTest.UsageTest
- WvCdmStreamingPstTest.UsageTest
- WvCdmOfflineUsageReportTest.UsageTest

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

Bug: 163542905
Test: cdm_extended_duration_test
Change-Id: I24d3fc17fcf19129a19ed39a5c6c1ddd59ed073d
2021-06-30 10:41:07 -07:00
Rahul Frias
c882bd8230 Correct an error reported when a license is restored and then released
[ Merge of http://go/wvgerrit/128143 ]

Now reports LICENSE_STATE_ERROR rather than ERROR_DRM_GENERIC_PLUGIN
to make the cause of failure and suggested action more clear for app
developers. Also added an additional error log.

Bug: 190645000
Test: WV unit/integration tests
Change-Id: Ib23ca628c590316f90f497d8fdfbab24fd644d6f
2021-06-29 20:21:06 -07: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