Commit Graph

27 Commits

Author SHA1 Message Date
Shawn Willden
688a572357 Remove unnecessary "_external" suffix from libcppbor
Test: Build
Change-Id: I8e4d65bafe9d4b4bbc576c8c9c995bddf0a957a2
2024-04-01 10:24:45 -06:00
Ronish Kalia
d0f454d91c [DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I204c137da43a021bcebe316759d1aadaec99fe2a
2024-02-14 14:19:08 +00:00
Cong Lin
5ce29c42da Add BccParser to internal factory upload tool
Add a Bcc parser which prints the public keys in dice chain and a few
other key properties.

Borrowed code from
https://source.corp.google.com/piper///depot/google3/video/widevine/keysmith/provisioning/provisioning40/boot_certificate_chain_parser.cc
and modified locally to build an executable tool.

Sample output from new pixel device:

ROOT DEVICE PUBLIC KEY:
key encoding format: DEVICE_KEY_OCTET_PAIR
key algorithm type: ECDSA_SHA384
curve: P384
public key bytes: 04de874f6067bde6604b2d7a5d51ad28e6335d4524de4314ba6e594e6c95ccefeb17066a0b2f86b16591815c184694d7c54f02549e390e98e9e244e9cd73e616ffd9160371936b7c57e42617a3b497265bc84a0870fae4542e9f35b350383f4ebf

CDI PUBLIC KEY 1:
Issuer: 6a680468c33e5a9a95730632070f76e016f971a9
Subject: 5fbc8ab87c4a23ae660ea38461fea5bbc375a08c
key encoding format: DEVICE_KEY_OCTET_PAIR
key algorithm type: ECDSA_SHA384
curve: P384
public key bytes: 04dfa00e8f96d25400a7824c44a27ba141520629820a7348d48b6fa9b616e6f6793df08288c81985864b07b08fbce4beca3f0297b4b1965be3c26aa493d98ef20f18b2cf2c751ed77b170e04a2a7712f7509b22ac9b504965bd0a963c5947ccc2e

CDI PUBLIC KEY 2:
Issuer: 5fbc8ab87c4a23ae660ea38461fea5bbc375a08c
Subject: 34a2c88d0edfd43663d47357e64280f26ebe5baa
key encoding format: DEVICE_KEY_OCTET_PAIR
key algorithm type: ECDSA_SHA384
curve: P384
public key bytes: 047717658a703114cd4d287162b3d75ff366b0d7dcd330bdab7fe61bcb1d50b2dd897a2ae6e878100839a3a47b966339bbb1220e76af68832035954ba39266563357fae446b734aefdf8b1295db59ac1ee9692841fee0b62b6d32651c817b34116

CDI PUBLIC KEY 3:
Issuer: 34a2c88d0edfd43663d47357e64280f26ebe5baa
Subject: 0b657b3c2448a5e0669953f9d5bdd90b431bbff2
key encoding format: DEVICE_KEY_OCTET_PAIR
key algorithm type: ECDSA_SHA384
curve: P384
public key bytes: 041a11632576b82a1ead43a6744c6601c869dc8cbc519332f588ad79d01754964b595c4f83a7168c0f494715bedefa87cb699df4d41849fe140ab95252e55808908cc02708bc86b4d3a6a0f4dc6c49d138d67a5d3406ae25773ae182972656599c

Test: parse BCC and Dice chain on pixel existing/new devices
Bug: 279688624
Change-Id: Ia77a1d9f8f467992b998549572270da2c56b38b8
2023-04-26 10:20:16 -07:00
Cong Lin
65f50d4662 Use device info from OS property when TEE returns empty
Some mandatory device info fields like manufacturer can be empty string
when returned from TEE on devices which have not been provisioned with
attestation IDs.

The extraction tool also needs to check for empty string in the
response, and if so, populates the field with Android property values.

Test: extracting device info from new Pixel EVT 1.1 and uploading
Bug: 276958001
Change-Id: I6e1b3dee8ffcd991335bc50b59a0c80f030cdc79
2023-04-24 14:14:42 -07:00
Cong Lin
6db1ae5167 Fix CSR in wv factory upload tool
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/169024

The CSR extracted by WV internal BCC extraction tool is missing a
field "unverifiedDeviceInfo". This is required by the RKP's device
uploading tool for the CSR to be accepted.

Also updated the size of the randomly generated challenge from 32 bytes
to 64 bytes, same as what is used by rpk_factory_extraction_tool.

Test: extracted CSR v2 and v3 and dry run uploading
Bug: 275075496
Change-Id: Icc776f810c81ac6589d82935950167925f95f906
2023-03-27 21:10:03 +00:00
Cong Lin
5e24549b1a Internal factory tool implements CSR v3
Widevine internal BCC extraction tool to extract CSR v3 for testing
purpose. The difference it has from the factory tool is it doesn't rely
on Widevine IRPC HAL.

It just extracts BCC/CSR in the specified format from cli.

Test: Extract CSR v3 on Pixel 7 and upload
Bug: 268246995
Change-Id: I52abe09f991c89c6e7601bcef4d980f24c020c9f
2023-03-02 12:19:43 -08:00
Bob Badour
080bfc7414 Merge "Cleanup vendor projects are proprietary." into tm-qpr-dev-plus-aosp am: cbb6177df2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/21276850

Change-Id: I7ba871f7714ba4eb5dcb5b0571b6024533a25217
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-05 03:54:39 +00:00
Bob Badour
cbb6177df2 Merge "Cleanup vendor projects are proprietary." into tm-qpr-dev-plus-aosp 2023-02-05 03:06:24 +00:00
Bob Badour
6f047790e0 Cleanup vendor projects are proprietary.
Test: m droid dist
Change-Id: I0bdec38c4d12710fa97b91665d211ba6c0d4b24d
2023-02-03 14:37:11 -08:00
Robert Shih
6dada11e7f Surface wv_factory_extraction_tool on ab am: fdb47a37da am: 34cc01c8a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/19392134

Change-Id: Ie7946efc33f4de61b2f96497152186c407fa6acd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-01 22:43:49 +00:00
Robert Shih
5f3f0cf2af Merge "Add "version" to device info in prov4 upload tool" into tm-qpr-dev 2023-02-01 22:09:02 +00:00
Robert Shih
fdb47a37da Surface wv_factory_extraction_tool on ab
[ Merge of go/wvgerrit/165108 ]

Bug: 234078142
Bug: 238831085
Test: adb shell wv_factory_extraction_tool csr
Change-Id: I3c689b5719a0a72410d6d8cb95c7c416e67931e5
2023-01-25 15:58:04 +00:00
Rahul Frias
263d675e0e Add "version" to device info in prov4 upload tool
[ Merge of http://go/wvgerrit/160457 ]

Bug: 255921326
Bug: 262198471
Test: WV android unit tests
Merged from https://widevine-internal-review.googlesource.com/160427

Change-Id: I3e2b7158c72fb4321b67053995f62483da934a18
Merged-In: I3e2b7158c72fb4321b67053995f62483da934a18
2023-01-25 07:51:44 -08:00
Cong Lin
a880498f36 Internal BCC extraction tool to consume verified device info
BCC extraction tool calls OEMCrypto_GetDeviceInformation() to read
verified device info from TEE. If the verified device info is not
available, (e.g. not implemented), it falls back to using OS properties.

This CL changes the tool used by widevine internally. Another CL will
update the tool for factory use.

Test: Ran the tool on Pixel 7 w/wo verified device info being present
Bug: 263312447

Change-Id: I71a48cc210f6a6f26f339f512a1851237ba94172
2022-12-20 17:45:14 -08:00
Robert Shih
096b0eda5a Squashed merge 3 CLs.
1. "Change CdmResponseType from enum into a struct"
Merged from http://go/wvgerrit/163199
Bug: 253271674

2. "Log request information when server returns 401"
Bug: 260760387
Bug: 186031735
Merged from http://go/wvgerrit/162798

3. "Specify server version on the command line"
Bug: 251599048
Merged from http://go/wvgerrit/158897

Test: build android.hardware.drm-service.widevine
Test: Netflix and Play Movies & TV
Test: build_and_run_all_unit_tests.sh

Bug: 253271674
Change-Id: I70c950acce070609ee0343920ec68e66b058bc23
2022-12-08 21:08:14 +00:00
Edwin Wong
6d3457b9d9 Remove hidl support.
Merged from http://go/wvgerrit/161857

Test: streaming(Netflix, Play Movies & TV)
Test: ./build_and_run_all_unit_tests.sh
Test: adb shell ps | grep drm
Test: metrics_dump
Test: hardware/interfaces/drm/aidl/vts$ atest VtsAidlHalDrmTargetTest

Bug: 259299992
Change-Id: I76bcc82bbfb3fc60987b66265a580946a16c341d
2022-11-22 19:03:30 +00:00
Rahul Frias
8764c60fd4 Add "version" to device info in prov4 upload tool
[ Merge of http://go/wvgerrit/160457 ]

Bug: 255921326
Test: WV android unit tests
Merged from https://widevine-internal-review.googlesource.com/160427

Change-Id: I3e2b7158c72fb4321b67053995f62483da934a18
2022-11-04 11:34:02 -07:00
Cong Lin
1f4385424e Fix the length of the extracted BCC
After a successful extraction, the vector of BCC should be resized to
the correct value.

Test: build and run extraction tool
Bug: 237029566
Change-Id: I41f39cb72bb1dc27d6d40f3c5ace5265271aab0e
2022-07-06 09:50:04 -07:00
Robert Shih
05878ffbe1 wv_factory_extraction_tool: extract provision 4.0 csr
Bug: 231677822
Test: adb shell wv_factory_extraction_tool csr
Change-Id: I9f21514b027261f1d69c24a4d2f54051ccaac9a5
2022-05-06 01:40:11 -07: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
e52086c283 Include DRM key type to SessionMetrics.
[ Merge of http://go/wvgerrit/111903 ]

CDM metrics has been updated to include the DRM key type.  The CDM
session records the key type when the wrapped DRM key is successfully
loaded into an OEMCrypto session.

Now that the API refers to a general DRM key rather than an RSA key,
the timer metric for loading the DRM key has been renamed on the client
to reflect this.

Test: Metric unit tests
Bug: 140813486
Change-Id: I9069f13ac7c979cc8556e08591e1cf8f623d0a84
(cherry picked from commit 47fc031576)
Merged-In: I9069f13ac7c979cc8556e08591e1cf8f623d0a84
2021-03-06 23:47:30 -08: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
Edwin Wong
d5d0652d4f Build metrics_dump tool in Android.
Replace Makefile with Android.bp.
Remove duplication of protos in proto directory.

Since we are now building the metrics_dump tool
under Android, use frameworks metrics.proto
directly. Also, reference cdm's wv_metrics.proto
from the cdm directory instead of creating a
subset in proto directory.

bug: 161783052
bug: 170607430

Test: build
  m -j128 metrics_dump
Test: metrics_dump [bugreport from adt-3-r.zip]
Test: metrics_dump [bugreport from sabrina-q.gz]
Test: metrics_dump --widevine [adb shell dumpsys media.metrics output]
Change-Id: I82c7e723453ac2a6335cb2bb732a376d535b9ea3
2020-11-03 10:19:32 -08:00
Rahul Frias
ec8bed38f4 Update Widevine Copyright header for android
[ Merge of http://go/wvgerrit/108084 ]

The Widevine License Agreement has been renamed to use inclusive
language. This covers files in the android directory.

Bug: 168562298
Test: verified compilation (comment only change)
Change-Id: I0f9e6445e0168ebe85425baeb81371e182e5a39c
2020-10-21 02:49:05 -07:00
Edwin Wong
051e879438 Rename metrics.proto to wv_metrics.proto.
Merge from http://go/wvgerrit/105767

To avoid conflict with metrics.proto in
frameworks/av/drm/libmediadrm/proto.
This is in preparation of moving metrics_dump tool
to build under Android.

bug: 161783052
Test: unit test
Test: Play Movies & Tv and Netflix streaming
Change-Id: I2406b66db4d61cca7c6260ea8847a555d96c8d42
2020-09-10 12:26:28 -07:00
Fred Gylys-Colwell
7665614b2e OEMCrypto v16.1
Merge of http://go/wvgerrit/93404

This CL updates the Widevine CDM to support OEMCrypto v16.1

Test: Tested in 16.2 CL
Bug: 141247171
Change-Id: I69bd993500f6fb63bf6010c8b0250dc7acc3d71b
2020-02-03 14:45:32 -08:00
Rahul Frias
8723859570 Add metrics_dump, a tool to format drm metrics
[ Merge of http://go/wvgerrit/59022 ]

Android metrics are output by the adb shell command
|dumpsys media.metrics|. They appear in bugreports
and can also be requested interactively. Both the
widevine and framework mediadrm metrics are base64
encoded protobufs detailing each of the metrics
items. This tool prints them in a readable format.

Test: wv android unit/integration tests
Change-Id: Id1bc05b34693a3ca44dd3872a28a2337b3ce4d79
2019-11-21 15:39:30 -08:00