Commit Graph

2683 Commits

Author SHA1 Message Date
David Liu
18be093969 Add SetupWraith into allow list of invoke signRSA API, and remove priv_app from the allow list and modify the error message.
Doc: https://docs.google.com/document/d/19LFE0xWE6E-TfM8MQbxk2lCyNeW-nALBrGA6VX6Donc/edit?resourcekey=0-pe8SXOdScbmqtVQHRDubVw#

Test: Manual

Bug: b/175603696
Change-Id: Ibde963798d3fc5d4696b2d547f0ef3beab579d38
2021-07-14 18:11:04 +00:00
Alex Dale
78278c3eb4 Correctly record license service version in metrics.
[ Merge of http://go/wvgerrit/128683 ]

The CDM session was incorrectly recording the "license SDK version" as
the "license service version" in the session metrics.  This
discrepancy reduces the quality of devices' metrics and limits
debugging capabilities for the Widevine metric monitoring services.

Bug: 193177333
Test: Linux unit tests
Change-Id: Ic58cf7bc4fde777bb590c05777b76f5ff5c2f1ea
2021-07-09 19:25:14 +00:00
Robert Shih
bf98f880d4 Add 1.3 widevine hidl target am: 20b7762982 am: 233c4bd3b2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15191998

Change-Id: I1f885760089a9213f5c7e07ee5a2cb5d3d6ca0eb
2021-07-07 20:17:28 +00:00
Robert Shih
127b7c6e13 Add 1.3 widevine hidl target am: 20b7762982
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15191998

Change-Id: I241adc8ceaf7cb839fc889086c0d914cf73c76e6
2021-07-07 20:03:28 +00:00
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
4d8bc8ff51 Added write protection for session to engine map. am: b6cdd12394 am: 24697f9301
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15180882

Change-Id: I3dc869e6cf9ed07816fb70f96ae89ae1211b5ff0
2021-07-02 17:07:05 +00:00
Alex Dale
b7aa89024e Added write protection for session to engine map. am: b6cdd12394
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15180882

Change-Id: Ic1c256fdee0f52a3d56879782c83f5b01f93788c
2021-07-02 16:59:32 +00: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
TreeHugger Robot
bb62a534bf Merge "[RESTRICT AUTOMERGE] Fix L3 clock loading issue" into sc-v2-dev 2021-07-01 23:34:58 +00:00
Rahul Frias
dd72a8179a Merge "Disable expiration for legacy DRM certificates" into sc-dev am: a3657ab200 am: 9fe7626938
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15144680

Change-Id: I41b02cb18a2193fda1e002c06629aa34df2c30c9
2021-07-01 21:18:13 +00:00
Rahul Frias
5f2fd5a07f Merge "Disable expiration for legacy DRM certificates" into sc-dev am: a3657ab200
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15144680

Change-Id: Iaffb18bcff400cf00a31f95ee9368d94f55d93ff
2021-07-01 21:09:44 +00:00
Rahul Frias
a3657ab200 Merge "Disable expiration for legacy DRM certificates" into sc-dev 2021-07-01 21:00:14 +00:00
Rahul Frias
67639f2a42 Merge "Correct an error reported when a license is restored and then released" into sc-dev am: d30c5043d1 am: 38209bedb6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15150547

Change-Id: I280ee9296643f7f328fb99b4cb5dd42b6189a8fb
2021-07-01 19:36:29 +00:00
Rahul Frias
44cde1757a Merge "Correct an error reported when a license is restored and then released" into sc-dev am: d30c5043d1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15150547

Change-Id: I6417a1091f4d69055c2ecbed6e79bcc61b80f109
2021-07-01 19:29:43 +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
bd36f43d35 Merge "PST and non PST can handle unlimited license durations." into sc-dev am: 1229aedcea am: 4ed10d691f am: ca0ce02872
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15159035

Change-Id: Iccbdf48ea02e7342675560f1a19f49ff228f41a5
2021-07-01 07:21:12 +00:00
Alex Dale
4ed10d691f Merge "PST and non PST can handle unlimited license durations." into sc-dev am: 1229aedcea
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15159035

Change-Id: I4c6493fd8a2abfdddcaa6b6b694122b814c27118
2021-07-01 06:57:30 +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
5a3a50262f Merge "Updated integration test to handle unlimited license durations." into sc-dev am: 16a0ab2309 am: 5e2297dc7e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15136759

Change-Id: Ic6e44caa6530313f50f15048f8cc2d50bcc07e81
2021-07-01 06:02:33 +00:00
Alex Dale
da0d78bf0b Merge "Updated integration test to handle unlimited license durations." into sc-dev am: 16a0ab2309
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15136759

Change-Id: I975afd30a91155770f9e21e48db5184ef63440f4
2021-07-01 05:51:31 +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
1c82e33cb8 Merge "Cache security level" into sc-dev am: 47324cc6fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15085899

Change-Id: Ie95935d67d2959db0877f6425d83d0d23246e51a
2021-07-01 04:42:50 +00:00
TreeHugger Robot
a1dd61ba6d Merge "Add extra RSA private keys to unit tests" into sc-dev am: 853ab51cb3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15136762

Change-Id: I6bf6290d1c8605536d47d502171fef3d790edd18
2021-07-01 04:42:45 +00:00
Fred Gylys-Colwell
2b66fc3475 Merge "Cache security level" into sc-dev am: 47324cc6fe am: 6d2598a291
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15085899

Change-Id: I1a562f26c3de4adf1216f8f1d7c0fc98df3d5bab
2021-06-30 21:43:34 +00:00
TreeHugger Robot
62b27c1b9c Merge "Add extra RSA private keys to unit tests" into sc-dev am: 853ab51cb3 am: 85f91e021a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15136762

Change-Id: Icbd32dfdcb2178f2b0dc86ebb814c88a3c3239fe
2021-06-30 21:43:31 +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
fd01107b54 Merge "Allow delayed error code in generic crypto" into sc-dev am: 99c4d463d9 am: 6e6bdad32a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15008617

Change-Id: Icdea1cd603a893c05e63088567cbabebeba9ee71
2021-06-30 21:24:26 +00:00
TreeHugger Robot
6d1898f20f Merge "Sync oemcrypto reference code" into sc-dev 2021-06-30 21:20:58 +00:00
TreeHugger Robot
0daff1c13d Merge "Allow delayed error code in generic crypto" into sc-dev am: 99c4d463d9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15008617

Change-Id: I57414ecc7b7e99f4ce2714a96d4b550798ce8071
2021-06-30 21:15:47 +00:00
TreeHugger Robot
af0ac69fad Merge "Update OEMCrypto buffer offset tests" into sc-dev am: 41d7b74558 am: ae3815c1fa
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15055162

Change-Id: I2baacf116ca77a092953532ee6997cb55a9890ed
2021-06-30 21:11:21 +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
88c6500ba2 Merge "Update OEMCrypto buffer offset tests" into sc-dev am: 41d7b74558
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15055162

Change-Id: I7f3f64bec9748f6045cc33b67b9f8c7dbe0ded15
2021-06-30 21:02:07 +00:00
TreeHugger Robot
41d7b74558 Merge "Update OEMCrypto buffer offset tests" into sc-dev 2021-06-30 20:49:57 +00:00
Rahul Frias
1c74895135 Merge "Address unit test failures" into sc-dev am: 5271d95ce4 am: 171096b9bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14940264

Change-Id: I2dc400c613a289a51ddb546cd31a9b4aae4d589a
2021-06-30 19:57:09 +00:00
Rahul Frias
725f3d9e18 Merge "Address unit test failures" into sc-dev am: 5271d95ce4
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14940264

Change-Id: Ic5924bf04b90398d41863f95f7a2d43b732d60f2
2021-06-30 19:42:13 +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
TreeHugger Robot
f6211cf0ee Merge "Remove OEMCrypto reference" 2021-06-29 18:10:29 +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
42188c007a Remove OEMCrypto reference
Merge from Widevine repo of http://go/wvgerrit/125203

The OEMCrypto reference is not used/built on Android.  It was being
published to aid OEMs in their development, but now the OPK library
is the implementation to be used by OEMs.

Bug: 187556088
Bug: 184866351
Test: Ran android/copy_files
Change-Id: Ie787bcf9c66a7605700c3dc29a8aa16406926ce3
2021-06-29 15:51:12 +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
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
Cong Lin
49f23ff25b Fix L3 clock loading issue am: 61218ec6cf am: c16317b811
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14930112

Change-Id: I42fdcdeef1e21ecf8cbeae8d67428de93b7757c5
2021-06-24 19:13:18 +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