Commit Graph

5027 Commits

Author SHA1 Message Date
Robert Shih
0312228684 wvoec3: add membarriers to complete cache flush am: cbfc3c7193
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13719187

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I64250150d64415724f332406778e6459e09285eb
2021-03-02 05:32:21 +00:00
Robert Shih
7cb52c1ccf wvcdm: filter logs by app uid
This commit is a combination of the following:
* http://go/wvgerrit/117003
* http://go/wvgerrit/118303

Bug: 162255728
Test: MediaDrmTest#testGetLogMessages
Change-Id: I5699b64d5c4bab463e5b587595fa7d324dc1d93f
2021-03-01 11:56:37 -08:00
Robert Shih
cbfc3c7193 wvoec3: add membarriers to complete cache flush
Merge of http://go/wvgerrit/104543

Bug: 159465432
Test: oemcrypto_test
Change-Id: Idcf345088c1d40836b5e100d2f758147986a4b04
2021-02-28 05:57:40 +00:00
Alex Dale
f7389f1b3a Reference code for ECC operations.
[ Merge of http://go/wvgerrit/113750 ]

This introduces two classes EccPublicKey and EccPrivateKey which
perform all ECC-specific crypto operations.  The main operations
required by ECC are:
- Load/serialize keys from/to X.509 DER formats
- Generate ECC signatures
- Verify ECC signatures
- Derive session keys used by other OEMCrypto operations

These new classes still need to be plugged into rest of the reference
OEMCrypto implementation.

Bug: 135283522
Test: Future CL
Change-Id: Id071cad9129f95a6eb08662322154ba7d1548d40
2021-02-25 22:10:28 -08:00
Edwin Wong
f3ad627bcb [RESTRICT AUTOMERGE] Fix potential decrypt destPtr overflow.
There is a potential integer overflow to bypass the
destination base size check in decrypt. The destPtr
can then point to the outside of the destination buffer.

Test: sts-tradefed
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176444622#testPocBug_176444622

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-17644462264

Bug: 176444622
Bug: 176496353
Change-Id: Id3aece61d46d548c304782d4e1dc3a4747795c01
Merged-In: Id3aece61d46d548c304782d4e1dc3a4747795c01
2021-02-25 21:34:23 +00:00
Edwin Wong
0b18148b09 Fix potential decrypt destPtr overflow.
There is a potential integer overflow to bypass the
destination base size check in decrypt. The destPtr
can then point to the outside of the destination buffer.

Test: sts-tradefed
  sts-tradefed run sts-engbuild-no-spl-lock -m StsHostTestCases --test android.security.sts.Bug_176444622#testPocBug_176444622

Test: push to device with target_hwasan-userdebug build
  adb shell /data/local/tmp/Bug-17644462264

Bug: 176444622
Bug: 176496353
Change-Id: Id3aece61d46d548c304782d4e1dc3a4747795c01
Merged-In: Id3aece61d46d548c304782d4e1dc3a4747795c01
2021-02-25 17:56:53 +00:00
Jeff Tinker
8b5128c34d Merge "Create a build_all_unit_tests.sh script" into sc-dev am: 1ffc6ab16a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13534779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2958ed998e444c33c41e83df912d593cec8ea8d9
2021-02-24 21:52:38 +00:00
Jeff Tinker
1ffc6ab16a Merge "Create a build_all_unit_tests.sh script" into sc-dev 2021-02-24 19:51:46 +00:00
Rahul Frias
dbedc7d81b Merge changes I5ff61496,Ic1a41ed8 into sc-dev am: 01f597eed2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13613380

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I05794d034c475d2584b71bd73deaab010fe4a6e3
2021-02-24 00:14:34 +00:00
Rahul Frias
01f597eed2 Merge changes I5ff61496,Ic1a41ed8 into sc-dev
* changes:
  Throw DeniedByServerException when provisioning detects a revoked device
  Certificate provisioning proto updates
2021-02-23 23:43:39 +00:00
Rahul Frias
64d5b38ff5 Throw DeniedByServerException when provisioning detects a revoked device
[ Merge of http://go/wvgerrit/117267 ]

The client will now advertise the ability to handle provisioning errors
by a minor version updated to the provisioning protocol version.
The provisioning service may indicate that the individual device
is revoked or all devices with the same make/model have been revoked.

If the provisoning service has not been upgraded, the protocol version
field in the request will be ignored. The provisioning service/SDK
will respond with an HTTP 400 error to a provisioning request from
a revoked device.

Bug: 174174765
Test: WvCdmRequestLicenseTest.ProvisioningRevocationTest,
      WV unit/integration tests
Change-Id: I5ff61496685f310de6704a90452b8b76b3505cbb
2021-02-23 14:36:21 -08:00
Edwin Wong
fc4100555e Merge "Display menu if no argument is given." into sc-dev am: 8659675556
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13669989

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I79a93cc245f87d52e7307ff3856194b925d5449a
2021-02-23 21:52:09 +00:00
Edwin Wong
8659675556 Merge "Display menu if no argument is given." into sc-dev 2021-02-23 21:03:08 +00:00
Rahul Frias
41ecde78cc Certificate provisioning proto updates
[ Merge of http://go/wvgerrit/117266 ]

These changes facilitate communication of provisioning errors from
provisioning service/SDK to the client.

Clients will indicate in the SignedProvisioningMessage whether they
support handling of error information in the ProvisioningResponse.
The provisioning service/SDK can then indicate why the provisioning
request is being rejected.

The protocol_version field from SignedProvisioningMessage has also been
broken into separate protocol version and provisioning type fields.
This will support changes planned for future releases.

Bug: 174174765
Test: WV unit/integration tests
Change-Id: Ic1a41ed8f83b69697300c586a78266fac20298fb
2021-02-23 00:09:32 -08:00
Alex Dale
2793b16afd Merge changes I09249afe,I713ff1c4 into sc-dev am: a1d66834de
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13619230

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1c8611c1e9ee8ac442500ced8d138f6aaafa107f
2021-02-23 07:24:20 +00:00
Alex Dale
0c1d59c516 Report OEMCrypto's ECC capabilities. am: e70c7a116e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13619229

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2143a8fec319b9592ca78483f13adb7ba93c6d4f
2021-02-23 07:24:19 +00:00
Alex Dale
665d0a8318 Merge "Updated DrmDeviceCertificate for signature algo." into sc-dev am: 19e1008df7
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13619228

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iee440593d550b230d3a105b7773fb33d7278b7be
2021-02-23 07:23:52 +00:00
Edwin Wong
0ac0ee50eb Display menu if no argument is given.
If not argument is given, the app just sits and wait
for stdin input, this can be confusing for the user.
Add logic to display menu if no argument is given.

Test: metrics_dump
  display menu

Test: metrics_dump [bugreport from sabrina-q.gz]
  display mediadrm and widevine metrics

Test: metrics_dump --mediadrm [adb shell dumpsys media.metrics output]
  display mediadrm metrics

Test: metrics_dump --widevine [adb shell dumpsys media.metrics output]
  display widevine metrics

Test: metrics_dump [bugreport from sabrina-q.gz] --widevine
  display menu because the order is app_name, options, input file

Bug: 180983850
Change-Id: I9b35f782d8f59663661148d3950f89e4724b6bce
Merged-In: I9b35f782d8f59663661148d3950f89e4724b6bce
2021-02-22 23:04:59 -08:00
Alex Dale
a1d66834de Merge changes I09249afe,I713ff1c4 into sc-dev
* changes:
  Enable the CDM to track the DRM private key type.
  Report OEMCrypto's ECC capabilities.
2021-02-23 06:53:31 +00:00
Alex Dale
19e1008df7 Merge "Updated DrmDeviceCertificate for signature algo." into sc-dev 2021-02-23 06:53:18 +00:00
Robert Shih
bac93f6f4c Merge "OEMCrypto_LoadLicense doc cleanup" into sc-dev am: ae9b1cd128
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13639625

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iadc7f7e803a7de2057cb420afbdbaa1623c90eca
2021-02-23 00:18:47 +00:00
Robert Shih
75f6a8871e wvhidl: map wvcdm LogPriority to hidl LogPriority am: f7285fb0e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13580488

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic1d8b48729adeba6931fca0cc900a35f0832dd59
2021-02-23 00:18:11 +00:00
Robert Shih
ae9b1cd128 Merge "OEMCrypto_LoadLicense doc cleanup" into sc-dev 2021-02-22 23:30:55 +00:00
Robert Shih
00b4a9b5b5 OEMCrypto_LoadLicense doc cleanup
Bug: 162255728
Change-Id: I11f74b1f38e0e073e0e2e464bdce41e720f00549
2021-02-20 08:38:39 +00:00
Robert Shih
f7285fb0e9 wvhidl: map wvcdm LogPriority to hidl LogPriority
[Merge of http://go/wvgerrit/117343]

Bug: 162255728
Test: VtsHalDrmV1_4TargetTest
Change-Id: I368b2d7a125e62e46ded322c1e171a15a9a7a1b4
2021-02-19 01:53:22 -08:00
Alex Dale
e15c0607c7 Enable the CDM to track the DRM private key type.
[ Merge of http://go/wvgerrit/110923 ]

The CDM is responsible for telling OEMCrypto the underlying DRM
private key type when loading it into a session.  To do this, the
CDM must determine and store the key type of a successfully loaded
provisioning response.  The type of key is available from the
DRM certificate proto that is provided in the reponse.

This change introduces a class to contain the wrapped key and
type together.  To store the type, the CDM device files have been
updated to include a key type with the DRM certificate and to
store from and load to the new class.

Unittests have been updated for using the new class where the
wrapped key was used before.

Test: Linux unit tests
Bug: 140813486
Change-Id: I09249afe9c291632fb651ecd00eac697d6939ec7
(cherry picked from commit 6c457402e944079271cef488aa4699f986da6a2e)
Merged-In: I09249afe9c291632fb651ecd00eac697d6939ec7
2021-02-18 23:10:39 +00:00
Alex Dale
e70c7a116e Report OEMCrypto's ECC capabilities.
[ Merge of http://go/wvgerrit/110824 ]

When generating a provisioning request, the CDM includes the different
certificate key types that are supported.

This change will enable the reporting of ECC certificate types if
OEMCrypto supports them.

Test: Linux unit tests and Android integration test
Bug: 140813486
Change-Id: I713ff1c469dff5c8a41461727ce63486d962575e
(cherry picked from commit 547d2f8775)
Merged-In: I713ff1c469dff5c8a41461727ce63486d962575e
2021-02-18 23:09:53 +00:00
Alex Dale
5e982e8fff Updated DrmDeviceCertificate for signature algo.
[ Merge of http://go/wvgerrit/110823 ]

DrmDeviceCertificate is the CDM's reduced version of DrmCertificate
used in the backend.  With the introduction of ECC, the CDM needs to
extract the signature algorithm to determine how to handle the wrapped
private key used by OEMCrypto post-provisioning.

This change brings the DrmDeviceCertificate in line with the
provisioning service's DrmCertificate message as the new source of
truth.

Bug: 140813486
Test: Compiled proto
Change-Id: I164a1c9266fb74b6cdd0ff35f1986ca032033bba
(cherry picked from commit 667c672c80)
Merged-In: I164a1c9266fb74b6cdd0ff35f1986ca032033bba
2021-02-18 23:08:29 +00:00
Robert Shih
6ead838bb9 Merge "wv hidl: map CdmResponseType to drm@1.4 Status" into sc-dev am: 9397f5b972
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13526141

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib5d5fcde506fe122386d785f973ee699f81b75a8
2021-02-18 00:49:02 +00:00
Robert Shih
50ceb0ee6b WVDrmPlugin: map OEMCryptoResult to drm@1.4 Status am: 0450bfcda1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13593533

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5b73be35ff7a7114fe35d2cbc3b55a26aee54b5f
2021-02-18 00:48:54 +00:00
Robert Shih
9397f5b972 Merge "wv hidl: map CdmResponseType to drm@1.4 Status" into sc-dev 2021-02-18 00:25:48 +00:00
Robert Shih
8443dfcad1 Merge "Run git-clang-format on log.{h,cpp}" into sc-dev am: bbfa2b4ff4
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13580486

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9d11c8558bf1a56853ae0d7b4338bb3a7f3aeec1
2021-02-17 09:38:47 +00:00
Robert Shih
0450bfcda1 WVDrmPlugin: map OEMCryptoResult to drm@1.4 Status
Bug: 162255728
Change-Id: Ieb7de4e3d40e132ab17d5907132879714ef7e918
Test: MediaDrmTest#testExceptionMessage
2021-02-17 09:05:21 +00:00
Robert Shih
bbfa2b4ff4 Merge "Run git-clang-format on log.{h,cpp}" into sc-dev 2021-02-17 09:01:14 +00:00
Robert Shih
89b9cb2706 Run git-clang-format on log.{h,cpp}
Bug: 168341163
Test: build
Change-Id: Ie51b1d4ab66e256992b6fffa524331ec124e047d
2021-02-16 00:39:43 -08:00
Robert Shih
25825d2b5d Run git-clang-format am: fa49fdade0
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13549770

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iffd10c82bf128df0bb22a51a9df4f4c4142a6354
2021-02-16 08:17:23 +00:00
Robert Shih
fa49fdade0 Run git-clang-format
Bug: 168341163
Test: build
Change-Id: Icf8bd644ee5e87cd499ee017c8c522a96d385d4c
2021-02-11 08:40:31 -08:00
Jeff Tinker
bcc3313828 Create a build_all_unit_tests.sh script
bug: 163163467
test: ./build_all_unit_tests.sh
      ./build_and_run_all_unit_tests.sh

Merge from: go/wvgerrit/116524

Change-Id: I5eaf5ed34b46445d23530ca0edca94bfaeb3abaf
2021-02-09 12:10:31 -08:00
Robert Shih
6ed2c30a0a wv hidl: map CdmResponseType to drm@1.4 Status
Bug: 162255728
Test: VtsHalDrmV1_4TargetTest
Change-Id: Icc96c17f38218475efc7489348b75c9978f16b01
2021-02-08 19:10:43 -08:00
Robert Shih
5e77f2e388 Merge "libwvhidl: implement API to get plugin logs" into sc-dev am: e77b029214
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13473325

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4584212f682efb29f343e787c360f1467cdffed8
2021-02-05 06:15:42 +00:00
Robert Shih
e77b029214 Merge "libwvhidl: implement API to get plugin logs" into sc-dev 2021-02-05 05:28:00 +00:00
Edwin Wong
2cbecf1cce Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c am: 15ba854123 am: 37e0991645 am: 3ee1f400e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifd5d9a9cdd01a43e5113da1fd627c3807d308540
2021-02-04 18:29:58 +00:00
Robert Shih
c0979417fd Save recent Widevine CDM logs am: 83ef9081d1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13472557

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If8f419a01ee2c4dfa08e73f0cefaadbf81d1250a
2021-02-04 18:29:05 +00:00
Edwin Wong
3ee1f400e7 Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c am: 15ba854123 am: 37e0991645
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I71106d21ee571a1446ffe9271e8c1f5672505abf
2021-02-04 18:25:22 +00:00
Robert Shih
12995287fa libwvhidl: implement API to get plugin logs
Bug: 162255728
Test: VtsHalDrmV1_4TargetTest
Change-Id: I333cb1ee2f25ae718e7f544f4a5f7ee50668041a
2021-02-04 06:43:54 -08:00
Robert Shih
83ef9081d1 Save recent Widevine CDM logs
Bug: 162255728
Test: cdm unit tests
Change-Id: Ibc0daf374bedd8ac2a9a0515835e2775045962a7
2021-02-04 05:12:09 +00:00
Edwin Wong
734c386227 Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c am: 15ba854123 am: 0126cc541f am: cd37425acb am: 2b094e710e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0c0d0a869976743f496e060005515f86339aaedf
2021-02-03 02:56:19 +00:00
Edwin Wong
2b094e710e Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c am: 15ba854123 am: 0126cc541f am: cd37425acb
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia0171ddb362a84d8b08c9a429e40adab4baf1b8c
2021-02-03 02:19:51 +00:00
Edwin Wong
cd37425acb Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c am: 15ba854123 am: 0126cc541f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1644e541f8f21e85f58b600880537da9bd7d9301
2021-02-03 01:33:24 +00:00
Edwin Wong
37e0991645 Fix potential decrypt src pointer overflow. am: c3a24e6c86 am: 25f89c373c am: 15ba854123
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3356e46dd849cd63e90f36d33e72dec525403f7d
2021-02-03 01:13:28 +00:00