Commit Graph

5987 Commits

Author SHA1 Message Date
TreeHugger Robot
2046fc05fa Merge "Fix -Wshorten-64-to-32 error in metrics code" 2021-10-29 18:09:45 +00:00
TreeHugger Robot
1745fbd903 Merge "Make implicit 64-to-32-bit conversions in core_message_serialize.cpp explicit" 2021-10-29 18:09:25 +00:00
TreeHugger Robot
5cdaeab03e Merge "ODK: Fix a few implict type conversion issues" 2021-10-29 18:08:25 +00:00
Alex Dale
dd0b840b91 Clear OTA keybox flag. am: f5e4c94e26 am: 544299db8b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16094844

Change-Id: I14e4a4f7df36f2c7d2f00e31423250bff370ff30
2021-10-28 17:18:21 +00:00
Alex Dale
5c387ed836 Added debugOtaKeyboxFallbackDuration property. am: 8b12e5acc9 am: 90f7296a4e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16096276

Change-Id: I1e2103a2a3dcfa513be3e6803ebc7b786f846ee2
2021-10-28 17:18:21 +00:00
Alex Dale
08e7383ad4 Update fallback policy for fast fallback. am: 28b45c4f1b am: 596363ef9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16096533

Change-Id: Ifd8e70f097345d9d17f2c96e7bdd0415fea62ca5
2021-10-28 17:18:20 +00:00
Fred Gylys-Colwell
ec631db9a0 [automerger skipped] Update OTA Keybox tests am: eb846100d4 am: cc67284f44 -s ours
am skip reason: Merged-In I48a3771bf5fd4aae8d262b8c7bf42f004d9b9f4c with SHA-1 d92c9b9bd2 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058124

Change-Id: I1403023307204ace0d23fed47b4602c02572b629
2021-10-28 17:18:19 +00:00
Fred Gylys-Colwell
008aa7f4d7 Correct build error in non-hidl WVDrmPlugin am: 80463a0eea am: 017e6dabce
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058123

Change-Id: Ifa4843400a50dd90d5750d1bcd7ec376c7d1bd61
2021-10-28 17:18:19 +00:00
Fred Gylys-Colwell
56fbf9e681 [automerger skipped] Use MediaDrm property to ignore installed keybox am: c21b756451 am: 220f1e750e -s ours
am skip reason: Merged-In Ie7d34a8b355398855f4ec43dd95dd73c5907bdeb with SHA-1 938bc7bbad is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058122

Change-Id: I55f5c002d2f84e8c732eb14bd60d1847d3a6f4ba
2021-10-28 17:18:18 +00:00
Alex Dale
c996df5742 [automerger skipped] Formatted OTA keybox function comments. am: 5975b4e70a am: deb174cef5 -s ours
am skip reason: Merged-In Ia45dc9d727a2a904170912193709cd9416b8fe27 with SHA-1 9f2364cefd is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058121

Change-Id: I455cb3404ba5faf1bb5f5677f7730266ba881c43
2021-10-28 17:18:17 +00:00
Rahul Frias
4ca4bcbc52 [automerger skipped] Assume Keybox provisioning type if OTA Keybox is supported. am: 581aa1702b am: 2243801d83 -s ours
am skip reason: Merged-In Ie7753546e53fc73fd59803958e88edf416ee5336 with SHA-1 e13c051129 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058120

Change-Id: I995aa8606be5e0e1e9ad9ea4079ae8e005ba198e
2021-10-28 17:18:17 +00:00
Fred Gylys-Colwell
28bf1d2a11 [automerger skipped] Updates to OTA Keybox Reprovisioning am: a3166eb2ba am: f114219345 -s ours
am skip reason: Merged-In I41ff819a1fd8aca2e20adb25127fa0d9c4879b01 with SHA-1 7397f77343 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058119

Change-Id: I2f7f72752d2a7cff2649be738adc0c0cec112033
2021-10-28 17:18:16 +00:00
Rahul Frias
bd521b31a3 [automerger skipped] Wrapped OKP info into several classes. am: 39558526f6 am: f19130a23c -s ours
am skip reason: Merged-In Ia572a66a7b73479355758aa3d0c682691eaca0fc with SHA-1 6afcbab5cf is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058118

Change-Id: I8695502f560bd989b0e18d552472ed7cd982743d
2021-10-28 17:18:15 +00:00
Rahul Frias
1b27e70f9c [automerger skipped] Added an OTA keybox provisioner. am: 52bd1d206e am: 54fc6edf0d -s ours
am skip reason: Merged-In I6aafb4f2164efe69bc733ece0a912f0e91893b91 with SHA-1 3acc64a478 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058117

