[ Merge of http://go/wvgerrit/141949 ]
[ Cherry-pick of http://ag/16496424 ]
If the debug count for ignoring an L1 keybox is still non-zero after
successfully processing an OTA keybox request, the dynamic layer MUST
return a failure to the CDM to keep the CDM and dynamic layer in
agreement that the L1 keybox should continue be treated as invalid.
This will trigger a fallback; but the fallback can be canceled via
the debugging app.
Bug: 210823889
Test: Android manual testing
Change-Id: I75f50ba605d17872c0e8abffc1eee13ff539f01c
Merge from Widevine repo of http://go/wvgerrit/139372
Revert workaround for falling back to L3
(Partially merged previously)
Merge from Widevine repo of http://go/wvgerrit/139498
Guard against double initialize
(Partially merged previously)
Merge from Widevine repo of http://go/wvgerrit/139343
Use a placeholder ID for devices missing a system ID
Merge from Widevine repo of http://go/wvgerrit/140934
Check security-level during OpenSession.
Merge from Widevine repo of https://go/wvgerrit/141469
Make OTAKeyboxSupported handle the short buffer return
code
Bug: 187646550
Bug: 206670307
Bug: 206570220
Bug: 205896558
Bug: 205041153
Test: Manual test on flame
Change-Id: I71f5faf6b611337b82d8b6179251f6b0224780e6
[ Cherry-pick of http://ag/15245767 ]
[ Merge of http://go/wvgerrit/128624 ]
The CDM session was incorrectly recording the "license SDK version" as
the "license service version" in the session metrics. This
discrepancy reduces the quality of devices' metrics and limits
debugging capabilities for the Widevine metric monitoring services.
Bug: 193177333
Test: Linux unit tests
Change-Id: Ic58cf7bc4fde777bb590c05777b76f5ff5c2f1ea
(cherry picked from commit 78278c3eb4)
(This is a merge of http://go/wvgerrit/139632.)
While fixing a compiler error about shadowed variables in CdmSession, I
noticed that this function had two result variables with different names
as well. This patch consolidates down to one result variable.
Bug: 207684988
Test: x86-64
Change-Id: Iaf6d742ef3409d85a1c364b486909d2497093112
(This is a merge of http://go/wvgerrit/139630.)
This patch fixes a few places that were using NULL or 0 instead of
nullptr.
Bug: 207702482
Test: x86-64 build
Change-Id: I10e19febebd093fe4445208a082216002d9a4482
(This is a merge of http://go/wvgerrit/139629.)
This patch fixes several places where the override keyword was missing.
These were found when future patches that enable stricter checking of
the override keyword were enabled. There are two basic categories of
missing override:
* Destructors found to be overriding a virtual destructor without using
the override keyword.
* Test methods overriding methods on test-only or mock objects.
Some of these were previously marked as virtual, following our pre-C++11
style guidelines, but this is not necessary now that we have override.
Bug: 207684988
Test: x86-64 build
Change-Id: I09aa499bd3ea80d925e2fc422290d61eb005a769
(This is a merge of http://go/wvgerrit/139569.)
The unit test for DeviceFiles previously had to work around googlemock's
lack of support for move-only types. Now that we have upgraded to
googletest 1.10, we can use move-only types directly via the ByMove()
utility, removing the need for this workaround.
Bug: 207693599
Test: x86-64
Change-Id: Ib4dcc5ec367ef413465a3e8a8f45f9187976ed5e
Merge from Widevine repo of http://go/wvgerrit/139498
If L1 OEMCrypto fails to initialize, we won't try again.
Bug: 206670307
Change-Id: I89084476ae01d9c98291392c2ce703ebc6326322
Merge from Widevine repo of http://go/wvgerrit/139336
When pretending we have no keybox, we should also have no system id or
device id. This should reproduce our problem with the test app.
Bug: 206570220
Test: reproduced problem using TestOPK app
Change-Id: I893336ce8e1fd2272f5b511676e1da28654639a7
Merge from Widevine repo of http://go/wvgerrit/139333
This is a workaround for devices that don't have a
keybox installed.
Bug: 206570220
Bug: 205896558
Bug: 205041153
Test: verified device falls back to L3 using TestOKP app
Change-Id: Id929b48ddaa7114a81765095aac536705f69e68c
(This is a merge of http://go/wvgerrit/138969.)
Provisioning 4.0 on CE CDM requires not only the make & model but the
model year in order to relate a device back to its system ID. This patch
adds model year to the list of properties that partners must provide as
client identification.
As no equivalent field exists for Android, this property is not
provided on Android platforms.
Bug: 206453352
Test: x86-64
Change-Id: I0764d67fec54fa9a0c65074e68f3ee02de1e7820
[ Merge of http://go/wvgerrit/138149 ]
Update the android version number test to "12L"
Bug: 205491167
Test: wv unit/integration tests
Change-Id: If11e7c6f3a89263ab78d274aa8d776991d3942e9
[ Merge of http://go/wvgerrit/138606 ]
The new error code OEMCrypto_ERROR_INVALID_KEY is to replace the now
deprecated error code OEMCrypto_ERROR_INVALID_RSA_KEY. This error code
serves the same purpose of OEMCrypto_ERROR_INVALID_RSA_KEY, but may be
appied to RSA, ECC and Twisted-Edward ECC keys. In general, this error
code is to indicate that a key is poorly formatted / unparsable, used in
an operation without allow permissions, or used in an operation that it
cannot be association (RSA signing with an ECC key).
Going forward, new OEMCrypto implementation should use
OEMCrypto_ERROR_INVALID_KEY in place of OEMCrypto_ERROR_INVALID_RSA_KEY.
The CDM will continue to support both error codes.
Bug: 201581141
Test: Testbed unit tests
Change-Id: I2cf1af33a9a1d8716eec4cc63bba52d2f4af4c1b
[ Merge of http://go/wvgerrit/138089 ]
Non-hidl code is no longer needed in the widevine android plugin. By
doing work this cleanup will save the team from having to keep
maintaining code that isn't needed anymore.
Clean up steps taken as follows:
1. Remove non-hidl code but keep commonly used code
2. Remove legacy test code
3. Remove legacy test build and test entry
Bug: 69573078
Bug: 172285246
Test: unit tests, GtsMediaTestCases, CtsMediaDrmTestCases
Change-Id: I75938d69413c631ef6be82da3d885ba173efc581
(This is a merge of http://go/wvgerrit/134316.)
This patch fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits. Most of the time, it
does this by making the implicit conversion explicit. Occasionally,
where it makes sense, it does this by expanding the code to operate on a
64-bit value.
This patch removes LicenseKeysTest::NumContentKeys(), which no one was
using, as all the tests access content_key_count_ directly.
Bug: 194971260
Test: x86-64
Change-Id: Iae7685c10b9db989253b349cab693728b438798d
(This is a merge of http://go/wvgerrit/134424.)
This patch fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits. The membarrier
functions have their return type expanded so they can report the full
return value of the syscall.
Bug: 194971260
Test: x86-64
Change-Id: I5d948162b1f3f1540288df9494cabda39ecf8905
[ Merge of http://go/wvgerrit/138289 and http://go/ag/16210935 ]
Update the android version number test to accept "12" or "12L"
Bug: 205491167
Test: wv unit/integration tests
Change-Id: If11e7c6f3a89263ab78d274aa8d776991d3942e9
[ Merge of http://go/wvgerrit/137951 ]
ValueMetric was not checking whether certain unsigned types will
overflow when casted to protobuf's signed int64 type. This CL
adds a max value to prevent potential overflows.
The value metric has also been updated to an emum to represent its
possible three state, as opposed to using two boolean flags. For basic
value metrics, this saves about 4 bytes of space. This works out to
being ~100 bytes per crypto session, ~20 bytes per CDM session and ~20
bytes per engine metrics.
Bug: 204946540
Test: Metric unit tests
Change-Id: I688bece8f31cccaf2a25bd8f99d9b080b0efd0de
[ Merge of http://go/wvgerrit/137811 ]
Renamed TimerMetric to Timer. Timer is used to generate durations
included in metrics, but is not a metric itself. The method of
getting the current time did not require creating an instance of
std::steady_clock.
Updated Distribution and Timer to use default initializers instead of
constructor initialization list.
Bug: 204946540
Test: Metric unit tests
Change-Id: I7ed291b586347dd0b7ab305960883bec04637315