Commit Graph

850 Commits

Author SHA1 Message Date
Alex Dale
1a405a11a6 adding OEM_ENTITLEMENT key container type.
[ Merge of http://go/wvgerrit/148691 ]

This is a followup to OEM_CONTENT,
a custom key container that was added to Widevine server.

Bug: 193006094
Bug: 236317198
Change-Id: I82285e4e50f981e0cedf2adac5910643f34f8e46
2022-07-20 14:47:42 -07:00
Alex Dale
41d307ed9e Misc fixes for Windows
[ Merge of http://go/wvgerrit/152510 ]

Bug: 236317198
Change-Id: I67ac7d7c903ecfbb659595699c5bfe38f4d781df
2022-07-20 14:47:42 -07:00
Alex Dale
4455aeceed Fix InstallTestRSAKey() for provision 4 tests
[ Merge of http://go/wvgerrit/153589 ]

Some unit tests call InstallTestRSAKey() a few times. In current
provision 2 with Keybox, the test RSA DRM key is hard coded. But for
provision 4, it will be generated by OEMCrypto.

When a test calls multiple times of InstallTestRSAKey(), we don't want
the key to be generated during each call, and we want to use the same
key in order for the decrytion to work.

The fix to cache the drm key once it is created for prov 4 tests.

Bug: 180530495
Bug: 236317198
Test: oemcrypto_test
Change-Id: I1b2d96a89e0619861492e6d9bc56862e2c440c86
2022-06-23 14:48:19 -07:00
Alex Dale
073f478239 Implement GetDeviceId for prov4
[ Merge of http://go/wvgerrit/150349 ]

The device id for prov4 is hash of the encoded device public key
(COSE_key).

Also replaced a few bug numbers if it is prov3 specific (not related to prov4).

Bug: 225216277
Bug: 236317198
Test: oemcrypto_test
Change-Id: Ica1c8579c0a3ef83c70f331283c9cce629c6bb3f
2022-06-23 14:48:19 -07:00
Alex Dale
d874fffaec Support 32 bytes session key
[ Merge of http://go/wvgerrit/149849 ]

With ECC based DRM cert, the session key is expected to be 32, as
compared to 16 bytes in RSA case. This CL adds supports for 32 bytes
session key.

Bug: 236317198
Test: oemcrypto_test
Change-Id: I657fdd92d17736a23375ddcd457f83efa6ca6d1f
2022-06-23 14:48:19 -07:00
Alex Dale
9b04109b60 Merge "Updated OEMCrypto tests to use DRM key objects." 2022-06-21 20:52:08 +00:00
Cong Lin
f529e0d563 Add unit test for clear KCB in LS SDK 16.4 response am: 8c4c238324 am: 154a1db776
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18973819

Change-Id: I0224f6540925ad4b16988afd8e2bd76a12771c49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 08:26:02 +00:00
Cong Lin
8c4c238324 Add unit test for clear KCB in LS SDK 16.4 response
This is a merge from:
https://widevine-internal-review.googlesource.com/c/cdm/+/152897
and http://go/wvgerrit/153709

Adding a new OEMCrypto unit test will allow partners to correct a
problem earlier in their integration.

Verifies current oemcrypto implementation handles clear KCB in a
mocked 16.4 license response.

Unit test release date updated to 2022-06-17.

Test: run_x86_64_tests; opk_ta
Bug: 235870170
Bug: 234645065
Change-Id: I59fef2c25f5c007624447d4f46147d96adeddad9
2022-06-17 15:02:09 -07:00
Alex Dale
bfa2d782bd Updated OEMCrypto tests to use DRM key objects.
[ Merge of http://go/wvgerrit/147275 ]

Swapped out use of OpenSSL/BoringSSL RSA and EC_KEY to use OEMCrypto
reference utility classes RsaPublicKey/EccPublicKey.  This enables
further test development with ECC keys, and removes duplicate OpenSSL/
BoringSSL code.

For Android makefiles, only the minimally required files have been
added.

Bug: 205902021
Bug: 236317198
Test: run_prov30_test run_prov40_test oemcrypto_test
Change-Id: I64491018e8ffb69bf986083e3aae446eb9e5cf39
2022-06-16 21:13:22 -07:00
Alex Dale
2a371dce54 Remove duplicate wvcrc files
[ Merge of http://go/wvgerrit/150789 ]

We had two copies of the wvcrc32.h and wvcrc.cpp files: One in
oemcrypto/util/ and one in oemcrypto/test/. The two were identical
except for the namespaces used. However, this setup created confusion if
the compiler could see both files, as the wrong one could get included.
This patch removes the set from test/ in favor of the more-widely-used
set from util/ and updates the one piece of code using the old
namespace.

Update Android oemcrypto_test makefile for wvcrc32.

[ Merge of http://go/wvgerrit/153657 ]

Duplicated wvcrc files were removed in http://go/wvgerrit/150632,
however, the Android-specific makefile for oemcrypto_test was not
updated with the new source and include directory.  This CL makes
the necessary changes to the makefile to build with the OEC ref util
version of wvcrc32.

Bug: 229160397
Bug: 236317198
Test: oemcrypto_test
Change-Id: I0b53255122172fb514e7e0602b59f3ab704e52da
2022-06-16 20:53:57 -07:00
Alex Dale
dd2f063254 Change ERROR_INVALID_RSA_KEY to ERROR_INVALID_KEY
[ Merge of http://go/wvgerrit/149269 ]

This mostly affects tests and documentation.

Bug: 201581141
Bug: 236317198
Change-Id: I1bc0ec4c3767106c01dfac9956f83ccfbffc49b7
2022-06-16 18:12:16 -07:00
Alex Dale
173b230588 High-level wrapper around HMAC-SHA256 algorithm.
[ Merge of http://go/wvgerrit/152950 ]

This CL introduces several functions for computing a HMAC-SHA256
signature.  The functions wrap the OpenSSL/BoringSSL implementation
of HMAC(), allowing for common C++ types to be passed in.  Several
of the functions follow several OEMCrypto conventions for generating
signatures (ex. returning OEMCrypto_ERROR_SHORT_BUFFER if signature
buffer is too small).

Also provided limited wrappers for HMAC-SHA-1, which are used for
a limited number of operations within OEMCrypto.

Bug: 154055871
Bug: 145026434
Bug: 236317198
Test: hmac_unittest
Change-Id: I4a9e56066a7c3f14c7159270503225cd794c1bb6
2022-06-16 18:00:19 -07:00
Vicky Min
eb711ea0ec Fix out of bounds buffer error in CreateCoreLicenseResponse()
In CreateCoreLicenseResponse(), there seems to be an out of bounds
potential error due to a missing check that the index used for
license_response.parsed_license->key_array is valid. Adding a check
for this here.

Bug: 217677571
Test: fuzz tests
Change-Id: I37f7228f87992ba5284c553d7b07ef97d6a66ab3
2022-05-31 21:01:20 +00:00
Cong Lin
9935fae50d Loosen KCB encryption checks in L3
This is a merge from:
https://widevine-internal-review.googlesource.com/c/cdm/+/152372

The L3 source change which produced these libraries is:
https://widevine-internal-review.googlesource.com/c/cdm/+/152371/

Original commit message:
To address the bug with certain 16.4.x SDK versions returning a
clear key control block (KCB) for clients newer than 16.5, the
exact version check to determine whether key control blocks are
clear or not has been loosened.

Original behavior:
- ODK version >= 16.5.x --> Assume clear
- ODK version <= 16.4.x --> Assume encrypted
New behavior:
- No KCB IV --> Assume clear
- Otherwise --> Assume encrypted

This CL also includes a change to oemcrypto/include/OEMCryptoCENC.h
The changes to OEMCryptoCENC.h in the CL are comments or variable name
change. So it should be safe.
This change was merged to wv tm-dev here:
https://widevine-internal-review.googlesource.com/c/cdm/+/148411
So, adding it to Android tm-dev.

Test: run_level3_static_tests, CdmDecryptTest/CdmTestWithDecryptParam.* against LS SDK 16.4.2 & 17.0
Bug: 232557453
Change-Id: I2bbb5ab3ea33a16bd6c198077e5aefe960737ea0
2022-05-22 06:35:22 +00:00
TreeHugger Robot
c4a2a08ee6 Merge "Update TestMaxDRMKeys to use 2048 bit keys only" into tm-dev 2022-05-09 09:34:58 +00:00
TreeHugger Robot
6e4cf1f1a9 Merge "Restrict CAS unit tests to devices that support CAS" into tm-dev 2022-05-09 09:34:55 +00:00
Alex Dale
f980049ef0 Merge "Resize OEMCrypto buffer-based results on success." into tm-dev 2022-05-05 20:38:05 +00:00
Edwin Wong
f607802265 Merge "Only use libbinder_ndk for aidl service." into tm-dev 2022-05-05 17:53:05 +00:00
Edwin Wong
af5f57a46c Only use libbinder_ndk for aidl service.
[ Merged from http://go/wvgerrit/151169 ]

Test: Netflix and Google TV streaming and downloaded playback
Test: unit tests
Test: atest VtsAidlHalDrmTargetTest
Test: adb shell readelf -d /vendor/bin/hw/android.hardware.drm-service.widevine
Test: adb shell readelf -d /vendor/lib64/libwvaidl.so

Bug: 230791937
Change-Id: Ia60d9fc838bf228b40d99b076a837ae789fa2d03
2022-05-05 15:12:55 +00:00
Alex Dale
1069ae39cc Resize OEMCrypto buffer-based results on success.
[ Merge of http://go/wvgerrit/151191 ]

Within the CDM and OEMCrypto tests, there were a few OEMCrypto function
calls where the final size of the output buffers were not being
resized.  For several of these functions, an initial call is made with
zero-length output buffers, expecting OEMCrypto to return
ERROR_SHORT_BUFFER; followed by a call with buffers at least as large
as specified by OEMCrypto.  However, for some operations, OEMCrypto
makes an estimate on the final size on the first call, specifying the
exact size only after performing the operations.

This is the case for the wrapped key returned by
OEMCrypto_LoadProvisioning().  The provisioning response contains a
padded + encrypted DRM key.  OEMCrypto does not know the actual size
of the key until decrypted, and the actual DRM key might be smaller.

There was a OEMCrypto test for OEMCrypto_BuildInformation() which
was enforcing the wrong behaviour.  This has been updated.

Bug: 230661565
Test: oemcrypto_test
Change-Id: Iad297d56ffbb085894641fdf8698ce5fd18edbf2
2022-05-04 21:32:08 -07:00
Vicky Min
1563fb2a27 Fix TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths()
In TestLoadLicenseForOutOfRangeSubStringOffSetAndLengths(),
LoadResponse() should be called after EncryptAndSignResponse() so this
is moved in this CL.

Bug: 231368221
Test: OEMCryptoMemoryLoadLicense tests
Change-Id: I7a0224afb21c3ab1d896ce3cfb64e1ad544a581a
2022-05-03 23:36:05 +00:00
Fred Gylys-Colwell
2899924d42 Update TestMaxDRMKeys to use 2048 bit keys only
Merge from Widevine repo of http://go/wvgerrit/151254

Test: Ran tests on reference oemcrypto
Bug: 228996670
Change-Id: I6ea69bad49fa2d4272fc8bb02895c17f314c7f49
2022-05-02 17:36:36 -07:00
Fred Gylys-Colwell
0d6fbb2d0e Restrict CAS unit tests to devices that support CAS
Merge from Widevine repo of http://go/wvgerrit/151253

This updates the OEMCrypto unit test filters to remove
CasOnly tests if the device does not implement the cas
function OEMCrypto_LoadCasECMKeys.

Test: unit tests on Luci
Bug: 221256887
Change-Id: I7026c4318153ada1d85055704e87b2cef397ffca
2022-05-02 15:41:52 -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
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
TreeHugger Robot
26ee600923 Merge "Copied OEMCrypto utils to Android." into tm-dev 2022-03-23 23:16:15 +00:00
Alex Dale
4a065adc33 Copied OEMCrypto utils to Android.
The OEMCrypto utils have been copied over from the CDM repo.
Tests have been excluded for this CL.

Files represent a snapshot taken from http://go/wvgerrit/148270
and http://go/wvgerrit/148372.

Bug: 205902021
Change-Id: I1a58952cd1436a48974367c5436bf7296163e6f1
2022-03-21 21:22:19 -07:00
Rahul Frias
b07523f4c6 Constrain the generated key type in testing
[ Merge of http://go/wvgerrit/148157 ]

Fail the test if the returned type is other values.

Bug: 224375138
Test: GtsMediaDrmTests
Change-Id: I4abad9d69865cac99654d3dedd443463dd728a58
2022-03-21 14:41:01 -07:00
Rahul Frias
a6a99c416f Free EC key in test session destructor
[ Merged from http://go/wvgerrit/148030 ]

Bug: 224375138
Test: GtsMediaDrmTests
Change-Id: Ic1d42756cb1a03fa52d90c5fb0bd496e87a43c65
2022-03-21 14:37:58 -07:00
Rahul Frias
cff6103321 Merge changes from topics "presubmit-am-0d92e9728c2d40da892bd450843310cb", "presubmit-am-11f8881adcb544ca8682231293b0f1c7", "presubmit-am-30bc14671b7b4b309e57b8600f46b32b", "presubmit-am-35012549d66140dd9d446b5eedf6e274", "presubmit-am-374672395de04b7b8f697a54e16be928", "presubmit-am-48d77602d3694ced89dd6e82a89fa646", "presubmit-am-4f8d5681247e4064a298d1e5263c41be", "presubmit-am-89930436636343d5a779bc06ccc307dc", "presubmit-am-904492a27e4449e78cf21dd9f4ab8ff0", "presubmit-am-90646715a3284730bf356bb6f4634729", "presubmit-am-a1ae313a0fde4696b7fb8c4390d3a94c", "presubmit-am-ae051fae1d06485ca7f12bcf265e8328", "presubmit-am-b4e6ace5be72409aab8e328c6f2a0288", "presubmit-am-dd16b680e0454031b2213179b22df7d7", "presubmit-am-e249264532da4839841f4cab3675fa61", "presubmit-am-e3a2f43ba2f84f429536270e16d0d251", "presubmit-am-e5f2e7a319d04b89950c63471d7f2458", "presubmit-am-ea47ff378925466c8c92e2ed9b58c461", "presubmit-am-f582c497c3274c7e84606cf3da4b09df" into tm-dev
* changes:
  Change the signature format requirement of OEMCrypto_GenerateCertificateKeyPair
  Fix EnsureProvisioned for double provisioning
  Update fuzz tests to match output desriptor struct
  Use default url to inform app of prov40 stages
  Fix key_control_iv in OEMCrypto tests
  Fix jenkins/opk_optee after v17 merge
  Remove old test license holder
  Generic crypto tests: use license holder
  Reboot tests: verify offline license is valid after reboot
  Policy integration tests: use license holder
  Integration tests: add license holder
  Reboot test: Initialize fake clock
  Reboot test: save large files
  Test max number of DRM private keys
  Merge oemcrypto-v17 to master
  Update cipher mode elsewhere
  Fix 1 ClangTidyBuild finding:
  Add out of bounds testing for LoadKeys()
  Separate invalid session test for ReuseUsageEntry
2022-03-17 16:39:36 +00:00
Rahul Frias
85310dfbf6 Change the signature format requirement of OEMCrypto_GenerateCertificateKeyPair
[ Merge of http://go/wvgerrit/147593 ]

As we have decided to use hw_bcc service in Trusty to generate BCC and
sign the generated certificate public key, we need to change the
signature format to cose-sign1, which is defined by hw_bcc API.

Bug: 221496117
Test: GtsMediaTestCase on sunfish
Change-Id: I30739a0f0ae49291d343db46ad9e898663985cc8
2022-03-16 01:39:00 -07:00
Rahul Frias
d6362f6e6b Update fuzz tests to match output desriptor struct
[ Merge of http://go/wvgerrit/147110 ]

The OEMCrypto_DestBufferDesc had fields address/address_length renamed
to clear_buffer/clear_buffer_length in v17. However this was not updated
for the fuzz tests thus causing some code coverage errors. This should
fix those errors.

Merged from https://widevine-internal-review.googlesource.com/146889

Bug: 220946359, 220946990
Test: GtsMediaTestCases on sunfish
Change-Id: I2837de2f79c0e731d072e3712d6b769df17a1c7e
2022-03-16 01:38:19 -07:00
Rahul Frias
139310fd05 Fix key_control_iv in OEMCrypto tests
[ Merge of http://go/wvgerrit/145989 ]

The key_control_iv field is used with an encrypted KCB.  With v17, the
KCB is in the clear and this field should have a length of 0.  This
updates the tests to set the field correctly.

Bug: 224375138
Test: GtsMediaTestCases on sunfish
Change-Id: I2973bc064705557c878bb1fe943e5fde92977dcc
2022-03-16 01:37:32 -07:00
Rahul Frias
57353b4941 Test max number of DRM private keys
[ Merge of http://go/wvgerrit/143909 ]

The max. number of DRM keys that can be loaded depends on the resource
rating.

Add a test to verify:
1. We can load up to MAX. drm keys
2. Loading the MAX+1 key can fail
3. The loaded keys should work even if loading other keys failed

Bug: 209084113
Test: opk_ta, run_x86_64_tests, run_level3_static_tests,
run_fake_l1_tests
Test: GtsMediaTestCases on sunfish

Change-Id: Ib9821e8a1994d41d3e9c2063440c109a2332ba89
2022-03-16 01:33:48 -07:00
Rahul Frias
5f45485175 Merge oemcrypto-v17 to master
[ Merge of http://go/wvgerrit/144530 ]

It's time to copy all the v17 work to our main branch.
I had to re-run clang-format to match local style.

Merge from commit b14f08374f9a48aed49850cc230daf384725b15f
Fix allow_null for key control iv in L3 v17

Bug: 161477208
Test: GtsMediaTestCases on sunfish
Change-Id: I97caa851e9e65eb0e42034d2f4a28dfb7499df0d
2022-03-16 01:33:23 -07:00
Rahul Frias
83a4100d11 Update cipher mode elsewhere
[ Merge of http://go/wvgerrit/144696 ]

In v17,
OEMCrypto_CipherMode_CTR renamed to OEMCrypto_CipherMode_CENC
OEMCrypto_CipherMode_CBC renamed to OEMCrypto_CipherMode_CBCS

Bug: 224375138
Test: GtsMediaTestCases on sunfish
Change-Id: I2d96e9c6d22a9d9e2fbbd15a8aea3f2d5dac6dcb
2022-03-16 01:33:02 -07:00
Rahul Frias
4532802ea0 Fix 1 ClangTidyBuild finding:
[ Merge of http://go/wvgerrit/145289 ]

* missing #include <string> for 'std::string' For more info see go/clang_tidy/checks/google3-build-missing-std-includes

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/clang-tidy-bug for category ClangTidyBuild if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

Tested:
    Local presubmit tests passed.

Bug: 224375138
Test: GtsTestCases on sunfish

PiperOrigin-RevId: 426761099
Merged from https://widevine-internal-review.googlesource.com/145250

Change-Id: I5a66b6eccc2b08ee11f92f90ce3b725f24c8d33c
2022-03-16 01:31:53 -07:00
Rahul Frias
bc6e841ccd Add out of bounds testing for LoadKeys()
[ Merge of http://go/wvgerrit/146249 ]

Update the OEMCryptoMemoryLoadLicense* tests so they cover LoadKeys()
for v15 and prior and LoadLicense() for v16 and later versions.

Merged from https://widevine-internal-review.googlesource.com/145951

Bug: 190749256
Test: GtsMediaTestCases on sunfish
Change-Id: If90f7afd82819375f52a2fe619675bf0c4c4dd3a
2022-03-16 01:30:39 -07:00
Rahul Frias
8350badbb5 Separate invalid session test for ReuseUsageEntry
[ Merge of http://go/wvgerrit/144729 ]

Since OEMCrypto_ReuseUsageEntry() was introduced in v17, splitting the
test case for an invalid session from the other usage entry methods
since they were implemented in v15/16 as well.

Bug: 216193739
Test: GtsMediaTestCases on a sunfish
Change-Id: I7f4399c07a19227495a15807228b930066f6a794
2022-03-16 01:20:02 -07:00
Edwin
77f1fedde2 Build both AIDL and HIDL targets.
Merged from http://go/wvgerrit/147689

The default is to build for AIDL Widevine service.
Use "-t hidl" in build_and_run_all_unit_tests.sh or
build_all_unit_tests.sh to build for HIDL service.

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

Bug: 217247987
Change-Id: Ie7c51033f4aba341c829ccc8f846a6cfeab76df3
2022-03-11 15:36:55 -08:00
Edwin
3c3da01d58 Use aidl interface for Widevine service.
The interface is defined in
hardware/interfaces/drm/aidl(http://go/ag/15329852).

Test: build
  m android.hardware.drm-service.widevine -j128

Test: build_and_run_all_unit_tests.sh
  for hidl tests

Test: atest VtsAidlHalDrmTargetTest

Test:   atest vts_treble_vintf_vendor_test:vts_treble_vintf_vendor_test.DeviceManifest/SingleManifestTest#ManifestAidlHalsServed/0 -- --abi x86_64

Bug: 200055138
Bug: 170964303
Change-Id: I5654d90d8a4b0bae4b4a78e79b27c1cafec36be7
2022-02-01 22:20:04 -08:00
Yohei Yukawa
a4d835af3a Revert "Use aidl interface for Widevine service."
This reverts commit 96a8ccd4a1.

Reason for revert:
Could break DeviceManifest/SingleManifestTest#ManifestAidlHalsServed

Bug: 200055138
Bug: 170964303
Bug: 217241995
Change-Id: I9c42df15defec428c9ef8c62439c63d4a603fee6
2022-01-31 22:01:25 +00:00
Edwin
96a8ccd4a1 Use aidl interface for Widevine service.
The interface is defined in
hardware/interfaces/drm/aidl(http://go/ag/15329852).

Test: build
  m android.hardware.drm-service.widevine -j128

Test: build_and_run_all_unit_tests.sh
  for hidl tests

Test: atest VtsAidlHalDrmTargetTest

Bug: 200055138
Bug: 170964303
Change-Id: If2f2a129914436ba5cef1c46f6cb9415e12c3d1c
2022-01-28 20:29:14 -08:00
Kyle Zhang
642965c678 Merge latest oemcrypto-v17 change
No-Typo-Check: Not related to this change.

Bug: 161477208
Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
2022-01-27 20:07:15 -08:00
John "Juce" Bruce
df23c7da03 Fix errors being hidden by Protobuf warning-disabling
(This is a merge of http://go/wvgerrit/140850.)

This patch fixes a number of minor issues in the codebase (mostly
instances of 0-as-nullptr, but also some member shadowing and a missing
override) that were being hidden by the fact that depending on Protobuf
disables these diagnostics. And which will be unhidden when a later
patch removes that behavior from Protobuf.

Bug: 208304830
Test: x86-64
Change-Id: I4b0b1264748880b3726a6388d589868d898f949e
2022-01-21 01:49:40 +00:00
Fred Gylys-Colwell
0b0b1abdb4 Skip OTA test if not supported am: 2f57079f6a am: 76bbdba1e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16507241

Change-Id: Ib62bd5f289d770dbcc865ae4b77fd30e8d1ea461
2022-01-07 06:08:37 +00:00
Fred Gylys-Colwell
2f57079f6a Skip OTA test if not supported
Merge from Widevine repo of http://go/wvgerrit/142050

This is test only code.

Bug: 210690170
Change-Id: Ic982cc1ed801325146918bd6153e7f34faf31196
2021-12-19 17:58:26 +00:00
John "Juce" Bruce
c43b9fc3de Use nullptr in more places
(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
2021-12-01 11:58:05 -08:00
Alex Dale
4d219ef217 Merge "Added new error code OEMCrypto_ERROR_INVALID_KEY." 2021-11-17 05:11:42 +00:00
Alex Dale
59f0f7cd36 Added new error code OEMCrypto_ERROR_INVALID_KEY.
[ 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
2021-11-11 20:25:31 -08:00