Commit Graph

3009 Commits

Author SHA1 Message Date
Kyle Zhang
a95cd36de5 Merge "Add liboemcrypto.so as required by WV APEX" 2023-01-11 05:37:46 +00:00
TreeHugger Robot
d933e34824 Merge "Renaming of Usage Table related variables and types." 2023-01-10 02:43:26 +00:00
Kyle Zhang
a5c7a48f8a Add liboemcrypto.so as required by WV APEX
[ Merge of go/wvgerrit/164757 ]

Modify Widevine apex configuration to add add liboemcrypto.so as
required by WV APEX.

Bug: 243699259
Test: atp v2/widevine-eng/drm_compliance
Change-Id: I136dde5d77aed4fb14737e4692153c8f3b2c701b
2023-01-09 06:32:39 +00:00
Rahul Frias
609349c314 Merge changes Ib18af309,Iebd58823,Ic3a503ef
* changes:
  Support renew on load
  Move functionality to policy_timer.
  Remove references to policy_timers_v15
2022-12-22 08:11:29 +00:00
Rahul Frias
1208c78e94 Merge changes Iec2a8b7f,I01530934
* changes:
  Support ATSC license installation
  Add error codes to support ATSC license installation
2022-12-22 07:07:14 +00:00
Rahul Frias
ab91cf934e Support renew on load
[ Merge of http://go/wvgerrit/164477 ]

Renew on load is supported when OEMCrypto is >= v18.
A new class, policy_timer_v18 has been added to support this
functionality. In addtition,offsets of renewal from first decrypt
and license start are also included.

Bug: 256038127
Test: GtsMediaTestCases
Change-Id: Ib18af3096d1d8807af6a03fd2f84783123ab6b6d
2022-12-21 17:33:02 -08:00
Rahul Frias
78a4902214 Move functionality to policy_timer.
[ Merge of http://go/wvgerrit/164277 ]

No functional changes are made in this CL. policy_timer_v16 and
policy_timer_v15 derive from policy_timer. We have removed
support for OEMCrypto v15. policy_timer_v15 has also been removed.

This allows us to move functionality from policy_timer_v16
to policy_timer class. This will ease subsequent renew on
license load functionality.

Bug: 256038127
Test: Luci tests
Change-Id: Iebd588237edd02b30a820c4d9d57ce041c26964e
2022-12-21 16:10:01 -08:00
Alex Dale
1603ba127f Renaming of Usage Table related variables and types.
[ Merge of http://go/wvgerrit/164077 ]

This CL makes major changes to the names of variables and types that
are related to the usage table, header, entries, entry indexes, and
other related data.

The renaming followed these rules:
1)  "Usage table header" will exclusively refer to the header blob
    that is OEMCrypto specific.  The CDM class "UsageTableHeader"
    is the CDM-layer's abstraction around the "usage table" concept.
    The name has been updated to reflect that.
2)  The "Cdm" prefix is only used for the CDM-specific data types for
    the usage table and entry info.  It has been removed from
    OEMCrypto-specific types.
    - UsageTableHeader -> CdmUsageTable
    - CdmUsageTableHeader -> UsageTableHeader
    - CdmUsageEntry -> UsageEntry
3)  The "usage_" prefix has been removed from variables when the usage
    table or usage entries are the subject of the function or class.
4)  UsageEntryIndex is the type for entry indexes, instead of directly
    using uint32_t.  This matches how we wrap other types in
    "wv_cdm_types.h"
5)  Changed entry "number" to entry "index".
6)  Vectors of elements have been renamed to be either pluralized or
    have a suffix "_list".
7)  "Usage info" was occasionally being used to refer to the usage
    table or entries generally, rather than specifically secure-stop.
    - CryptoSession::HasUsageInfoSupport() -> HasUsageTableSupport()

The most major change is that the files "usage_table_header*" have
been renamed to be "cdm_usage_table*".

Bug: 242914226
Test: run_x86_64_tests and request_license_test
Change-Id: Iee98446b71f4f2934d3c9e0fb949eb05b84d1f8c
2022-12-21 15:50:49 -08:00
Cong Lin
7474b41fd0 Temporarily remove json dependency in oemcrypto v18 unit test
Disable one oemcrypto v18 unit test which takes nlohmann-json dependency
for now, until the json dependency is fixed.