Change-Id: I9f1614e0fa4f5d8d4e599e6afadd02452bf2c10f
2021-10-28 17:18:15 +00:00
Fred Gylys-Colwell
eb84b1f763 [automerger skipped] Use local provisioning server am: 44ba42f5cc am: 556940237f -s ours
am skip reason: Merged-In Ide9533943125aa13b8899b652b118a0b410c882c with SHA-1 bac33dbc6e is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058116

Change-Id: I12d23b7b902ad8b47833dc6645aa67a0c2b7814d
2021-10-28 17:18:14 +00:00
Alex Dale
544299db8b Clear OTA keybox flag. am: f5e4c94e26
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16094844

Change-Id: Id8a110c13e2aed574ec1fd7641d4f0fc24ad382d
2021-10-28 17:02:17 +00:00
Alex Dale
90f7296a4e Added debugOtaKeyboxFallbackDuration property. am: 8b12e5acc9
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16096276

Change-Id: Id74a39aabd42272673de9bbd3efa672c0c609015
2021-10-28 17:02:16 +00:00
Alex Dale
596363ef9e Update fallback policy for fast fallback. am: 28b45c4f1b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16096533

Change-Id: Ibf2e7e04c28251bf0918db98093d0a6a5191628e
2021-10-28 17:02:16 +00:00
Fred Gylys-Colwell
cc67284f44 Update OTA Keybox tests am: eb846100d4
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058124

Change-Id: I9000ab12e582e2b1ec8992b70ab6a9c883f1a836
2021-10-28 17:02:15 +00:00
Fred Gylys-Colwell
017e6dabce Correct build error in non-hidl WVDrmPlugin am: 80463a0eea
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058123

Change-Id: Ibfba7d0ec38fb2ddc9b46b4821f34b9c28f9c9f3
2021-10-28 17:02:15 +00:00
Fred Gylys-Colwell
220f1e750e Use MediaDrm property to ignore installed keybox am: c21b756451
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058122

Change-Id: Icc1025c0e78ffbc677f17621ad028f27cd565bf0
2021-10-28 17:02:15 +00:00
Alex Dale
deb174cef5 Formatted OTA keybox function comments. am: 5975b4e70a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058121

Change-Id: I4ac7640a58bbb4f3add632759a7b5c59a2c7f3fc
2021-10-28 17:02:14 +00:00
Rahul Frias
2243801d83 Assume Keybox provisioning type if OTA Keybox is supported. am: 581aa1702b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058120

Change-Id: I03925f8ffec8ebb690d49db04d637e2f8f2fb15f
2021-10-28 17:02:13 +00:00
Fred Gylys-Colwell
f114219345 Updates to OTA Keybox Reprovisioning am: a3166eb2ba
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058119

Change-Id: I1eccae55a858fc634b0ee53f79bfda0cbdda134b
2021-10-28 17:02:12 +00:00
Rahul Frias
f19130a23c Wrapped OKP info into several classes. am: 39558526f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058118

Change-Id: I77e2e5023bca6f9b1ff1279d517534e58693b2a2
2021-10-28 17:02:11 +00:00
Rahul Frias
54fc6edf0d Added an OTA keybox provisioner. am: 52bd1d206e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058117

Change-Id: I2f177ef33d62cadd271262df56c76eed386bb22d
2021-10-28 17:02:11 +00:00
Fred Gylys-Colwell
556940237f Use local provisioning server am: 44ba42f5cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16058116

