Commit Graph

560 Commits

Author SHA1 Message Date
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
John W. Bruce
c45559177a Fix -Wshorten-64-to-32 errors in test code
(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
2021-11-10 16:16:47 -08:00
TreeHugger Robot
283e71ae50 Merge "Update fuzz tests" 2021-11-05 04:00:23 +00:00
TreeHugger Robot
eb3d25127a Merge "Added an oemcrypto test for OPK versioning" 2021-11-05 03:41:07 +00:00
John W. Bruce
71aaf870c8 Make implicit 64-to-32-bit conversions in core_message_serialize.cpp explicit
(This is a merge of http://go/wvgerrit/134404.)

There were two lines that were tripping Clang's `-Wshorten-64-to-32`
warning. This CL makes both conversions explicit to appease the warning.
There should be no change in behavior.

Bug: 194971260
Test: ODK Unit Tests
Change-Id: I6d111e9a4efc1f0e31b51e455c47c0e885d48e6b
2021-10-27 12:41:47 -07:00
John W. Bruce
8d35b2c4e2 ODK: Fix a few implict type conversion issues
(This is a merge of http://go/wvgerrit/134403.)

Reported as errors by UBSAN

Bug: 194971260
Test: Ran ODK unit tests
Change-Id: I2f38fb6952d259458af8498e86b3308421e93320
2021-10-27 12:40:10 -07:00
John W. Bruce
5619afc566 Clarify entitled vs. entitlement in OEMCrypto tests
(This is a merge of http://go/wvgerrit/133650.)

Several places in the OEMCrypto tests refer to entitled keys as
entitlement keys. This patch fixes those references. It does not change
places that were actually meant to refer to entitlement keys.

Test: x86-64 platform tests
Bug: 203697187
Change-Id: I2ad2d82a666fd0cc08662e39177313cf36c2ad43
2021-10-21 20:05:15 +00:00
Alex Dale
5975b4e70a Formatted OTA keybox function comments.
The API comments for the two new OTA keybox OEMCrypto functions
required formatting to be compatible with the doxygen comment
strings.

Bug: 190505461
Test: Android unit tests and GTS
Merged-In: Ia45dc9d727a2a904170912193709cd9416b8fe27
Change-Id: Ia45dc9d727a2a904170912193709cd9416b8fe27
(cherry picked from commit 9f2364cefd)
2021-10-20 17:50:47 -07:00
Fred Gylys-Colwell
a3166eb2ba Updates to OTA Keybox Reprovisioning
Adjust OTA code to account for some design changes and
add integration tests.

Merge from Widevine repo of http://go/wvgerrit/133775
Change use_test_key to uint32_t type

Merge from Widevine repo of http://go/wvgerrit/133774
Cleanup CDM OKP info before tests.

Merge from Widevine repo of http://go/wvgerrit/133773
Change context for derivation in OTA keybox solution

Merge from Widevine repo of http://go/wvgerrit/133772
Updated OTA keybox key derivation.

Merge from Widevine repo of http://go/wvgerrit/133771
Use double provisioning step in integration tests

Merge from Widevine repo of http://go/wvgerrit/133770
Erase keybox on initialization for OEMCrypto testbed

Merge from Widevine repo of http://go/wvgerrit/133769
Add session id to OEMCrypto OTA functions

Merge from Widevine repo of http://go/wvgerrit/133768
Integration test for OTA Keybox reprovisioning

Merge from Widevine repo of http://go/wvgerrit/133767
Add test x509 cert for testing

Merge from Widevine repo of http://go/wvgerrit/133766
OTA Keybox basic functionality in testbed

Merge from Widevine repo of http://go/wvgerrit/133765
Update OTA test script to use newer build scripts

Merge from Widevine repo of http://go/wvgerrit/133764
Adjust comment stype for doxygen

Test: Test: unit/integration/GtsMediaTestCases

Bug: 190505461
Bug: 190505461
Bug: 190505461
bug: 187646550
Bug: 187646550
Bug: 187646550
Bug: 187646550
Bug: 190505461
Bug: 187646550
Bug: 188228998
Bug: 190505461
Bug: 187646550
Merged-In: I41ff819a1fd8aca2e20adb25127fa0d9c4879b01
Change-Id: I41ff819a1fd8aca2e20adb25127fa0d9c4879b01
2021-10-20 17:50:18 -07:00
Fred Gylys-Colwell
44ba42f5cc Use local provisioning server
Merge from Widevine repo of http://go/wvgerrit/133703 and
http://ag/14707867

In order to use a local provisioning server, we need to use a
different test keybox system id that is in the dev device database
instead of the production database. We also need to use a local
license server that uses the dev license server.

Bug: 187646550
Test: GtsMediaTestCases

Change-Id: Ice89143dd26de22757375a770c6bac716fcbc057

Add Keybox OTA Provisioning functions to OEMCrypto header

Merge from Widevine repo of http://go/wvgerrit/133704 and
http://go/ag/14707868

Bug: 188228998
Change-Id: Iff54bc2870e87bf7239e179e1d02fbcc8df6198f

Stub build changes to support OTA Keybox

Merge from Widevine repo of http://go/wvgerrit/133725 and
http://go/ag/14781459

This CL adds a new unit test file for testing OTA keybox
reprovisioning functionality. This new test is built when running the
dynamic adapter in the linux build, and in the Android build.

Bug: 187646550
Change-Id: I625513840188f95e74831ef2ea399e827e837439

Add OTA Keybox functions to dynamic adapter

Merge from Widevine repo of http://go/wvgerrit/125843
and http://go/ag/14781460

Bug: 187646550
Change-Id: Ief78ed10599c091690e0d7dc488ea71674c763b5

Refactor dynamic adapter keybox verification

Merge from Widevine repo of http://go/wvgerrit/133727
http://go/ag/14812524

The keybox validation needs to be done separately from initializing
the library so that we can support Keybox OTA Reprovisioning.

If L1 loads, but the keybox is missing, the initialization should
succeed. When the keybox is validated, the adapter should try to look
for a keybox on the filesystem. if none is found, it should either
return NEEDS PROVISIONING or an error.

Bug: 187646550
Change-Id: I34a8c365a5a5ca35c379bea827c85c749964744c

Update crypto session to use new OTA keybox functionality

Merge from Widevine repo of http://go/wvgerrit/133728 and
http://go/ag/14812525

This CL stubs out two new CryptoSession functions that call the new
OEMCrypto functions for OTA Keybox Provisioning. It builds!  Yay!

It also adds a boolean needs_keybox_provisioning that is set to true
when OEMCrypto reports that it needs a keybox. This should only happen
if there is no keybox installed and oemcrypto supports provisioning.

Bug: 187646550
Merged-In: Ide9533943125aa13b8899b652b118a0b410c882c
Change-Id: Ide9533943125aa13b8899b652b118a0b410c882c
2021-10-20 17:49:43 -07:00
John W. Bruce
1447eba7bc Fix -Wshorten-64-to-32 errors in usage table code
(This is a merge of http://go/wvgerrit/134312.)

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. There are a lot of
these places in the usage table code because we always use uint32_t as
the type of a usage entry index, but much of the code that interacts
with the usage table system naturally wants to use size_t.

Bug: 194971260
Test: OEMCrypto unit tests
Test: x86-64 platform tests
Change-Id: I3923af40715efe367955a194a9e33be3e9cb014c
2021-10-20 22:28:57 +00:00
TreeHugger Robot
5fa977882e Merge "Add the OEMCrypto test RSA key in DER format" 2021-10-19 00:14:50 +00:00
TreeHugger Robot
9d84d5deba Merge "Migrate tests to googletest 1.10+ API" 2021-10-16 00:20:40 +00:00
Fred Gylys-Colwell
c7e237eb00 Update fuzz tests
Several updates to fuzz tests, including
http://go/wvgerrit/124043
Add documentation for partners to run fuzzing

http://go/wvgerrit/128224
Fix generic verify fuzz script

http://go/wvgerrit/120507
Fuzzing: Add fuzzer for reportusage API

http://go/wvgerrit/120503
Fuzzing: Add fuzzer for deactivate usageentry API

http://go/wvgerrit/120463
Fuzzing: Add logic to exit fuzzer script

http://go/wvgerrit/120444
Fuzzing: Add fuzzer for loadusageentry API

Bug: 183154879
Bug: 202994773
Bug: 186785830
Test: test only code
Change-Id: I877681461824c51bc82f0766a9973378aafadba7
2021-10-15 04:15:57 +00:00
Fred Gylys-Colwell
882d3ed075 Added an oemcrypto test for OPK versioning
Merge from Widevine repo of http://go/wvgerrit/125645

bug: 158857733
test: opk_linux_ipc_ta
Change-Id: Ibcbb143fa0eb7d2b4e14e3cc9afbe3a219c7c727
2021-10-14 17:50:14 +00:00
Fred Gylys-Colwell
d7b377f976 Add the OEMCrypto test RSA key in DER format
Merge from Widevine repo of http://go/wvgerrit/125744

The OEMCrypto tests use a fixed RSA key.  This will be loaded using
OEMCrypto_LoadTestRSAKey.  This adds that key in DER format. This key
was stored in the kTestRSAPKCS8PrivateKeyInfo2_2048 variable in the
code.

Bug: 202994773
Test: test only data
Change-Id: I372a45c48ddeff5149f3685640fa09ff569a696a
2021-10-14 17:50:14 +00:00
John W. Bruce
8609a28dac Remove unused variable
Merge from Widevine repo of http://go/wvgerrit/134728

This variable was written to, but the value was never read. Newer
compilers would complain about this. This patch removes the unused
variable.

Bug: 202400919
Change-Id: I87cae291d41b18db91a4c4f8a76edb537635db2c
2021-10-13 21:24:12 +00:00
Fred Gylys-Colwell
b63085ab5a Layered Clock interface
Merge from Widevine repo of http://go/wvgerrit/131306
which is a
Merge of non OPK files from http://go/wvgerrit/129344
and http://go/wvgerrit/129563. The OPK files are squash merged
in the CL http://go/wvgerrit/131303.

This splits the clock interface into two layers so that we can save
the previous value.

Bug: 158719238
Change-Id: I473966eb9b0766d27372682e8ebfbcb53f546980
2021-10-13 21:20:55 +00:00
John W. Bruce
44da436ce6 Remove non-ASCII curly quotes from OEMCryptoCENC.h
Merge from Widevine repo of http://go/wvgerrit/131305

The OPK tools are choking on non-ASCII characters when running on the
fuzz bots. This patch removes the problem characters from the header.
This brings these curly quotes in-line with the rest of the quotes in
the header.

Bug: 192275441
Change-Id: I9ba57abcd1275663601efc2a9170d7ab6aa4b4b8
2021-10-13 21:20:55 +00:00
Jeff Tinker
b082f3fb0b Implement serialization version checking
Merge from Widevine repo of http://go/wvgerrit/125263
and http://go/wvgerrit/135749

Define a |major.minor| version in the
serialization layer and check for compatibility
between REE and TEE before accepting connections.

bug: 158857733
test: opk_all_tests
Change-Id: Iad44a1f50a27c6bca4959c6d41c9b361712dbde8
2021-10-13 21:20:55 +00:00
John W. Bruce
895d391121 Migrate tests to googletest 1.10+ API
(This is a cherry-pick of http://go/wvgerrit/135227 and
http://go/wvgerrit/135246 from the Widevine repo.)

Googletest has deprecated the TEST_CASE nomenclature in favor of the
International Software Testing Qualifications Board-compliant term
TEST_SUITE. See
https://google.github.io/googletest/primer.html#beware-of-the-nomenclature
for more info.

Bug: 156766290
Test: build_and_run_all_unit_tests.sh
Change-Id: Ib94d534d17677601c4c160eb6b8d4e4e07df85c9
2021-10-11 17:05:48 -07:00
John W. Bruce
f2457565c0 Output BoringSSL errors in OEMCrypto test to stderr
(This is a merge of http://go/wvgerrit/135033 from the Widevine repo.)

Previously, errors from BoringSSL in OEMCrypto were printed to stdout.
This patch moves them to stderr.

Bug: 202752544
Test: OEMCrypto unit tests
Change-Id: Ifad3e4db40e796e0320863e5a58882822e657a31
2021-10-11 12:23:52 -07:00
TreeHugger Robot
6be8cc6b12 Merge changes I2887c18f,I8ea5d0fd
* changes:
  Use size_t for length in wvcrc32
  Update OEM Certificate scripts for Python 3
2021-10-06 21:54:13 +00:00
TreeHugger Robot
fdea46d325 Merge "Fix -Wshorten-64-to-32 errors in BoringSSL interactions" 2021-10-06 21:54:09 +00:00
John W. Bruce
bbb023db26 Use size_t for length in wvcrc32
(This is a merge of http://go/wvgerrit/134311.)

This patch widens the variable type used for lengths in wvcrc32 from
int to size_t. This fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits.

Bug: 194971260
Test: x86-64
Change-Id: I2887c18ff2a2c6dd3d65f966d9d1203fb050f736
2021-10-04 17:23:38 -07:00
Alex Dale
9f2364cefd Formatted OTA keybox function comments.
The API comments for the two new OTA keybox OEMCrypto functions
required formatting to be compatible with the doxygen comment
strings.

Bug: 190505461
Test: Android unit tests and GTS
Change-Id: Ia45dc9d727a2a904170912193709cd9416b8fe27
2021-10-01 15:01:13 -07:00
Fred Gylys-Colwell
7397f77343 Updates to OTA Keybox Reprovisioning
[ Cherry pick of http://ag/15847758 ]

Adjust OTA code to account for some design changes and
add integration tests.

Merge from Widevine repo of http://go/wvgerrit/133775
Change use_test_key to uint32_t type

Merge from Widevine repo of http://go/wvgerrit/133774
Cleanup CDM OKP info before tests.

Merge from Widevine repo of http://go/wvgerrit/133773
Change context for derivation in OTA keybox solution

Merge from Widevine repo of http://go/wvgerrit/133772
Updated OTA keybox key derivation.

Merge from Widevine repo of http://go/wvgerrit/133771
Use double provisioning step in integration tests

Merge from Widevine repo of http://go/wvgerrit/133770
Erase keybox on initialization for OEMCrypto testbed

Merge from Widevine repo of http://go/wvgerrit/133769
Add session id to OEMCrypto OTA functions

Merge from Widevine repo of http://go/wvgerrit/133768
Integration test for OTA Keybox reprovisioning

Merge from Widevine repo of http://go/wvgerrit/133767
Add test x509 cert for testing

Merge from Widevine repo of http://go/wvgerrit/133766
OTA Keybox basic functionality in testbed

Merge from Widevine repo of http://go/wvgerrit/133765
Update OTA test script to use newer build scripts

Merge from Widevine repo of http://go/wvgerrit/133764
Adjust comment stype for doxygen

Test: MediaDrmTest and Android unittests

Bug: 190505461
Bug: 190505461
Bug: 190505461
bug: 187646550
Bug: 187646550
Bug: 187646550
Bug: 187646550
Bug: 190505461
Bug: 187646550
Bug: 188228998
Bug: 190505461
Bug: 187646550
Change-Id: I41ff819a1fd8aca2e20adb25127fa0d9c4879b01
2021-10-01 15:00:33 -07:00
Fred Gylys-Colwell
bac33dbc6e Use local provisioning server
Merge from Widevine repo of http://go/wvgerrit/133703 and
http://ag/14707867

[ Cherry-pick of http://ag/15835345 ]

In order to use a local provisioning server, we need to use a
different test keybox system id that is in the dev device database
instead of the production database. We also need to use a local
license server that uses the dev license server.

Bug: 187646550
Test: GtsMediaTestCases

Change-Id: Ice89143dd26de22757375a770c6bac716fcbc057

Add Keybox OTA Provisioning functions to OEMCrypto header

Merge from Widevine repo of http://go/wvgerrit/133704 and
http://go/ag/14707868

Bug: 188228998
Change-Id: Iff54bc2870e87bf7239e179e1d02fbcc8df6198f

Stub build changes to support OTA Keybox

Merge from Widevine repo of http://go/wvgerrit/133725 and
http://go/ag/14781459

This CL adds a new unit test file for testing OTA keybox
reprovisioning functionality. This new test is built when running the
dynamic adapter in the linux build, and in the Android build.

Bug: 187646550
Change-Id: I625513840188f95e74831ef2ea399e827e837439

Add OTA Keybox functions to dynamic adapter

Merge from Widevine repo of http://go/wvgerrit/125843
and http://go/ag/14781460

Bug: 187646550
Change-Id: Ief78ed10599c091690e0d7dc488ea71674c763b5

Refactor dynamic adapter keybox verification

Merge from Widevine repo of http://go/wvgerrit/133727
http://go/ag/14812524

The keybox validation needs to be done separately from initializing
the library so that we can support Keybox OTA Reprovisioning.

If L1 loads, but the keybox is missing, the initialization should
succeed. When the keybox is validated, the adapter should try to look
for a keybox on the filesystem. if none is found, it should either
return NEEDS PROVISIONING or an error.

Bug: 187646550
Change-Id: I34a8c365a5a5ca35c379bea827c85c749964744c

Update crypto session to use new OTA keybox functionality

Merge from Widevine repo of http://go/wvgerrit/133728 and
http://go/ag/14812525

This CL stubs out two new CryptoSession functions that call the new
OEMCrypto functions for OTA Keybox Provisioning. It builds!  Yay!

It also adds a boolean needs_keybox_provisioning that is set to true
when OEMCrypto reports that it needs a keybox. This should only happen
if there is no keybox installed and oemcrypto supports provisioning.

Bug: 187646550
Change-Id: Ide9533943125aa13b8899b652b118a0b410c882c
2021-09-29 14:00:36 -07:00
John W. Bruce
68187b9f02 Fix -Wshorten-64-to-32 errors in BoringSSL interactions
(This is a merge from the Widevine Repo of http://go/wvgerrit/134310.)

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. The cause of most
of these is that OpenSSL uses "int" for the length of things rather than
size_t. (While BoringSSL sometimes uses int and sometimes uses size_t.)

One exception is LogBoringSSLError(). We have a couple copies of this
function around, and they varied slightly. This patch brings them all
in-line, which conveniently also removes any code in them that would
deal with integer variables.

GetRandBytes() now takes a size_t and downcasts to BoringSSL's native
int internally, so that callers can pass in a size_t value as they would
expect.

There's also an interesting case in oec_session_util.cpp. Because
BoringSSL and OpenSSL disagree about the width of an error code, we have
to use the "auto" type for a temporary variable that holds an error, in
order to retain compatibility with both.

Bug: 194971260
Test: x86-64
Test: x86-64-openssl
Change-Id: I88bc62b4cda396f8a1eabd1a3cb7d1b03f47a33f
2021-09-27 18:17:04 -07:00
Vicky Min
ae211a02dd Add curly braces in oemcrypto_test.cpp
On the gcc 9.3 compiler, oemcrypto/test/oemcrypto_test.cpp will not
compile without curly braces in some places so we must add them to
these 4 tests.

Test: OEMCryptoLoadsCertificateAlternates tests and CheckUsageTableSizeAPI16
Bug: 200057124
Change-Id: Ia097ba992a024adfd3311b82b812de60985a0de1
2021-09-15 22:03:43 +00:00
TreeHugger Robot
a1dd61ba6d Merge "Add extra RSA private keys to unit tests" into sc-dev am: 853ab51cb3
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15136762

Change-Id: I6bf6290d1c8605536d47d502171fef3d790edd18
2021-07-01 04:42:45 +00:00
TreeHugger Robot
62b27c1b9c Merge "Add extra RSA private keys to unit tests" into sc-dev am: 853ab51cb3 am: 85f91e021a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15136762

Change-Id: Icbd32dfdcb2178f2b0dc86ebb814c88a3c3239fe
2021-06-30 21:43:31 +00:00
TreeHugger Robot
853ab51cb3 Merge "Add extra RSA private keys to unit tests" into sc-dev 2021-06-30 21:32:01 +00:00
TreeHugger Robot
6d1898f20f Merge "Sync oemcrypto reference code" into sc-dev 2021-06-30 21:20:58 +00:00
TreeHugger Robot
af0ac69fad Merge "Update OEMCrypto buffer offset tests" into sc-dev am: 41d7b74558 am: ae3815c1fa
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15055162

Change-Id: I2baacf116ca77a092953532ee6997cb55a9890ed
2021-06-30 21:11:21 +00:00
TreeHugger Robot
88c6500ba2 Merge "Update OEMCrypto buffer offset tests" into sc-dev am: 41d7b74558
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/15055162

Change-Id: I7f3f64bec9748f6045cc33b67b9f8c7dbe0ded15
2021-06-30 21:02:07 +00:00
Fred Gylys-Colwell
2d9bdfea58 Update OEMCrypto buffer offset tests
Merge from Widevine repo of http://go/wvgerrit/127524

Some unit tests used the response buffer size before the size had been
computed. This CL updates the tests.

Bug: 183440999
Bug: 184866351
Test: Ran unit tests on Prov 3.0 device.
Change-Id: I0b23dc7b0dafa9b9eab3cdbd7f29074898e4709b
2021-06-30 17:46:18 +00:00
Fred Gylys-Colwell
052016eb57 Add extra RSA private keys to unit tests
Merge from Widevine repo of http://go/wvgerrit/128047

There have been some failures with various RSA private keys. We add
them to the unit tests to make sure that OEMCrypto is able to load
these types of keys:
* Shorter: than normal private exponents. This seems to occur
  occasionally even with Euler totients. But it occurs more with
  Carmichael totients.
* 0-leading-byte: private exponents. This also occurs naturally for
  both Euler and Carmichael totients.
* Carmichael: vs Euler totients. I think we may already have tests for
  this. But just in case.

Bug: 190450051
Test: ran unit tests on bonito (and they passed!)
Change-Id: Id64ec738479eb8a0f77e253bace319cebe918d3f
2021-06-29 16:47:20 +00:00
Fred Gylys-Colwell
42188c007a Remove OEMCrypto reference
Merge from Widevine repo of http://go/wvgerrit/125203

The OEMCrypto reference is not used/built on Android.  It was being
published to aid OEMs in their development, but now the OPK library
is the implementation to be used by OEMs.

Bug: 187556088
Bug: 184866351
Test: Ran android/copy_files
Change-Id: Ie787bcf9c66a7605700c3dc29a8aa16406926ce3
2021-06-29 15:51:12 +00:00
Fred Gylys-Colwell
830a7acc48 Sync oemcrypto reference code
This is a merge from the Widevine repo of
http://go/wvgerrit/117311
Update backwards compatibility builds

http://go/wvgerrit/117423
Restrict maximum size of key id
To protect from out-of-memory found by fuzz testing.

http://go/wvgerrit/117683
Generation number should wrap

The master generation number should wrap around on overflow. This
means that we cannot use less than to check for a skew of 1.

http://go/wvgerrit/119232
Replace 0 with nullptr

Bug: 176234903
Bug: 184866351
Bug: 161243686
Test: ran unit tests (CL affects test code only)
Merged-In: Ie787bcf9c66a7605700c3dc29a8aa16406926ce3
Change-Id: I2b02a36a70a0920f31ffc00de102a23516d4b20e
2021-06-24 03:38:55 +00:00
Alex Dale
ad0d66c7e6 [DO NOT MERGE] Revert "Restructed reference root of trust (1/3 Keybox)"
This reverts commit e4ee4eb404.

Reason for revert: Feature missed deadline

Bug: 135283522
Change-Id: I4ee2caac2dadfcc3e145b9c9b977d216d4edd929
2021-06-02 20:00:16 +00:00