Test: build widevine and oemcrypto unit tests
Bug: 263397641
Change-Id: I065b28a81cc481b2b64bda27733640e0fdea0c2c
2022-12-21 13:23:21 -08:00
Rahul Frias
1e15b36b1a Support ATSC license installation
[ Merge of http://go/wvgerrit/163900/ ]

ATSC licenses can be saved by calling
MediaDrm#setPropertyString("storeAtscLicense",<value>)
where <value> is
"<atsc-key-set-ID>:<license-file-data in Base64 format>"

Before storing an ATSC license a session must be opened and the
ATSC mode must be enabled.

Use MediaDrm#setPropertyString("atscMode","enable");

Bug: 176871821
Test: WV Unit/integration/Luci tests
Test: libwvdrmdrmplugin_hal_test
Test: GtsMediaTestCases
Change-Id: Iec2a8b7f87b1122395d06856202278b92316fdfe
2022-12-21 11:56:18 -08:00
Rahul Frias
233bac3a6f Add error codes to support ATSC license installation
[ Merge of http://go/wvgerrit/163899 ]

Bug: 176871821
Test: WV Unit/integration/Luci tests
Test: libwvdrmdrmplugin_hal_test
Change-Id: I0153093433715b1357d3854043cc6362f9261c57
2022-12-21 11:55:08 -08:00
Kyle Zhang
0080d04579 Merge "Pick widevine oemcrypto-v18 change" 2022-12-21 19:44:33 +00:00
Cong Lin
a39f926419 Merge "Internal BCC extraction tool to consume verified device info" 2022-12-21 18:22:18 +00:00
Rahul Frias
539843da00 Remove references to policy_timers_v15
[ Merge of http://go/wvgerrit/164257 ]

Support for OEMCrypto v15 is being removed from the CDM. The
policy_timers_v15 will no longer be invoked and can be removed.

Bug: 256038127
Test: WV unit/integration tests
Change-Id: Ic3a503ef2a17223dd0bc13696960dcd6822cc343
2022-12-21 05:42:14 -08:00
Cong Lin
691f43cbef Factory 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 is mostly identical to ag/20799640, which has the same change
for our internal extraction tool. For historical reason, we keep two
copies of the extraction tool which are slightly different from each
other, one for factory use, one for debug use. Long term they will be
merged.

Test: Ran the tool on Pixel 7 w/wo verified device info being present
Bug: 263312447
Change-Id: Ib9c77dee45e9ff996fc2dc2da14f16f60eaff77c
2022-12-20 20:07:10 -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
Kyle Zhang
11255b7426 Pick widevine oemcrypto-v18 change
No-Typo-Check: From a third party header file
Bug: 260918793
Test: unit tests
Test: atp v2/widevine-eng/drm_compliance
Change-Id: I36effd6a10a99bdb2399ab1f4a0fad026d607c70
2022-12-21 00:03:50 +00:00
Rahul Frias
ead412cc55 Merge "Sync license_protocol.proto" 2022-12-20 22:06:14 +00:00
Edwin Wong
4586522c07 Remove comment.
Merged from http://go/wvgerrit/163817

Based on review comment in PS10 of http://go/ag/ag/20608670

Test: Google TV
Test: atest MediaDrmParameterizedTests
Test: atest DrmSessionManagerTest

Bug: 262797186
Change-Id: I28ed90255df1a16fb252000f8a8a0f89246563c3
2022-12-16 19:16:33 +00:00
Robert Shih
1fdbd3cd2c aidl plugin: add error details to return status
Merged from http://go/wvgerrit/163639

Bug: 253271674
Test: Google TV
Test: atest MediaDrmParameterizedTests
Test: atest DrmSessionManagerTest
Change-Id: I9f0e83774d405466a389d2fd90d693830682dde4
2022-12-15 14:50:56 +00:00
Rahul Frias
915efa9894 Sync license_protocol.proto
[ Merge of http://go/wvgerrit/159982 ]

Add in TimerDelayBase, initial_renewal_delay_base, client version
and DTCPUsageRules.

Bug: 256038127
Test: WV unit/integration tests
Change-Id: I0ea7490ff2663a3df15d150836b06277f14eaa0f
2022-12-13 23:53:14 -08:00
Robert Shih
2384efde1e New CdmResponseType fields: oec_result & crypto_session_method
[ Merge of go/wvgerrit/163437 ]

Bug: 253271674
Test: cdm unit tests
Change-Id: I064e28af593e4a55c13d03115bb5181a879a1ed4
2022-12-12 19:06:59 -08:00
TreeHugger Robot
adf20ed758 Merge "Dump error_detail in dumpsys" 2022-12-13 01:32:30 +00:00
Edwin Wong
b1fd332cc5 Fix mapCdmResponseType template.
Merged from http://go/wvgerrit/163457

mapCdmResponseType is called either with an enum or
a CdmResponseType struct.

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

Bug: 253271674
Bug: 262210157
Change-Id: Ieb9fccf33f54a98c67ddf7655d2a5ada7a946114
2022-12-12 20:48:46 +00: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
Alex Dale
ac9641ae13 Merge "Revert "Core CDM: Removed secure stop support."" 2022-12-05 22:05:07 +00:00
Alex Dale
16a4c2690a Revert "Core CDM: Removed secure stop support."
This reverts commit b039f31b27.

Reason for revert: Feature rejected by Android

Bug: 242289743
Change-Id: I8cd6014b4e2de93b3c574d407d6c8885863fed4f
2022-12-03 00:46:22 +00:00
Alex Dale
cd51e53a98 Merge "Revert "Core CDM: Retrieving USAGE_INFO triggers clean-up."" 2022-12-03 00:32:27 +00:00
Alex Dale
d62d71189e Revert "Core CDM: Retrieving USAGE_INFO triggers clean-up."
This reverts commit da9ba6c3ba.

Reason for revert: Feature rejected by Android

Bug: 242289743
Change-Id: Ia9ee53b4a897b4b52551c665e8551233abee6b6b
2022-12-02 22:48:05 +00:00
Alex Dale
f4ca978229 Merge "Revert "Core CDM: Remove secure stop from LRU algorithm."" 2022-12-02 22:41:06 +00:00
Alex Dale
0c353d6851 Revert "Core CDM: Remove secure stop from LRU algorithm."
This reverts commit 7a34c1748c.

Reason for revert: Feature rejected by Android

Bug: 242289743
Change-Id: I63a730a6e5fa16d0d2425d216fd7f0fff8c09a4c
2022-12-01 23:50:05 +00:00
Alex Dale
8bfd31402b Merge "Revert "Core CDM: Removed ability to add secure stop entry."" 2022-12-01 23:47:43 +00:00
Alex Dale
40181d5ea7 Revert "Core CDM: Removed ability to add secure stop entry."
This reverts commit afcadcc793.

Reason for revert: Feature rejected by Android

Bug: 242289743
Change-Id: Ibf018322d65af9a2a7808b81823907f3226f1950
2022-12-01 03:36:42 +00:00
Alex Dale
672f7aee80 Merge "Revert "Core CDM: Remove usage info API from DeviceFiles."" 2022-12-01 03:34:24 +00:00
Alex Dale
3012cd1ee6 Revert "Core CDM: Remove usage info API from DeviceFiles."
This reverts commit 244e6301bd.

Reason for revert: Feature rejected by Android

Bug: 242289743
Change-Id: I00a6e223dfabd85a5f12a224dfea6456a24a1770
2022-11-30 23:58:52 +00:00
Alex Dale
5ffa2885c9 Merge "Revert "Core CDM: Do not store/retrieve USAGE_INFO entries."" 2022-11-30 23:51:37 +00:00
Alex Dale
5ebe8eddeb Revert "Core CDM: Do not store/retrieve USAGE_INFO entries."
This reverts commit 982ddb042d.

Reason for revert: Feature rejected by Android

Bug: 242289743
Change-Id: I06fd9a79c2013a7dc523ffd06180c3ff36ab7d34
2022-11-30 01:47:13 +00:00
Alex Dale
ba42d5edf5 Merge "Revert "Core CDM: Remove usage info as a run-time type."" 2022-11-30 01:46:17 +00:00
Alex Dale
1ea92c34c8 Revert "Core CDM: Remove usage info as a run-time type."
This reverts commit 5dd2b07286.

Reason for revert: Feature rejected by Android

Bug: 242289743
Change-Id: I8dc95139d113ad1d44acd2e8dd6cbda604b6c073
2022-11-30 00:29:14 +00:00
Edwin Wong
927053d6e8 Dump error_detail in dumpsys
Merged from http://go/wvgerrit/162420

Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine

Bug: 260241061
Change-Id: I28b06b201c3408d85f6ca944534ad9602bc60a85
2022-11-27 18:17:50 +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
Edwin Wong
c13a1981c4 Fix FormatAttributes
Merged from http://go/wvgerrit/161639

This CL addresses the review comment in http://go/ag/20205433
so that attributes.error_code should be using
CdmResponseTypeToString().

Test: Netflix, Play TV and Movies, Youtube
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine
Test: ./build_and_run_all_unit_tests.sh

Bug: 239462891
Change-Id: Iaa96423044d53a83406807b3db90e394fdda2803
2022-11-17 17:51:27 +00:00
John "Juce" Bruce
ff73463d0b Add String Formatting Util
(Merged from http://go/wvgerrit/160042.)

Since we don't have access to std::format yet, this patch adds a
function to wvutil to format text into a std::string.

Bug: 255466913
Test: x86-64
Test: raven
Change-Id: I28043da76af5b4772a29fa7e7241343caf9b54a1
2022-11-15 05:24:19 +00:00
Edwin Wong
a3e67a9104 Merge "Update CdmResponseTypeToString" 2022-11-13 01:21:12 +00:00
Edwin Wong
959c16a0fe Update CdmResponseTypeToString
Merged from http://go/wvgerrit/160797

Changed CdmResponseTypeToString param from int to CdmResponseType as per sigquit@ review comment in http://go/wvgerrit/160638.

Reorder the switch statements in CdmResponseTypeToString to follow the order in the enum declarations instead of sorting alphabetically. This should make future changes to the enum fields easier.

Test: Netflix, Play TV and Movies, Youtube
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine
Test: ./build_and_run_all_unit_tests.sh

Bug: 258438956
Change-Id: I3f316cff5448e8e8078da7868e3c083e6766bfa1
2022-11-10 23:29:57 +00:00
Alex Dale
86aea4f49f Merge "Remove usage info clean up test tear down." 2022-11-10 19:25:44 +00:00
Alex Dale
789b9b675c Merge changes I939e4797,Iefbfe2dd,I002202b4,I09262da0
* changes:
  Core CDM: Remove usage info as a run-time type.
  Core CDM: Do not store/retrieve USAGE_INFO entries.
  Core CDM: Remove usage info API from DeviceFiles.
  Core CDM: Removed ability to add secure stop entry.
2022-11-10 03:03:27 +00:00
Alex Dale
b0bb45876d Remove usage info clean up test tear down.
[ Merge of http://go/wvgerrit/160857 ]

Reboot tests were attempting to clean up usage info records when the
tests were done.  However, usage info are no longer supported.
Unfortunately, the clean up code would trigger a test failure if the
usage info records could not be deleted.

Bug: 258469123
Test: OfflineLicenseTest.VariousTests
Change-Id: I17cebd82da1e45ef53853d35dbe314365a1909be
2022-11-09 14:42:31 -08:00
TreeHugger Robot
a84c7b8ac4 Merge "Address review comment in go/wvgerrit/160480" 2022-11-08 23:58:23 +00:00
Alex Dale
724576eaf4 Merge changes Ib3f71f19,I2d1fc0d6
* changes:
  Core CDM: Remove secure stop from LRU algorithm.
  Core CDM: Retrieving USAGE_INFO triggers clean-up.
2022-11-08 22:19:38 +00:00