[ Merge of http://go/wvgerrit/170073 ]
Removed the file "error_string_util.cpp" and its header, moving the
OEMCryptoResult to string converter to "wv_cdm_types.cpp". This extra
file served little purpose, and created a dependency on the CDM utils
to the CDM itself.
This is part of the effort to fix the formatting of WV metrics; making
enum-to-string conversion uniform throughout the CDM.
Bug: 239462891
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Test: Manual testing with Google TV
Change-Id: I4bf95d26b623f5b8fa86bdb2578cbc4ee65125cb
[ Merge of http://go/wvgerrit/169374 ]
Device renewals used to require that OEMs remove provisioning
certificates as part of the OTA update process. Instead, a change
in system ID is relied upon to indicate a change in root of trust.
If a change in System ID is detected, reprovisioning will be forced.
This is not enabled for ATSC devices or L3 devices. For the latter a
change in system ID may occurs without a change in RoT.
Bug: 258361396
Test: GtsMediaTestCases
Change-Id: I6e8b0b2149fc2ed5362a32bb6e869826f5fa8ef7
Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/169871
The default invalid entitled key session id was 0, which in fact could
be a valid value depending on how the key session id is allocated by the
implementation. This can be a possible cause of L3 entitled key session
failure since L3 can recycle a regular oemcrypto session id 0 and
re-assign it to an entitled key session later.
Bug: 264688931
Test: Run GTS media tests
Change-Id: Iae79d08378d61be8a3402f606992765f24298508
[ Merge of http://go/wvgerrit/169450 ]
OEMCrypto v17 introduced several new HDCP levels that OEMCrypto may
report; however, the CDM never updated to support them. The enum
values of the additional levels are no longer sequential with their
level of support (v1.1 is 7, and v2.1 is 3), this requires more
considerations when comparing the required HDCP levels (as specified
by the license) and current HDCP level supported by OEMCrypto.
The following rules were used:
1) HDCP_NONE is the absolute lowest level
2) HDCP_NO_DIGITAL_OUTPUT is the absolute highest level
3) HDCP_V1 is treated as equal to all V1.x levels
4) All other versions are based on their major-minor pairs
Bug: 269671291
Test: license_unittest
Test: policy_engine_constraints_unittest
Test: policy_engine_unittest
Test: GtsMediaTestCases
Change-Id: Ibecfcb981d7e019c68cb8e0c7286222253d18369
* changes:
Filter RSA 3072 tests
Add MemorySanitizer support for opk_ta tests
Filter CAS tests
Refactor missed provisioning and renewal tests
Use GTEST_SKIP to skip prov40 tests
Update test updates and known issues to ChangeLog
Update oemcrypto unit tests version number
Update CHANGELOG for late-breaking OPK v17.1.1 changes
Filter Cast Reciver tests
Document RSA keypair issue on OP-TEE 64-bit
Use GTEST_SKIP to skip prov 3.0 tests
Remove V17 backwards-compatibility decrypt functions
Small changes to refactored unit tests
Add CHANGELOG entry for OPK v17.1.1
Refactor usage table tests
Refactor decrypt unit tests
Update OPK v18 documentation
Fix null passed to memcpy in generic verify fuzz
Update documentation for Cast
Document lacking signature of Prov 3.0 message
[ Semi-revert of http://ag/20183443 ]
[ Merge of http://go/wvgerrit/168898 ]
These tests were removed from Android last quarter; however, they
now need to be restored. These tests will be removed in Android V.
To help with ambiguity around where the CDM is operating on a single
or set of usage info messages, the variables have been renamed to
propery indicate plurality.
Bug: 263319220
Test: cdm_extended_duration_test
Test: request_license_test
Test: libwvdrmdrmplugin_hal_test
Change-Id: I38b16dd5811069fafaeab5ffc19d0f8a8095f0cf
Merge from Widevine repo of http://go/wvgerrit/169070
This turns on the cast receiver tests for any device that
claims to support this feature. Previously, we had to
explicitly request these tests on the command line.
But since they do not pass for Prov 4.0, we fitler them out
in this case and reference a bug tracking that work.
We also switch to using GTEST_SKIP to skip the tests instead
of modifying the GTEST_FILTER.
Bug: 251240681
Bug: 269310676
Bug: 259455058
Bug: 259454969
Merged from https://widevine-internal-review.googlesource.com/166497
Change-Id: I1bcd749243a474b3f638547aa43c2805e86731af
[ Merge of http://go/wvgerrit/168357 and http://go/wvgerrit/168177 ]
When we get an error from the provisioning server while
running a test, we should log extra provisioning
information.
Bug: 273990016
Test: GtsMediaTestCases
Change-Id: I44095261e07ae079c632873f254d8e6879bab8c3
also remove `use_vndk_as_stable: true` to remove dependency to VNDK
libs.
Bug: 251299786
Test: build WV APEX with V and install it on U device
Change-Id: Ie7f7f9b699119478d4b33f95ab9e6ba7f459346c
[ Merge of http://go/wvgerrit/168397 ]
When CdmResponseType (enum) was transformed to CdmResponseType
(struct), the test printers where not updated to print the result
of failed comparisons. In addition, several logs statements were
updated haphazardly, leaving inconsistencies and potential
compiler-specific behavior.
This CL replaces CdmResponseType std::string operator with a ToString()
method. This is to make it consistent with Google's C++ style guide
on conversion operators vs methods. The string conversion function is
now defined in wv_cdm_types.cpp instead of inline in the header file.
The PrintTo function has been implemented along with the other CDM
test printers in test_printers.cpp.
Bug: 273989359
Test: run_x86_64_tests
Test: MediaDrmParameterizedTests on redfin
Test: Forrest drm_compliance
Change-Id: Ibfaa17029046b75b1c8c278f7bd7e04a24379848
Merge from Widevine repo of http://go/wvgerrit/168657
Some people who have left were still in OWNERS files and TODOs.
Bug: 274772704
Test: comments only
Change-Id: I583da815586e5ca52316b2e238d1c1bb3a5e919a
[ Merge of http://go/wvgerrit/168482 ]
The function OEMCrypto_GetBootCertificateChain() does not always
provide an additional signature depending on the device. However, the
CDM would still attempt to dereference the first character in the
additional signature buffer when empty. This CL changes how the data
pointer to an output string is acquired. Empty string will instead
pass in a null pointer.
Bug: 272643393
Test: run_prov40_tests
Test: atest GtsMediaTestCases
Change-Id: I10b0a3c7df4fc73272aa701bb01c60672645d4fc
(cherry picked from commit a878e7b98d)
Cherry-pick note: Compile fix only, needed for latest AOSP BoringSSL in tm-qpr-dev-plus-aosp and downstream branches, e.g. udc-*-dev.
Original change description:
Include what you use - this is no longer pulled in
by the other headers used in this file.
Bug: 272749540
Test: m
Change-Id: I0d4b480e47f84f367d1a9547b89811c52073a2fc
Merged-In: I0d4b480e47f84f367d1a9547b89811c52073a2fc
(cherry picked from commit c785e91ec3)
(Merged from http://go/wvgerrit/165859.)
Since renewal requests are signed with the MAC keys and not an
asymmetric key, it does not make sense to query OEMCrypto for the
asymmetric key hash algorithm nor to include the result in the renewal
request.
Bug: 262427121
Test: opk_ta
Change-Id: Ib309b63b79e553f4754c013718df242247ab9488
Merged from https://widevine-internal-review.googlesource.com/165861
We want debug headers to help diagnose b/186031735. I also
saw that we were only logging the domain name for some
errors instead of the full URL.
Bug: 186031735
Test: GtsMediaTestCases
Change-Id: I4d469a73e54f86d4d3b5d50bd0030fdb2a36df50
Merged from https://widevine-internal-review.googlesource.com/164468
We need to add integration tests in the form of duration license tests
in order to test that this feature works with licenses from a real
server.
Bug: 253513745
Test: WV unit/integration tests
Change-Id: I926d8309ed24183ae117e3f66fb92fec2d95c310
[ Merge of http://go/wvgerrit/161877 ]
This change introduces some logging to shed some light on
why some L1 devices fallback to L3.
* Additional logging has been added to indicate whether a lookup of
the symbols for OEMCrypto_Initialize, OEMCrypto_APIVersion
or OEMCrypto_Terminate failed.
* OEMCrypto_Initialize error code is saved and reported later.
Bug: 245887116
Test: GtsMediaTestCases
Change-Id: Ice4d966d2fee458de2fae28a1355f292f879c38b
[ Merge of go/wvgerrit/c/cdm/+/165138 ]
Enabled the Widevine DRM service on Android to return the raw boot
certificate chain via the CDM status query capabilities. This
property key is not available for app-level queries.
The BCC is dumped by the WVDrmFactory when requested to print all
CDM properties via dumpsys.
Bug: 234095402
Test: request_license_test
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -p
Change-Id: I34695b0655b4c609979577e9986974bc0fbda898
[ Merge of http://go/wvgerrit/165617 ]
Similar to the issue with updating secure stops by PST (see
http://go/wvgerrit/165597), when deleting different secure stops with
the same PST results in unintended behavior. This CL changes how the
CDM identifies which secure stop to delete from storaged based on the
key set ID rather than the PST.
Bug: 263316107
Test: device_files_unittest
Test: GTS MediaDrmParameterizedTests and MediaDrmStressTest
Change-Id: Ic3843a1435f252f052c7189423c211c28ed74eaa
[ Merge of http://go/wvgerrit/165191 ]
Previously, when updating a secure stop / usage info record, the
existing record was identified by PST. It was assumed that apps would
never use the same PST for different licenses; however, this was never
enforced. Certain GTS tests use the same PST across multiple tests to
identify different licenses. Depending on the order of operations,
the periodic updating of the usage entry might overwrite the wrong
entry.
Key set IDs are generated by the CDM, and are guaranteed to be unique
within the scope of the same file system. Given that key set IDs are
not expected to be transfered to different licenses, using the key
set ID to identify secure stop / usage info records eliminates the
possibility of overwriting the wrong entry.
Bug: 263316107
Test: device_files_unittest
Test: GTS MediaDrmParameterizedTests and MediaDrmStressTest
Change-Id: I2e2d50d188e05c8ca6b8095549796b913ea72d7a
[ 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
[ 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
[ 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
[ 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
[ 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
[ 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
No-Typo-Check: From a third party header file
Bug: 260918793
Test: unit tests
Test: atp v2/widevine-eng/drm_compliance
Change-Id: I36effd6a10a99bdb2399ab1f4a0fad026d607c70