Change-Id: Ib10701963fc4ba89d37f49b95186640244576305
2021-10-28 17:02:10 +00:00
John W. Bruce
ba452b3f91 Fix -Wshorten-64-to-32 error in metrics code
(This is a merge of http://go/wvgerrit/134314.)

This patch fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits. The caclulation is
now done at size_t resolution instead of downcasting to 32 bits.

Bug: 194971260
Test: x86-64 tests
Change-Id: I2fd0a3a3ec67f697d58d1ba00dba66452603c753
2021-10-27 12:43:23 -07: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
Kyle Zhang
7c1e8f384f Add code review OWNERS
Bug: 158761377
Test: refactoring CL. Existing unit tests still pass.
Change-Id: I9b91d16e92679e76d57cfc332342eaa7e6989907
2021-10-27 05:05:43 +00: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
John W. Bruce
921cc2c4a3 Fix -Wshorten-64-to-32 errors in string conversion code
(This is a merge of http://go/wvgerrit/134313.)

This patch fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits. There were two cases
of this in string_conversions.cpp:

* The implicit conversions in DecodeBase64Char() were made explicit,
  which required going through both a reinterpret_cast and a static_cast
  to express fully.

* a2b_hex() now uses size_t for the length, as it probably always should
  have.

Bug: 194971260
Test: x86-64 tests
Change-Id: Ib9715b8adecc104f1a056ab0ac5faa5be74e5e54
2021-10-21 20:04:59 +00:00
Alex Dale
f5e4c94e26 Clear OTA keybox flag.
[ Cherry-pick of http://ag/16087795 ]
[ Merge of http://go/wvgerrit/136432 ]

Once OTA keybox succeeds, the |needs_keybox_provisioning_| flag is
cleared.  Access to the system fallback policy is allowed after
provisioning to check status.

Bug: 203177668
Test: ExoPlayer test
Change-Id: I2d28c896c554cfbc9b008340bb415d4c7fac62f2
(cherry picked from commit cac2dcaa6c)
2021-10-20 18:22:06 -07:00
Alex Dale
8b12e5acc9 Added debugOtaKeyboxFallbackDuration property.
[ Cherry-pick of http://ag/16064434 ]
[ Merge of http://go/wvgerrit/136330 ]

This changes adds a custom debug property for changing the fallback
policy used for the system.  Depending on the value set, the device
will either use a "fast" fallback (30 seconds) or "default" fallback
(~1 day with exponential backoff).  Setting this property to either
"fast" or "default" will end the current fallback if it has been
triggered.

Bug: 187646550
Test: Android unit tests
Change-Id: I5271f96139c1e468242f7fa742668cc791ffcf91
2021-10-20 17:54:03 -07:00
Alex Dale
28b45c4f1b Update fallback policy for fast fallback.
[ Cherry-pick of http://ag/16064433 ]
[ Merge of http://go/wvgerrit/136329 ]

CDM core has been updated to support very short fallback durations in
the case of failures during OTA keybox provisioning.  This is intended
to be used during testing via specialized developer apps or GTS tests.

Bug: 187646550
Test: Android unit tests
Change-Id: I8a75d2e1c404d6caed535b087e8dd29da5c21b83
2021-10-20 17:53:03 -07:00
Fred Gylys-Colwell
eb846100d4 Update OTA Keybox tests
Merge from Widevine repo of http://go/wvgerrit/135982

The basic test was failing when using the testbed oemcrypto
because the testbed deletes its keybox on each
initialization. The test would terminate and re-initialize
oemcrypto whenever all the crypto sessions are deleted. This
has been fixed by holding a crypto session alive until the
end of the test.

bug: 187646550
Test: test only code
Merged-In: I48a3771bf5fd4aae8d262b8c7bf42f004d9b9f4c
Change-Id: I48a3771bf5fd4aae8d262b8c7bf42f004d9b9f4c
2021-10-20 17:52:12 -07:00
Fred Gylys-Colwell
80463a0eea Correct build error in non-hidl WVDrmPlugin
This fix was missing in the last merge of http://go/wvgerrit/135063

Bug: 187646550
Merged-In: I2b2252f8335c36325fd76d92ac26b9fbfcff5362
Change-Id: I2b2252f8335c36325fd76d92ac26b9fbfcff5362
2021-10-20 17:51:50 -07:00
Fred Gylys-Colwell
c21b756451 Use MediaDrm property to ignore installed keybox
Merge from Widevine repo of http://go/wvgerrit/135984

If the MediaDrm property string debugIgnoreKeyboxCount is set to 1,
then the keybox will be ignored on the next initialization. This will
force an OTA keybox reprovisioning.

Equivalently, a 1 may be written to the file
L1/debug_ignore_keybox_count.txt.

In order to test a failed reprovisioning step, a value of 2 may be
used.

Bug: 187646550
Merged-In: Ie7d34a8b355398855f4ec43dd95dd73c5907bdeb
Change-Id: Ie7d34a8b355398855f4ec43dd95dd73c5907bdeb
2021-10-20 17:50:57 -07: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
Rahul Frias
581aa1702b Assume Keybox provisioning type if OTA Keybox is supported.
[ Merge of http://go/wvgerrit/133943 and http://go/wvgerrit/134043 ]

Certain OEMCrypto implementations will not report their provisioning
method if the keybox is invalid.  If the OEMCrypto implementation
supports OTA keybox provisioning and does not report its provisioning
method, then keybox provisioning is assumed.

Bug: 187646550
Test: unit/integration/GtsMediaTestCases
Merged-In: Ie7753546e53fc73fd59803958e88edf416ee5336
Change-Id: Ie7753546e53fc73fd59803958e88edf416ee5336
2021-10-20 17:50:37 -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
Rahul Frias
39558526f6 Wrapped OKP info into several classes.
[ Merge of http://go/wvgerrit/133744 ]

This changes adds several small classes which contain and manage
system and engine information related to OTA keybox provisioning.
These classes closely map to the OKP device file messages.

Bug: 189232882
Test: Linux unit tests
Change-Id: Ia9334c38f9d7ea89b30d9ad05f0595570bb38658

Storing and loading OKP info.

[ Merge of http://go/wvgerrit/133763 and http://go/ag/15645333 ]

This change extends the DeviceFiles module to be able to store and
load OKP info.  Mild data validation is performed when storing and
loading the information.

Bug: 189232882
Test: Android unit tests
Change-Id: I077de3234157252f2255a4389bf82a8d5344a355

System OKP fallback policy.

[ Merge of http://go/wvgerrit/133783 and http://go/ag/15645334 ]

SystemFallbackPolicy provides a thread-safe interface for accessing
and modifying OKP info.

Bug: 189232882
Test: Android unit tests
Change-Id: I4e43e3bc047ed5fb6cb517b53e4094e812b70e1e

Engine OKP provisioner.

[ Merge of http://go/wvgerrit/133803 and http://go/ag/15645335 ]

The OtaKeyboxProvisioner provides a CdmEngine-specific context for
performing OTA keybox provisioning.  Utilizes the system-wide
SystemFallbackPolicy to relay provisioning status between engines.
The provisioner will handle message wrapping and unwrapping of the
raw OTA keybox request / response into the SignedProvisioningMessage
which is sent to/received from the provisioning server.

[ Partial merge of http://go/wvgerrit/125844 ]

Note: Includes partial CryptoSession changes from various CLs.
CryptoSession functionality has been stripped to reduce impact of
this CL.

Bug: 189232882
Test: Android unit tests
Change-Id: I282bf7d1887daefb2250af1bd595c4dc3dfcfb29

Integrated OKP into CDM Engine

[ Merge of http://go/wvgerrit/133804 and http://go/ag/15646376 ]

Extended the functionality of the CdmEngine to check if the device
requires OKP and to initialize OKP resources if required.  The
functionality of OpenSession() and GetProvisioningRequest() have been
the most affected.  If OKP is required, these methods will signal to
the app that provisioning is required and will return an OKP request.

Once a device is provisioned, the OKP data is cleared away and the
CdmEngine will resume normal operation.  Engines created after a
device is provisioned will immediately enter normal operations.
The exception is for CdmEngines which failed to perform OKP for some
reason and are still running.  Those apps will need to restart before
gaining access to L1 operations.

Bug: 187646550
Test: Android integration tests
Merged-In: Ia572a66a7b73479355758aa3d0c682691eaca0fc
Change-Id: Ia572a66a7b73479355758aa3d0c682691eaca0fc
2021-10-20 17:50:08 -07:00
Rahul Frias
52bd1d206e Added an OTA keybox provisioner.
[ Merge of http://go/wvgerrit/133729 ]

The OtaKeyboxProvisioner is a system-wide provisioner for sharing the
provisioning workflow between CDM engines.

Bug: 189232882
Test: GtsMediaTestCases
Change-Id: I873af3087cc05e1831bdd1d2c14fb002b73e6902

Added keybox provisioning proto fields.

[ Merge of http://go/wvgerrit/133730 and http://go/ag/15113032 ]

This CL copies over the required license_protocol.proto changes that
are required for OTA keybox provisioning.  These fields are defined in
the server-side certificate_provisioning.proto, defined in
http://cl/377533774.

Note, changes are slightly different from server proto due to the RVC
version of license_protocol.proto being out of date with SC and newer
changes.

Bug: 189232882
Test: run_x86_64_tests
Change-Id: I55fcf6a7ac2ba4b6026b9acc63e822ff33c431d9

Added OTA keybox provisioning device files.

[ Merge of http://go/wvgerrit/133743 and http://go/ag/15421141 ]

This change adds a new set of proto messages/fields the CDM's device
files for recording device and engine information around OTA keybox
provisioning (OKP).

To make cleanup and thread protection possible, there is a single file
which will contain all the information for the device as a whole and
each CDM engine tied to an app/origin.

Bug: 189232882
Test: Linux unit tests
Change-Id: Iaf80cd6342f32657e04416750d9b278d935821a5

Client ID for OKP requests.

[ Merge of http://go/wvgerrit/133744 and http://go/ag/15645331 ]

Extended the CDM ClientIdentification class to support a subset of
client info used for OKP requests.

Bug: 189232882
Test: Android unit tests
Merged-In: I6aafb4f2164efe69bc733ece0a912f0e91893b91
Change-Id: I6aafb4f2164efe69bc733ece0a912f0e91893b91
2021-10-20 17:50:00 -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
Rahul Frias
ef792a4aca Merge "Add SYS_NICE capabilities" 2021-10-19 09:14:46 +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
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