Commit Graph

2991 Commits

Author SHA1 Message Date
TreeHugger Robot
da1e3c5de2 Merge "Added mutex for reserved_license_ids_." into tm-dev 2022-04-29 19:36:30 +00:00
John Bruce
3d4df9b5d4 Merge "First-stage Provisioning 4.0 client ID encryption" into tm-dev am: 7d78ce9ac8 am: 9063559c43
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17949160

Change-Id: I044eff2022cbb905409f5f0ca1d49b4dcf549ac5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 19:12:11 +00:00
Alex Dale
654e6208f6 Merge "Specify DRM certificate duration in tests." into tm-dev am: 38b639f920 am: beddef3475
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17779678

Change-Id: I31e1ba2f4e5d9a96b457b6aa5c2d6dcc69ff7b57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:42:17 +00:00
John "Juce" Bruce
30a3da1b83 Skip key padding better
(This is a merge of http://go/wvgerrit/151112.)

The Widevine CDMs have never validated the padding on AES keys. However,
the code to ignore the padding was unusual and based on the assumption
the keys would always have either 0 or 16 bytes of padding and did not
handle other cases correctly. This patch updates the padding-ignoring
code to just do the obvious thing: Reject keys that are too small and
ignore all extra bytes regardless of count.

Bug: 114159862
Test: x86-64
Change-Id: Ic48010477e4cb5f7d2afbde25cf2f098e3470089
2022-04-29 18:20:31 +00:00
John Bruce
7d78ce9ac8 Merge "First-stage Provisioning 4.0 client ID encryption" into tm-dev 2022-04-29 17:38:39 +00:00
Alex Dale
38b639f920 Merge "Specify DRM certificate duration in tests." into tm-dev 2022-04-29 17:34:59 +00:00
Robert Shih
aeef8cc0e7 Merge "WVCdm: no destroy global log buffer on exit" into tm-dev am: 5c38b38514 am: 5c15da7afc
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17570520

Change-Id: I393967ede53cf655dfb7966be610a6dcbceca5e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 22:08:46 +00:00
Robert Shih
5c38b38514 Merge "WVCdm: no destroy global log buffer on exit" into tm-dev 2022-04-27 21:23:53 +00:00
Alex Dale
f696a48318 Logging CDM session ID on Decrypt() failures.
[ Merge of http://go/wvgerrit/149690 ]

This changes extends the CryptoSession logging to include the OEMCrypto
session ID in its decrypt failure logs, and adds a new CdmSession
decrypt failure log which includes the CDM session ID.  The CDM session
directly maps to the MediaDRM session ID, making app debugging easier.

The Decrypt() code pathway is one of the most frequently called
portions of the CDM code, and the pathway attempts to make as few
logging calls as possible in order to keep latency low and log
verbosity to a minimum.  It is anticiapted that when a call to
Decrypt() fails, there will be a burst of failures as the app may
make several calls to Decrypt() before handling the first decrypt
error.

To keep logging low, the following rules are followed:
- CryptoSession: decrypt errors are only logged when the decrypt error
  changes.
- CdmSession: decrypt errors are only logged when the last call to
  decrypt had succeeded.

Bug: 183984396
Test: MediaGTS with decrypt failures
Change-Id: Ic6124646d129efbc8a690b5bfd4dc422e04e677b
2022-04-26 21:23:12 +00:00
Robert Shih
5a1d5e8837 WVCdm: no destroy global log buffer on exit
[ Merge of go/wvgerrit/149989 ]

Bug: 227848537
Change-Id: I9407b133654c20ddcd3c15404dd19b3719064e6e
Test: Irdeto monkey test
2022-04-26 16:57:13 +00:00
John "Juce" Bruce
c823a85e7d First-stage Provisioning 4.0 client ID encryption
(This is a merge of http://go/wvgerrit/150131 to the Android repo.)

This patch changes the code path in the CDM so that the first-stage
provisioning request for Provisioning 4.0 is always encrypted with the
Widevine service certificate instead of the client-set service
certificate, reflecting that the first-stage provisioning is always
handled by Widevine.

This patch also makes several methods on the ServiceCertificate class
const. This has no impact on their behavior.

Bug: 221443151
Test: prov40 tests
Change-Id: Ide4c3927afadcd45ae7fb629b99e2f55cc29d56e
2022-04-25 17:33:53 -07:00
Alex Dale
a80a9fef26 Added mutex for reserved_license_ids_.
[ Merge of http://go/wvgerrit/150630 ]

DeviceFiles uses a static variable for tracking license IDs which
have been reserved by a CDM session before officially storing the
license on the device.  This variable was not protected by a mutex,
and a rare race condition would arise, either crashing the service
or getting it stuck in a loop.

This CL adds a mutex for protecting the set of reserved IDs.

Bug: 226555704
Test: device_files_unittest
Change-Id: Icdea88673c76c267b4b7db79697ec52ae8e2581e
2022-04-22 13:53:11 -07:00
Alex Dale
cc35c64757 Specify DRM certificate duration in tests.
[ Merge of http://go/wvgerrit/150350 ]

Certain integration tests were depending on the provisioning server
only sending short duration (~2 minute) certificates when testing
the CDM's ability to enforce expiration periods.  This behavior of
the server was not reliable, resulting in device test failures from
server behavior changes.

The DRM certificate provisioning server allows the requester to
optionally provide a desired certificate duration in the request
URL.  The tests which test the CDM's ability to enforce certificate
durations will now explicitly specify the certificate duration
required by the test.

Bug: 228547158
Test: request_license_test
Change-Id: Ib9ebfdba1451104be0e59baca0b2f23a94cd51e6
2022-04-15 20:14:51 -07:00
Edwin Wong
5f12f00956 Merge "Add unit tests for AIDL service" into tm-dev am: 47ebc28f6a am: 6ea9e7212b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17641620

Change-Id: I9acc2ec4cbc5673a0c515da1aabccb62e4f00fef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-14 18:24:47 +00:00
Edwin Wong
47ebc28f6a Merge "Add unit tests for AIDL service" into tm-dev 2022-04-14 17:26:44 +00:00
Alex Dale
5dec86a191 Added OTA Keybox stress test. am: 8cab20c0c5 am: 6989567e5e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17549231

Change-Id: I1d108e072004782a9b97338ec5530bffef470953
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-13 01:23:58 +00:00
Edwin
fbacdc687f Add unit tests for AIDL service
[ Merged from http://go/wvgerrit/150029 ]

Test: m libwvdrmengine_hal_test -j128
Test: m libwvdrmengine_hal_test WV_UNITTESTS_BUILD_TARGET=hidl -j128
Test: adb push $(OUT)/data/nativetest/libwvdrmengine_hal_test /data/nativetest/.
Test: adb shell  LD_LIBRARY_PATH=/vendor/lib64 /data/nativetest/libwvdrmengine_hal_test

Bug: 217247987
Change-Id: Ib4f22c976b8ae6c2983cb611a958ddc3a29aebdb
2022-04-11 11:38:15 -07:00
Alex Dale
8cab20c0c5 Added OTA Keybox stress test.
[ Merge of http://go/wvgerrit/149469 ]

Created a new test for stressing OEMCrypto's ability to generate
OTA Keybox provisioning requests.  This forces the TA to retrieve
keys from KM, generate certificate and sign the request.  This is
intended to find any unexpected system degradation within the
device's TA(s).

Bug: 227542259
Test: oemcrypto_test
Change-Id: Ib34f2f801a7fe74ca67aa0a16f68f9ae326de24e
2022-04-04 13:44:10 -07:00
Alex Dale
c3125d8320 Merge "Added CDM support for Watermarking reporting." into tm-dev am: b3a5117b82 am: f0de58c431
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17364417

Change-Id: Ic8673e2b3ae269b71612f6bb6beed7d0e7a67579
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-02 01:35:11 +00:00
Alex Dale
b3a5117b82 Merge "Added CDM support for Watermarking reporting." into tm-dev 2022-04-02 01:07:07 +00:00
Alex Dale
46ce5b68b7 Merge "Reset UsageTableHeader when re-init for tests." into tm-dev am: b3a5a656af am: 06cddd75a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17511529

Change-Id: Id08746db95b09f977f61bdab79a5e43214ebf118
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 21:42:02 +00:00
Alex Dale
97f3544866 Added CDM support for Watermarking reporting.
[ Merge of http://go/wvgerrit/148552 ]

Extended the CDM layer to report OEMCrypto's watermarking support.
The reporting of watermarking comes in three (3) mechanisms:
1) ClientCapabilities in license requests
2) CryptoSession metrics when queried to OEMCrypto
3) String property query by apps

If OEMCrypto implementents OEMCrypto_GetWatermarkingSupport(), then
the reported watermarking support by the CDM will match that of
OEMCrypto.

If OEMCrypto does not implement OEMCrypto_GetWatermarkingSupport()
or an error occurs, it is assumed that OEMCrypto does not support
watermarking, and the CDM will report "Not Supported".

Bug: 226443788
Test: run_x86_64_tests request_license_test and license_unittest
Change-Id: Id929a356c395e6bcf45d371ee6887eec40d35329
2022-04-01 14:24:44 -07:00
Alex Dale
b3a5a656af Merge "Reset UsageTableHeader when re-init for tests." into tm-dev 2022-04-01 21:13:32 +00:00
Alex Dale
8091ed239e Reset UsageTableHeader when re-init for tests.
[ Merge of http://go/wvgerrit/149130 ]

When re-initializing OEMCrypto for testing purposes, the
UsageTableHeader must be reset as well.  This is to inform future
sessions to load or create a new header before creating new entries.

Bug: 219075437
Test: request_license_test and MediaDrmTests GTS
Change-Id: Ie8bc72bc7ea079d21587e114223fcb67547c756a
2022-04-01 03:20:24 +00:00
TreeHugger Robot
b18b3e20d3 Merge "Rename conditional flag and remove log spam." into tm-dev am: 0a65e3ba32
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17500167

Change-Id: I8e2943b97b5f3e8d5910ef2f00d93bfde30eebd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 19:01:51 +00:00
TreeHugger Robot
0a65e3ba32 Merge "Rename conditional flag and remove log spam." into tm-dev 2022-03-30 18:41:32 +00:00
TreeHugger Robot
ad85c2c69d Merge "Replace _hidl_ with _hal_ in test names" into tm-dev am: 5e0c55d2f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17325508

Change-Id: I130cc9d48af8e4f7ad1e7b8d392a12f66c327257
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 17:20:52 +00:00
TreeHugger Robot
5e0c55d2f7 Merge "Replace _hidl_ with _hal_ in test names" into tm-dev 2022-03-30 16:57:22 +00:00
Edwin Wong
2a91e85b91 Rename conditional flag and remove log spam.
[ Merged from http://go/wvgerrit/149029 ]

Address comment in http://ag/17158449 for
b/217247987, rename BUILD_TARGET with a
unique name. Also remove $(info ...) log spam.

Test: ./build_all_unit_tests -t hidl
Test: ./build_and_run_all_unit_tests -t hidl
Test: ./build_all_unit_tests
Test: ./build_and_run_all_unit_tests
Test: ./build_and_run_all_unit_tests -t invalid (default to AIDL)
Bug: 226976702
Change-Id: I1529dfbbbd1b112668ccac22bc684817dcb9ed35
2022-03-30 16:38:01 +00:00
Frederick Mayle
a9828a7168 Merge "libwvdrmengine: Fix double ownership of WVDrmFactory" into tm-dev 2022-03-28 22:13:39 +00:00
Frederick Mayle
d9c60f75d7 Merge changes from topic "presubmit-am-6622fe4b6ed34c108ae72ef4c712fd08"
* changes:
  [automerge] libwvdrmengine: Fix double ownership of WVDrmFactory 2p: 3112fd5505 2p: e7ba29b5ae
  [automerge] libwvdrmengine: Fix double ownership of WVDrmFactory 2p: 3112fd5505
  libwvdrmengine: Fix double ownership of WVDrmFactory
2022-03-28 22:13:39 +00:00
Suren Baghdasaryan
f48bafb7b1 Replace writepid with task_profiles command for cgroup migration
writepid command usage to join a cgroup has been deprecated in favor
of a more flexible approach using task_profiles. This way cgroup path
is not hardcoded and cgroup changes can be easily made. Replace
writepid with task_profiles command to migrate between cgroups.

Bug: 191283136
Test: build and boot
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: If3e351ff118ea4eb395f71a7e2e0ace5b62b77c0
2022-03-24 17:52:31 +00:00
Rahul Frias
04e403cc64 Merge "Sync license_protocol.proto" into tm-dev am: d3c653bd11 am: 7ce3d819d9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17345666

Change-Id: I1d8471440b1e7459f5ce23b5f4020a6a29258ce9
2022-03-24 04:23:46 +00:00
TreeHugger Robot
9378f74171 Merge "Correct when OEMCrypto_GetOEMPublicCertificate is called" into tm-dev am: 27d2826d03 am: 6905de19f9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17365196

Change-Id: Ic9ef9f131d6ee1d7d6138294ed9a3c62e6ff0220
2022-03-24 04:23:40 +00:00
TreeHugger Robot
355e671d6e Merge "Update ExoPlayerDemo.apk" into tm-dev am: e1c107bd8f am: 202363e65d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17359730

Change-Id: Ia7d7af078ed2f9b0ae1bae23d38335c81cc0302b
2022-03-24 04:16:51 +00:00
Rahul Frias
d3c653bd11 Merge "Sync license_protocol.proto" into tm-dev 2022-03-24 03:58:21 +00:00
TreeHugger Robot
27d2826d03 Merge "Correct when OEMCrypto_GetOEMPublicCertificate is called" into tm-dev 2022-03-24 03:52:42 +00:00
TreeHugger Robot
e1c107bd8f Merge "Update ExoPlayerDemo.apk" into tm-dev 2022-03-24 02:27:11 +00:00
Rahul Frias
c014da7da3 Correct when OEMCrypto_GetOEMPublicCertificate is called
[ Merge of http://go/wvgerrit/148469 ]

OEMCrypto_GetOEMPublicCertificate needed to be called
before the OEM private key was loaded due to a bug in OEMCrypto.
The bug has been addressed and the call can now be removed.

OEMCrypto_GetOEMPublicCertificate is only applicable to
devices with OEM certs as their root of trust. Devices with
keyboxes (or BCC) as their RoT would return a spurious
error OEMCrypto_ERROR_NOT_IMPLEMENTED. Removing the call
addresses this as well.

Bug: 190231658
Test: WV unit/integration test
Change-Id: I8216ca5a78b8c2acb5681c7f599cdc41efdf9fc7
2022-03-23 17:18:36 -07:00
Rahul Frias
3912635502 Sync license_protocol.proto
[ Merge of http://go/wvgerrit/148470 ]

Bug: 226298543
Test: WV unit/integration tests
Change-Id: Id3300772182a089230e23a277775334f6731d45a
2022-03-23 16:59:13 -07:00
Alex Dale
5ba7ab4d25 Merge changes from topic "presubmit-am-2da434748b5f487f8fc0a047848553c9"
* changes:
  [automerge] Threading requirements of UsageTableHeader. 2p: 64047c8958 2p: 6bff1691c5
  [automerge] Threading requirements of UsageTableHeader. 2p: 64047c8958
  Threading requirements of UsageTableHeader.
2022-03-23 23:56:53 +00:00
Alex Dale
cbea9a11ef Merge "Threading requirements of UsageTableHeader." into tm-dev 2022-03-23 23:56:53 +00:00
TreeHugger Robot
7cab9e5031 Merge "Copied OEMCrypto utils to Android." into tm-dev am: 26ee600923
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17312281

Change-Id: I5aca4c1df46e7fd61d2c22d1b46dd25684d40d57
2022-03-23 23:32:51 +00:00
TreeHugger Robot
26ee600923 Merge "Copied OEMCrypto utils to Android." into tm-dev 2022-03-23 23:16:15 +00:00
Kyle Alexander
b705d68631 Update ExoPlayerDemo.apk
Test: Playback of content in ExoPlayerDemo.apk

Bug: 203837661
Change-Id: Ic62b483b92215d2369b05bc2adc33d754ef5de5e
2022-03-23 15:29:57 -07:00
Presubmit Automerger Backend
691a355fbe [automerge] Threading requirements of UsageTableHeader. 2p: 64047c8958 2p: 6bff1691c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17352456

Bug: 189366337
Change-Id: I7d3867d8b1cbfcd6d65cb113b9f7d513fdcb9498
2022-03-23 18:54:33 +00:00
Alex Dale
64047c8958 Threading requirements of UsageTableHeader.
[ Merge of http://go/wvgerrit/148450 ]

This CL adds threading requirements to the method doc-comments of
UsageTableHeader.

Bug: 189366337
Test: usage_table_header_unittest
Change-Id: I671f702d3e8ec219cc8daaa220133cb8cec183c8
2022-03-23 11:54:12 -07:00
Frederick Mayle
a415b078ea [automerge] libwvdrmengine: Fix double ownership of WVDrmFactory 2p: 3112fd5505 2p: e7ba29b5ae
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17353612

Bug: 226379467
Change-Id: Ib09f225b85dfeea9d3aed5af754a2b5840856843
2022-03-23 18:00:14 +00:00
Frederick Mayle
3112fd5505 libwvdrmengine: Fix double ownership of WVDrmFactory
Using std::make_shared with ndk::SharedRefBase objects causes memory
errors.

Bug: 226379467
Test: TH
Change-Id: I3649ace96067e68cfc0ac998c836d9a8bd48bd11
2022-03-23 18:00:00 +00:00
Edwin Wong
0f3c297250 Replace _hidl_ with _hal_ in test names
[ Merged from http://go/wvgerrit/148451 ]

This step is a prelude in adding Widevine unit tests that
use AIDL interface.

Test: ./build_and_run_all_unit_tests.sh
Bug: 217247987
Change-Id: I449050819e6c9b0261066997dd45a6103b3a9a7a
2022-03-23 07:16:27 -07:00