Commit Graph

76 Commits

Author SHA1 Message Date
Ronish Kalia
d0f454d91c [DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I204c137da43a021bcebe316759d1aadaec99fe2a
2024-02-14 14:19:08 +00:00
Jacob Trimble
91c7a8cffe Misc Fixes
- Code protection fixes for v18
- Fix MSVC error with static_assert
- Fix RSA with Cobalt
- Workaround SCP errors with string concatenation
    - Use snprintf instead

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

Change-Id: If2e9ee3403e313fd8c7dffccca6f8d3f7b0b0afb
2024-01-30 16:09:41 -08:00
Vicky Min
e123e25a9e Add comments referencing both places that need to be updated with new minor version releases.
PiperOrigin-RevId: 552584184
Change-Id: I3eaba4e9b4cf83e70c5dfc2edcfbbeace789d49a
(cherry picked from commit 589feafd7b572319ddbae97eb1778d760a739dd3)
2024-01-29 12:40:18 -08:00
Cong Lin
7277331f92 Update ODK version to 18.4 and unit tests
Test: odk tests, opk_ta, fake_l1_tests
Bug: 294440012
Merged from https://widevine-internal-review.googlesource.com/181150

Change-Id: Ia33962f9d244333b1ca17c9a64efc29de35db093
2024-01-29 12:40:11 -08:00
Fred Gylys-Colwell
10d9bc272f Mark some ODK types as undocumented, and document others
Bug: 293188660
PiperOrigin-RevId: 551019650
Merged from https://widevine-internal-review.googlesource.com/180470

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

Change-Id: I28aa1d82437128ac2862cf0d6de325644e4af067
2024-01-29 12:39:48 -08:00
Vicky Min
e765453b35 Update ODK minor version to match when major version is updated
PiperOrigin-RevId: 551930047
Merged from https://widevine-internal-review.googlesource.com/180430
(cherry picked from commit d85aa8107dbe292490f9897b1e76f72bc0144bff)

Change-Id: If973113886a19cb720ad635e68830b9afbcf22b5
2024-01-29 12:39:48 -08:00
Fred Gylys-Colwell
06ad24bce0 Update ODK and test version to 18.3
PiperOrigin-RevId: 546349606

Merged from
https://widevine-internal-review.googlesource.com/178000
and
https://widevine-internal-review.googlesource.com/178061

Bug: 290252863
Change-Id: I0d6d9a0214d556ae39efe8a720df8ac60c1e67fb
2024-01-29 12:39:46 -08:00
Fred Gylys-Colwell
84e27c660d Initialize renewal request time
The `time_of_renewal_request` field in the clock_values struct was not being initialized. With this CL, we use a value of 0 to indicate a renewal has not been requested yet.

We also modify the check in `ODK_ParseRenewal` to use a value of 0 for the `time_of_renewal_request` to skip the check for a stale renewal. This is done because now that a "renew on license load" license starts the playback clock immediately, we need a different way to decide if a renewal from a previous session can be loaded.

PiperOrigin-RevId: 546129556
Merged from https://widevine-internal-review.googlesource.com/177998

Change-Id: I17282cf918d0cdb4d9b5108a41914ecd7d87cc8f
2024-01-29 12:31:37 -08:00
Fred Gylys-Colwell
d0752047fc Document b/290249855 in ODK
PiperOrigin-RevId: 546118816
Merged from https://widevine-internal-review.googlesource.com/177992

Change-Id: I6ab0b599a2d858f9451a5fbd3e3612275b729ee6
2024-01-29 12:31:36 -08:00
Vicky Min
414e928238 Remove version check in ODK_InitializeSessionValues
It seems ODK_InitializeSessionValues is only used in initializing the session in OEMCrypto, so we can remove this check.

PiperOrigin-RevId: 545729842
Merged from https://widevine-internal-review.googlesource.com/169914

Change-Id: Idcc58166f64116214540591dc71a774f3ce3f3d1
2024-01-29 12:31:36 -08:00
Alex Dale
48b1aed404 Set min_sdk_version for the Widevine APEX on ODK
This change brings the odk/Android.bp in sync with the Android repo.  Change was originally made in ag/22120778

PiperOrigin-RevId: 540398693
Merged from https://widevine-internal-review.googlesource.com/177000

Change-Id: Id3bf7193da8de3b9942da052c32065f031102d9b
2024-01-29 12:31:03 -08:00
Vicky Min
ff80927f90 Allow server to send license with larger ODK_MAX_NUM_KEYS
PiperOrigin-RevId: 538676411
Merged from https://widevine-internal-review.googlesource.com/175915

Change-Id: Iadef2115fe3f9001034223e647cbfa6228484281
2024-01-29 12:31:03 -08:00
Fred Gylys-Colwell
57e997fe19 Add golden test data for ODK
This data was generated using the code in CLs go/wvgerrit/163726 (for v16),
go/wvgerrit/171730 (for v17), and go/wvgerrit/171750 (for v18).

PiperOrigin-RevId: 535679470
Change-Id: Ib644bbed7e7329dfea30ce25d325fd0556fdb7a7
2024-01-29 12:30:15 -08:00
John Bruce
db670e7bcc Add tests for ODK overflow functions
Merged from http://go/wvgerrit/175855

This includes testing overflow functions that are only used in the Widevine client repository.

This patch also includes the following fix for the previous commit:

Add type casting for ODK overflow function unit tests

Merged from http://go/wvgerrit/175893

The new ODK overflow unit tests are causing some unit test failures in oemcrypto-v18 due to mismatched type comparisons.

PiperOrigin-RevId: 535308670
PiperOrigin-RevId: 534890798
Change-Id: I8bb67e47193a92191a91c83bf8a0de61e1b87793
2024-01-29 11:51:41 -08:00
Vicky Min
8f6dbdb94e Set rental clock if not already set in ODK_ParseLicense
PiperOrigin-RevId: 535020833
Merged from https://widevine-internal-review.googlesource.com/175851

Change-Id: Idc5e2123e56346b9d7c036683c184057f49ea58a
2024-01-29 11:51:41 -08:00
Vicky Min
d5afa3fd99 Cleanup design of ODK_ParsedLicense handling and maintain backwards compatibility
PiperOrigin-RevId: 529531139
Merged from https://widevine-internal-review.googlesource.com/172870

Change-Id: Id07dc82a8c2729cdbf10a9c8680ed979f8de51b5
2024-01-29 11:51:41 -08:00
Vicky Min
6c953ab651 Fix license response default values error in CreateCoreLicenseResponse
PiperOrigin-RevId: 529588784
Merged from https://widevine-internal-review.googlesource.com/174260

# Conflicts:
#	oemcrypto/odk/include/odk_structs.h

Change-Id: I96f348bfc9b5be7113ddb2af18a38c36d337697c
2024-01-29 11:51:41 -08:00
Vicky Min
f71014507d Set renewal_delay_base in function CreateCoreLicenseResponseFromProto
PiperOrigin-RevId: 525261485
Merged from https://widevine-internal-review.googlesource.com/170810

Change-Id: I96f16639a728db9b6922d3f23e0212fa2902602e
2024-01-29 11:51:41 -08:00
Vicky Min
152f2144f9 Fix ODK warning errors for WV DRM
PiperOrigin-RevId: 525266553
Merged from https://widevine-internal-review.googlesource.com/169640

Change-Id: Id92dac068a2b2f767287641170f7b522f54588e4
2024-01-29 11:51:41 -08:00
Fred Gylys-Colwell
ae0134b21d Make the server send ODK v18 messages by default
The core message had been throttled to only generate v17 messages because we wanted to stabilize the format before making the code live.

PiperOrigin-RevId: 524309559
Merged from https://widevine-internal-review.googlesource.com/170311

Change-Id: I2d09c9f6c73f844fd509531e86285ad71d22690f
2024-01-29 11:51:41 -08:00
Googler
89666aeb89 Fix issues identified by clang-tidy
- Replace assert with odk_static_assert for checks that can be handled
  at compile time.
- Use explicit bool conversion with memcmp.

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

PiperOrigin-RevId: 524277743
Change-Id: I8b32e886e780e80406afceea562be2033d75d340
2024-01-29 11:51:41 -08:00
Matt Feddersen
a2a27c44ef Correctly parse v18.0 provisioning requests
The previous code fixed a backwards compatibility error for v18 provisioning requests being parsed by a v17 or older server. This bumped the minor version number to v18.1. v17 servers are still expected to fail when trying to parse v18.0 provisioning requests, and v18.1 requests will pass.

However, it did not correctly account for existing v18.0 requests on v18.1+ servers. v18.0 messages were naively detected by a failure to parse, and the parse function was not run again. This left the resulting nonce and session_id values uninitialized.

This CL fixes that by explicitly handling the v18.0 and v18.1+ cases, ensuring that the parse function succeeds and all relevant information is copied over. Furthermore, the unit test that was meant to catch this edge case has been improved to validate the resulting parsed message.

All code changes affect the server. This does not affect the client code eg OEMCrypto

PiperOrigin-RevId: 523714529
Merged from https://widevine-internal-review.googlesource.com/170110

Change-Id: I21911c4bb4304de2d93f092f356402bbd4240874
2024-01-29 11:20:20 -08:00
Vicky Min
c6e7c70a6b Remove reference to OEMCrypto_LoadKeys() in ODK code
PiperOrigin-RevId: 522089097
Merged from https://widevine-internal-review.googlesource.com/168481

Change-Id: I59927c7f5aba52523aeba78c130f4b148d1c363f
2024-01-29 11:20:11 -08:00
Fred Gylys-Colwell
231ff3735c Backport http://go/ag/21276850
Changes to the Android build files.

PiperOrigin-RevId: 512200169
Merged from https://widevine-internal-review.googlesource.com/166925

Change-Id: If6247499693013099d705dd22a123c36a76e0404
2024-01-29 11:06:45 -08:00
Robert Shih
d81cdbae42 Update Widevine apex min_sdk_version to 34
Bug: 287567070
Bug: 294568360
Test: v2/widevine-eng/drm_compliance_apex
Change-Id: Iad45bf7a66ff0217724376aa8648ecd613af32c1
2023-08-28 12:30:36 -07:00
Jooyung Han
a4de7eb9b5 Set min_sdk_version for the Widevine APEX
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
2023-03-28 06:57:46 +00:00
Cong Lin
e8add8eed8 Sync oemcrypto files from cdm udc-dev to Android
Changes included in this CL:

166806: Update OEMCrypto_GetDeviceInformation() | https://widevine-internal-review.googlesource.com/c/cdm/+/166806
166808: Update Android L3 after OEMCrypto_GetDeviceInformation() signature changes | https://widevine-internal-review.googlesource.com/c/cdm/+/166808
166809: Decode device info and write it to CSR payload | https://widevine-internal-review.googlesource.com/c/cdm/+/166809
167158: Fix Android include path and copy_files | https://widevine-internal-review.googlesource.com/c/cdm/+/167158
167159: Fix common typos and use inclusive language suggested by Android linter | https://widevine-internal-review.googlesource.com/c/cdm/+/167159

165618: Explicitly state python3 where needed. | https://widevine-internal-review.googlesource.com/c/cdm/+/165618

166757: Update Android.bp for Android | https://widevine-internal-review.googlesource.com/c/cdm/+/166757
164993: Refactor basic oemcrypto unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/164993
164978: Update OEMCrypto Unit Test Docs | https://widevine-internal-review.googlesource.com/c/cdm/+/164978
166941: Update make files for OEMCrypto | https://widevine-internal-review.googlesource.com/c/cdm/+/166941

165279: Refactor license unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/165279
165318: Refactor provisioning unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/165318
164800: Add extra check for renew on license load unit test | https://widevine-internal-review.googlesource.com/c/cdm/+/164800
165860: Remove duplicate definition of MaybeHex() | https://widevine-internal-review.googlesource.com/c/cdm/+/165860

164889: Updated CoreCommonRequestFromMessage and fix test | https://widevine-internal-review.googlesource.com/c/cdm/+/164889
164967: Add OPK pre-hook and post-hook error codes | https://widevine-internal-review.googlesource.com/c/cdm/+/164967
165140: Add hidden device_id_length to v18 provisioning message | https://widevine-internal-review.googlesource.com/c/cdm/+/165140
165204: Fix memory leak in oemcrypto test | https://widevine-internal-review.googlesource.com/c/cdm/+/165204

165958: Fix oemcrypto_generic_verify_fuzz mutator signature offset | https://widevine-internal-review.googlesource.com/c/cdm/+/165958

166037: Support SHA-256 in OEMCrypto Session Util | https://widevine-internal-review.googlesource.com/c/cdm/+/166037

Test: Run GtsMediaTests on Pixel 7
Bug: 270612144

Change-Id: Iff0820a2de7d043a820470a130af65b0dcadb759
2023-02-28 11:21:05 -08:00
Bob Badour
080bfc7414 Merge "Cleanup vendor projects are proprietary." into tm-qpr-dev-plus-aosp am: cbb6177df2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/21276850

Change-Id: I7ba871f7714ba4eb5dcb5b0571b6024533a25217
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-05 03:54:39 +00:00
Bob Badour
6f047790e0 Cleanup vendor projects are proprietary.
Test: m droid dist
Change-Id: I0bdec38c4d12710fa97b91665d211ba6c0d4b24d
2023-02-03 14:37:11 -08:00
Kyle Zhang
11255b7426 Pick widevine oemcrypto-v18 change
No-Typo-Check: From a third party header file
Bug: 260918793
Test: unit tests
Test: atp v2/widevine-eng/drm_compliance
Change-Id: I36effd6a10a99bdb2399ab1f4a0fad026d607c70
2022-12-21 00:03:50 +00:00
Vicky Min
8c71d5acd0 [DO NOT MERGE] 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
(cherry picked from commit eb711ea0ec)
2022-11-21 22:58:29 +00:00
Kyle Zhang
af0168dbed Merge cdm changes to android repo
Bug: 251924225
Test: GtsMediaTestCases
Change-Id: I1b4e64c0abf701fe1f5017f14dc72b72c3ea6770
2022-10-11 00:40:42 +00:00
Alex Dale
2999e4588e Fix 31 ClangTidyBuild findings:
[ Merge of http://go/wvgerrit/151597 ]

* missing #include <string> for 'std::string' For more info see go/clang_tidy/checks/google3-build-missing-std-includes (25 times)
* missing #include <utility> for 'std::move' For more info see go/clang_tidy/checks/google3-build-missing-std-includes (3 times)
* missing #include <algorithm> for 'std::find_if' For more info see go/clang_tidy/checks/google3-build-missing-std-includes (2 times)
* missing #include <algorithm> for 'std::sort' 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 there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* 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.

Bug: 236317198
Change-Id: I28f7899b5cf0637be15833659f8ba0dd6ff3ab90
2022-07-20 14:47:43 -07:00
Alex Dale
4c36fb469b Fix 2 ClangTidyBuild findings:
[ Merge of http://go/wvgerrit/150489 ]

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

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 there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* 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.

Bug: 236317198
Change-Id: I9ccf0ce00ee3f6f7b3a2b6ec9dedeff578535217
2022-07-20 14:47:43 -07:00
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
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
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
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
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
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
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
TreeHugger Robot
9d84d5deba Merge "Migrate tests to googletest 1.10+ API" 2021-10-16 00:20:40 +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
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
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
Fred Gylys-Colwell
a87eec804c Fix unused param warnings in oemcrypto fuzz test
Merge from Widevine repo of http://go/wvgerrit/122403

Re-merge of http://go/wvgerrit/105184 which was accidentally
undone by http://go/wvgerrit/107063.

Unused params are reported as warning when built in Android.

Test: Ran oemcrypto unit tests
Bug: 160734070
Change-Id: Id8384c58c8ace0b214464380fb961d108f1b5c3b
2021-04-23 10:11:48 -07:00
Fred Gylys-Colwell
14a034209c Turn on ODK tests in CE CDM test and fix test helper
Merge from Widevine repo of http://go/wvgerrit/122223

This adds the ODK unit tests to the CE CDM tests so that they run as
part of the presubmit tests.

The test helper had some pointer problems converting a bool to a
uint32, so it has been updated to handle this correctly.

Some other tests failed comparing signed to unsigned, to these have
also been fixed.

test: ran odk_test
bug: 118657876
Change-Id: I744a1e89f4e4729c31d3f53e729984ffac1d96fd
2021-04-23 10:11:48 -07:00