Commit Graph

5480 Commits

Author SHA1 Message Date
Edwin Wong
9d1ad7590a Merge "Fix WVCryptoPlugin use after free vulnerability." into sc-dev 2021-04-05 20:47:48 +00:00
Alex Dale
1df93e5cae Merge "Restructed reference root of trust (1/3 Keybox)" into sc-dev am: 3e2c0f03e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13625375

Change-Id: Iebbb289b724e71fd1b7f8697120d3970dc591fca
2021-03-31 03:02:39 +00:00
Alex Dale
eae12f517e Merge "Restructed reference root of trust (1/3 Keybox)" into sc-dev am: 3e2c0f03e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13625375

Change-Id: I0f683148dd7ab94cacee9417430549c989bec103
2021-03-31 03:02:38 +00:00
Alex Dale
3e2c0f03e7 Merge "Restructed reference root of trust (1/3 Keybox)" into sc-dev 2021-03-31 02:22:07 +00:00
Bob Badour
fccf162f9b [automerger skipped] [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine am: 7f34e59ce6 -s ours am: d476f90f74 -s ours
am skip reason: skip tag Change-Id I41ef520b6e394a7708f453a706e6ef1a5f46c36a with SHA-1 376f47047c is already in history

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

Change-Id: I1c010ebfed188a3476da504380e4b06a9171262b
2021-03-30 23:49:31 +00:00
Bob Badour
a1b84662d4 [automerger skipped] [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine am: 7f34e59ce6 -s ours am: d476f90f74 -s ours
am skip reason: skip tag Change-Id I41ef520b6e394a7708f453a706e6ef1a5f46c36a with SHA-1 376f47047c is already in history

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

Change-Id: I74488677f1f5cddbd5391ddee24639a1673dad9b
2021-03-30 23:48:18 +00:00
Bob Badour
d476f90f74 [automerger skipped] [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine am: 7f34e59ce6 -s ours
am skip reason: skip tag Change-Id I41ef520b6e394a7708f453a706e6ef1a5f46c36a with SHA-1 376f47047c is already in history

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

Change-Id: I94333625aa4477be456a34a22649569f55b565fc
2021-03-30 23:13:56 +00:00
Bob Badour
7f34e59ce6 [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine
Added SPDX-license-identifier-Apache-2.0 legacy_by_exception_only to:
  Android.bp
  libwvdrmengine/Android.bp
  libwvdrmengine/vts/vendor_module/Android.bp

Added legacy_by_exception_only to:
  libwvdrmengine/cdm/Android.bp
  libwvdrmengine/cdm/core/src/Android.bp
  libwvdrmengine/cdm/core/test/Android.bp
  libwvdrmengine/cdm/metrics/src/Android.bp
  libwvdrmengine/cdm/test/integration-test.mk
  libwvdrmengine/cdm/test/unit-test.mk
  libwvdrmengine/level3/Android.bp
  libwvdrmengine/mediacrypto/Android.bp
  libwvdrmengine/mediacrypto/test/Android.mk
  libwvdrmengine/mediadrm/Android.bp
  libwvdrmengine/mediadrm/test/Android.mk
  libwvdrmengine/oemcrypto/odk/Android.bp
  libwvdrmengine/oemcrypto/odk/test/fuzzing/Android.bp
  libwvdrmengine/oemcrypto/odk/test/fuzzing/corpus_generator/Android.bp
  libwvdrmengine/oemcrypto/test/Android.mk
  libwvdrmengine/test/unit/Android.mk
  libwvdrmengine/tools/metrics_dump/Android.bp

Added SPDX-license-identifier-Apache-2.0 legacy_by_exception_only to:
  libwvdrmengine/Android.mk
  libwvdrmengine/vts/vendor_module/Android.mk

Added legacy_by_exception_only to:
  libwvdrmengine/level3/arm/Android.mk
  libwvdrmengine/level3/arm64/Android.mk
  libwvdrmengine/level3/mips/Android.mk
  libwvdrmengine/level3/mips64/Android.mk
  libwvdrmengine/level3/x86/Android.mk
  libwvdrmengine/level3/x86_64/Android.mk
  libwvdrmengine/mediacrypto/Android.mk
  libwvdrmengine/mediadrm/Android.mk
  libwvdrmengine/oemcrypto/test/XtsTest.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I41ef520b6e394a7708f453a706e6ef1a5f46c36a
Merged-in: I41ef520b6e394a7708f453a706e6ef1a5f46c36a
2021-03-30 09:26:30 -07:00
Cong Lin
882bdeb968 [automerger skipped] Refresh L3 builds for buffer overflow fixes on rvc-qpr-dev am: ce607283c1 am: 6a08cd3890 -s ours am: 4021ba6357
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13973686

Change-Id: I3b2d8302dfb84ee8003cce311013f31de944e7a0
2021-03-30 11:18:14 +00:00
Cong Lin
3c800963c1 [automerger skipped] Refresh L3 builds for buffer overflow fixes on rvc-qpr-dev am: ce607283c1 am: 6a08cd3890 -s ours am: 4021ba6357
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13973686

Change-Id: I0bcb116d1d7bdb64d58b7363e440ae2cd6e5446b
2021-03-30 11:18:11 +00:00
Cong Lin
4021ba6357 [automerger skipped] Refresh L3 builds for buffer overflow fixes on rvc-qpr-dev am: ce607283c1 am: 6a08cd3890 -s ours
am skip reason: skipped by user robertshih

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

Change-Id: I7f22588ac59b705197124860b42469ef904f64ed
2021-03-30 09:24:12 +00:00
Cong Lin
6a08cd3890 Refresh L3 builds for buffer overflow fixes on rvc-qpr-dev am: ce607283c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13973686

Change-Id: I398d987ae78d5f438d89894a2e41f51b5db6f8ce
2021-03-30 01:36:38 +00:00
Bob Badour
370fd82082 Merge "[LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine" into sc-dev am: ea0bd6030c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13998816

Change-Id: I93fec9892f4ad56a29370311bf7ffcc5543f8fa3
2021-03-26 07:27:49 +00:00
Bob Badour
000b7d9716 Merge "[LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine" into sc-dev am: ea0bd6030c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13998816

Change-Id: I0e802fea548cd498d3d0e2787caf4a49f0339687
2021-03-26 07:01:24 +00:00
Bob Badour
ea0bd6030c Merge "[LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine" into sc-dev 2021-03-26 06:45:39 +00:00
Alex Dale
0d2f61c5bd Merge "Use new Base64 encode functions." into sc-dev am: 50757c84ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13972381

Change-Id: Ie87b5f5adb6b083c54e28c82fe599fc695ea044b
2021-03-26 05:44:23 +00:00
Alex Dale
5b5aebe551 Merge "Base64 encoding for string input." into sc-dev am: e189968a16
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13972380

Change-Id: I54d7be8471881ab7070b9399a15c2dc4a10a6bda
2021-03-26 05:44:20 +00:00
Alex Dale
bb709bfd27 Merge "Use new Base64 encode functions." into sc-dev am: 50757c84ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13972381

Change-Id: Iecee22009d4a0d56cf34133f83e44a5beab92747
2021-03-26 05:36:21 +00:00
Alex Dale
fb651b1974 Merge "Base64 encoding for string input." into sc-dev am: e189968a16
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13972380

Change-Id: I44f3bac15846b260feb3620641293660066bd004
2021-03-26 05:34:52 +00:00
Alex Dale
50757c84ec Merge "Use new Base64 encode functions." into sc-dev 2021-03-26 05:19:31 +00:00
Alex Dale
e189968a16 Merge "Base64 encoding for string input." into sc-dev 2021-03-26 05:18:43 +00:00
Bob Badour
376f47047c [LSC] Add LOCAL_LICENSE_KINDS to vendor/widevine
Added SPDX-license-identifier-Apache-2.0 legacy_by_exception_only to:
  Android.bp
  libwvdrmengine/Android.bp
  libwvdrmengine/vts/vendor_module/Android.bp

Added legacy_by_exception_only to:
  libwvdrmengine/cdm/Android.bp
  libwvdrmengine/cdm/core/src/Android.bp
  libwvdrmengine/cdm/core/test/Android.bp
  libwvdrmengine/cdm/metrics/src/Android.bp
  libwvdrmengine/cdm/test/integration-test.mk
  libwvdrmengine/cdm/test/unit-test.mk
  libwvdrmengine/level3/Android.bp
  libwvdrmengine/mediacrypto/Android.bp
  libwvdrmengine/mediacrypto/test/Android.mk
  libwvdrmengine/mediadrm/Android.bp
  libwvdrmengine/mediadrm/test/Android.mk
  libwvdrmengine/oemcrypto/odk/Android.bp
  libwvdrmengine/oemcrypto/odk/test/fuzzing/Android.bp
  libwvdrmengine/oemcrypto/odk/test/fuzzing/corpus_generator/Android.bp
  libwvdrmengine/oemcrypto/test/Android.mk
  libwvdrmengine/test/unit/Android.mk
  libwvdrmengine/tools/metrics_dump/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I41ef520b6e394a7708f453a706e6ef1a5f46c36a
2021-03-25 09:52:52 -07:00
Alex Dale
9f7e2c4413 Restructed reference root of trust (3/3 OEM Cert)
[ Merge of http://go/wvgerrit/116944 ]

This change is the last part of a three part change for restructing
the root of trust used by the reference implementation.

OEM Certificates are now managed by the root of trust of the crypto
engine.  Previously, OEM certs where handled separately on a session
by session basis.

Bug: 135283522
Test: oemcrypto_unittests ce_cdm_tests
Change-Id: I6cf1fa3fade28baad85b5fce57a8eab6f2ed17c1
2021-03-24 19:14:17 -07:00
Alex Dale
f6f5099604 Restructed reference root of trust (2/3 DRM Cert)
[ Merge of http://go/wvgerrit/115551 ]

This change is the second part of a three part change for restructing
the root of trust used by the reference implementation.

The use of RSA_shared_ptr has been replaced with the standard library
std::shared_ptr using the RsaPrivateKey wrapper class.  The
AuthenticationRoot class now uses this for the built-in DRM cert key.

RSA decryption and signature operations within the session context are
now performed the RsaPrivateKey class.  This has reduced the code size
and complexity within the reference and testbed, focusing their
implementation on key policy and less on mechanics.

Bug: 168544740
Bug: 135283522
Test: oemcrypto_unittests ce_cdm_tests
Change-Id: Ic743a529a9858f3182290d8bcf5e1633737b005b
2021-03-24 19:14:17 -07:00
Alex Dale
e4ee4eb404 Restructed reference root of trust (1/3 Keybox)
[ Merge of http://go/wvgerrit/115550 ]

This change is the first part of a three part change for restructing
the root of trust used by the reference implementation.

The API of the AuthenticationRoot class has been updated to reflect
the OEMCrypto functions that relate to the root of trust.  This
involves changing the keybox and DRM Cert methods and adding in new
stubs for OEM Certificates.

The WvKeybox now uses a RAII-like interface to ensure that keyboxes
are provisioned correctly or not at all.

Bug: 135283522
Test: oemcrypto_unittests ce_cdm_tests
Change-Id: I3f2baf29c1022e1806b6196fa6650d761785c626
2021-03-24 19:14:17 -07:00
Rahul Frias
90cd0248d6 Merge "Have system clocks return wall time" into sc-dev am: 8c6ce2e4c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13944148

Change-Id: I19b578a1e90932a19b1dd0e94ddcd2b71c841322
2021-03-24 01:50:52 +00:00
Rahul Frias
43c7ac72b3 Merge "Have system clocks return wall time" into sc-dev am: 8c6ce2e4c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13944148

Change-Id: I02e6c1e5523512aa1c6b57082ec4d4b4ac1e5d3f
2021-03-24 01:50:30 +00:00
Rahul Frias
8c6ce2e4c9 Merge "Have system clocks return wall time" into sc-dev 2021-03-24 01:23:19 +00:00
Rahul Frias
e729a53eff Save and retrieve key information from licenses and usage records am: e538c96131
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13947818

Change-Id: I069e5654eba3be908815406d38e270f6188f86e5
2021-03-23 22:33:44 +00:00
Rahul Frias
e2d3826aff Save and retrieve key information from licenses and usage records am: e538c96131
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13947818

Change-Id: I50878894d78ceeda6d134dca653b9e84c5311e09
2021-03-23 22:32:51 +00:00
Alex Dale
d859c1ab17 Use new Base64 encode functions.
[ Merge of http://go/wvgerrit/119806 ]

This change replaces all calls for base64 encoding which first converts
a string to a vector.  The new base64 encoding function allow for
encoding binary data contained within strings.

Bug: 181732604
Test: Android unittests
Change-Id: Ibfe79dba99e6a2ee2f2a96e85b62fbd22519aea7
2021-03-23 14:49:58 -07:00
Alex Dale
e51f869190 Base64 encoding for string input.
[ Merge of http://go/wvgerrit/119805 ]

This change adds 3 new functions for encoding binary data from a C++
string to a base64 encoded ASCII string.

The CDM and protobuf generated code use C++ strings to store binary
data.  These binary strings are commonly converted into a base64
encoded ASCII string for logging and for returning to the app.

This change also cleans up some of the internal components of the
string_conversions library to use several standard library C++11
method.

Bug: 181732604
Test: CE CDM unittests
Change-Id: I547568c6402e011344260f2df2a06e972122ab8a
2021-03-23 14:49:46 -07:00
Rahul Frias
e538c96131 Save and retrieve key information from licenses and usage records
[ Merge of http://go/wvgerrit/120512 ]

Wrapped DRM private keys are loaded when a key request is made or when
offline/usage sessions are restored. They were earlier loaded when a
session was opened.

For streaming sessions, key material will be fetched from the default
or legacy certificates and loaded when a key request is made.

For offline and usage sessions, key material may be retrieved from
license or usage records if available. If not available, information
associated with the legacy certificate will be loaded.

Certificate and wrapped keys are also written out when an offline
license or usage record is saved.

Bug: 169740403
Test: WV unit/integration tests
      WvCdmRequestLicenseTest.ProvisioningWithExpiringCertTest
      WvCdmRequestLicenseTest.StreamingWithExpiringCertTest
      WvCdmRequestLicenseTest.RestoreOfflineKeysWithExpiringCertTest
Change-Id: Ice0154c632170c46da171cbbb23a97380c610a98
2021-03-23 13:06:55 -07:00
Cong Lin
ce607283c1 Refresh L3 builds for buffer overflow fixes on rvc-qpr-dev
Cherry-pick CL from wv master:
https://widevine-internal-review.git.corp.google.com/c/cdm/+/118363

Fixes included in this CL:
go/wvgerrit/111603
Fix L3 block offset test and re-enable buffer overflow tests

go/wvgerrit/111784
Fix heap overflow test in L3 and OEMCrypto ref

go/wvgerrit/113644
Check for buffer overflow when computing subsample size

go/wvgerrit/113946
Fix test failures caused by huge key length in L3

Bug: 180956067
Bug: 175001473
Bug: 175741683
Bug: 172866305
Bug: 175041667
Test: L3 unit test
Test: go/forrest https://android-build.googleplex.com/builds/tests/view?invocationId=I10900007766741431&testResultId=TR22818280880061022&redirect=http://sponge2/3c1fc176-f3bc-46e6-af7c-b2925ae3765b
Change-Id: Ied639d0639295aa6fade1d9ff3c6eab6a941b36d
2021-03-23 11:12:35 -07:00
Cong Lin
c6e310b50a Refresh L3 builds for buffer overflow fixes on master
Merge CL from wv master:
https://widevine-internal-review.git.corp.google.com/c/cdm/+/118363

Fixes included in this CL:
go/wvgerrit/111603
Fix L3 block offset test and re-enable buffer overflow tests

go/wvgerrit/111784
Fix heap overflow test in L3 and OEMCrypto ref

go/wvgerrit/113644
Check for buffer overflow when computing subsample size

go/wvgerrit/113946
Fix test failures caused by huge key length in L3

Bug: 180956067
Bug: 175001473
Bug: 175741683
Bug: 172866305
Bug: 175041667
Test: L3 unit test
Test: go/forrest https://android-build.googleplex.com/builds/tests/view?invocationId=I10900007766741431&testResultId=TR22818280880061022&redirect=http://sponge2/3c1fc176-f3bc-46e6-af7c-b2925ae3765b
Change-Id: Ied639d0639295aa6fade1d9ff3c6eab6a941b36d
2021-03-23 16:49:04 +00:00
Rahul Frias
dfd695c671 Add CLIENT_TOKEN_NOT_SET error code am: 30ebbefb40
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13947817

Change-Id: Idaf7baba8b96c6efcd02c324758f50b4c55adea1
2021-03-23 04:09:58 +00:00
Rahul Frias
66c9d9e351 Add certificate information to Usage Information am: 1aa197ce4a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13937951

Change-Id: If540a1344dda9387a41f4fa83b6a92c76be77b23
2021-03-23 04:09:56 +00:00
Rahul Frias
4d1d7296d8 Add CLIENT_TOKEN_NOT_SET error code am: 30ebbefb40
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13947817

Change-Id: Ibb78f0a98a32e17452f1082fcea9118f23129270
2021-03-23 04:09:52 +00:00
Rahul Frias
78b6b40343 Add certificate information to Usage Information am: 1aa197ce4a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13937951

Change-Id: Ie8abef21cb159f0805fb753783f8acd1e198b342
2021-03-23 04:09:50 +00:00
Rahul Frias
30ebbefb40 Add CLIENT_TOKEN_NOT_SET error code
[ Merge of http://go/wvgerrit/120511 ]

Bug: 169740403
Test: WV unit/integration test
Change-Id: Iba77c0b7e7f1bee1e96b0d08f0ab8e8591292012
2021-03-22 17:08:34 -07:00
Rahul Frias
1aa197ce4a Add certificate information to Usage Information
[ Merge of http://go/wvgerrit/120509 ]

Certificates and wrapped key material are stored in the usage information
file but apart from usage information records. Usage info records include
an identifier which indicates the associated certificate. Routines to
help with finding, inserting or removal of associated certificates have
been included. After a usage entry is deleted, a garbage collection
routine is run to remove any certificates not used by usage infomation
records.

Bug: 169740403
Test: WV unit/integration tests
Change-Id: I49075a7704a58c2488b73eb7c38b007958af566d
2021-03-22 17:07:25 -07:00
Rahul Frias
d492539c25 Merge changes Ic0de6328,Ic263f3df into sc-dev am: 335720be1c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13925120

Change-Id: I225ba4182a2b37355e1105a6b4383f6c76786e1e
2021-03-22 21:00:04 +00:00
Alex Dale
d80f6b38b7 Merge "Sync Android reference with CDM reference." into sc-dev am: 8e090b47b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13635472

Change-Id: I21909ef6a32a42c60fa0fc8094e9a7e9183d6c1e
2021-03-22 20:59:51 +00:00
Rahul Frias
dfe3ecc1a8 Merge changes Ic0de6328,Ic263f3df into sc-dev am: 335720be1c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13925120

Change-Id: I640243505f50e53e7f0ee97b8c6c23b667210cb2
2021-03-22 20:55:17 +00:00
Alex Dale
81d5236ef6 Merge "Sync Android reference with CDM reference." into sc-dev am: 8e090b47b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13635472

Change-Id: I5056c23eb5f4d5aee370a7ba7e5efcb1d0632cd5
2021-03-22 20:53:56 +00:00
Rahul Frias
335720be1c Merge changes Ic0de6328,Ic263f3df into sc-dev
* changes:
  Add certificate information to offline licenses
  Add comments to clarify client and service clock times
2021-03-22 20:23:52 +00:00
Alex Dale
8e090b47b8 Merge "Sync Android reference with CDM reference." into sc-dev 2021-03-22 20:22:42 +00:00
Rahul Frias
57ebb70fe7 Add certificate information to offline licenses
[ Merge of http://go/wvgerrit/120508 ]

Offline licenses will now store the DRM certificate information. This
allows for expired certificates to be deleted and replaced without
losing the ability to use offline licenses.

Bug: 169740403
Test: WV unit/integration tests
      DeviceFilesTest.RetrieveLicenses
      DeviceFilesTest.StoreLicenses
Change-Id: Ic0de6328d32e0000d1b58c81019e6c2227278cc4
2021-03-21 19:11:06 -07:00
Rahul Frias
f6b4d140f4 Add comments to clarify client and service clock times
[ Merge of http://go/wvgerrit/120510 ]

* Added some comments to clarify which clock times are computed at the
  client and at the provisioning service. More detail is present in the
  device_files.proto
* Moved helper methods |SetDeviceCertificate| and
  |ExtractFromDeviceCertificate| from class methods to anonymous
  namespace
* Removed some commented out code

Bug: 169740403
Test: WV unit/integration
Change-Id: Ic263f3dfe296fff6d9b5380b2e7c663d87022cb2
2021-03-21 14:40:12 -07:00
Rahul Frias
615a1e9f64 Have system clocks return wall time
[ Merge of http://go/wvgerrit/120445 ]

Switch TestHost and FakeClock to use chrono::system_clock (wall time)
rather than chrono::steady_clock (ticks since boot time).

Bug: 183160800
Test: CE CDM tests
Change-Id: I6ef4c02c01ff96453847ee8f42e6037c298866b5
2021-03-21 13:34:05 -07:00