Merge of https://widevine-internal-review.googlesource.com/c/cdm/+/173330
Skipping files that are not in android from the CL above.
Original commit message:
Pass the real oemcrypto session id from `pair.session` instead of
`session`, since `session` can be changed when L1 and L3 are running in parallel and `session` in that case may not be the correct oemcrypto session id any more.
Also adding a few missing v18 L3 functions pointers to the dynamic
adapter.
Need to re-generate L3 since the L3 sources changed.
Test: L3 unit tests
Test: GTS dash policy tests and Dexter tests
Bug: 271290471
Bug: 279967915
Change-Id: Idc44d57ca38eb1de24c0038917800e37c25b9afc
[ Merge of http://go/wvgerrit/171310 ]
Offline license not found errors are identified by CdmResponseEnum
347 (KEYSET_ID_NOT_FOUND_4). No addition file system information
is shared.
Checks for file existance use the stat command. The stat call can
return error codes from errno.h when the command fails.
These are now converted into sub error codes and returned along with
the offline license file not found error.
This also includes a change to log stat errors other than
ENOENT (no such file or directory) as a warning rather than verbose.
Bug: 276225520
Test: file_store_unittest, file_utils_unittest, GtsMediaTestCases
Change-Id: Ic09d036549582cd65783b49fa96ffefc4bf562c7
[ Merge of http://go/wvgerrit/172910 ]
The lifecycle of the Android CDM is controlled by Android's strong/
weak pointer functionality. Unfortunately, it does not provide an
easily predictable point in the code where the CDM is to be deleted
along with the saved metrics. In order to allow the CDM to keep a
list of metrics that are persistent with the life of the service, a
global thread safe queue is provided which is created when the first
CDM is created, but will out live the CDM.
The metrics will still be deleted when the DRM service is terminated.
Bug: 270166158
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Change-Id: Id98676d8b5278798b4de332cc272cd5b85024244
[ Merge of http://go/wvgerrit/171271 ]
There is a need to maintain a short history of metrics from CDMs which
have been deleted. This CL adds this ability to the Android version
of the WV CDM. The history cannot yet be maintained for long, as the
WV CDM instance is destroyed if unused.
Further changes are required to the plugin to maintain the history
beyond the life-cycle of the CDM instance, and to properly format
its output.
Bug: 239462891
Bug: 270166158
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m
Test: atest GtsMediaTestCases
Change-Id: I81c0996602722a9795fc3951030d20bb39b5816b
The predicate version of wait_for() to avoid spurious wake up by
checking running_ status.
This is a fix to ag/21439870
Test: build widevine
Bug: 272424659
Bug: 271811708
Change-Id: I446fef8f4c8c58bcd47b885dba50643b3e5e1185
[ 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