Commit graph

42 commits

Author SHA1 Message Date
Andrew Scull
ebcdcdbc03 Merge "Document expectations of DICE mode" 2023-05-10 00:53:08 +00:00
Andrew Scull
ed74a681eb Document expectations of DICE mode
The Open Profile for DICE give possible guidelines on the requirements
for the DICE mode but Android needs those to be strictly specified.

Fix: 263144485
Test: n/a
Change-Id: Ia5fc937654504199cabf4709f1c15484242e0161
2023-05-09 18:34:11 +00:00
Seth Moore
5fc0168163 Merge "Add VSR annotations for RKP DICE" 2023-04-27 22:05:36 +00:00
Seth Moore
ac1639f227 Add VSR annotations for RKP DICE
Bug: 277965670
Test: n/a (comment changes only)
Change-Id: I64e34c1f9865811f0967148cad914f7ef77f9448
2023-04-27 11:15:28 -07:00
Andrew Scull
f2ae193680 Strictly deprecate IRPC test mode key generation
It's already documented that IRPC v3 doesn't make use of test mode keys
however VTS still required support for their generation. Fix this and
simplify implementation of the v3 HAL by expecting an error in all cases
that the deprecated test mode keys are seen.

IRPC v3 also fully deprecated the EEK meaning a v3 implementation must
unconditionally report CURVE_NONE for supportedEekCurve.

The VTS tests are enhanced with contextual version constants rather than
reusing constants with seemingly unrelated names.

Bug: 278013975
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I5709a0b1cd77eb28e677f64bb781fad58d91570a
2023-04-24 20:23:48 +00:00
Treehugger Robot
a95f69da2e Merge "Add checks for different size of challenge" 2023-04-17 04:20:54 +00:00
Andrew Scull
de49fca027 Merge "Document that the component version can be a string" 2023-04-07 20:57:25 +00:00
Andrew Scull
65a514dcf6 Document that the component version can be a string
Following feedback from partners, allow the component version in the
configuration descriptor to be either an int or a string.

Bug: 273552826
Test: n/a
Change-Id: Iecc9889592a2e634a3b9e40f14347b231b703c60
2023-03-29 17:56:31 +00:00
Andrew Scull
95b3131370 Deprecate CSR v1 and v2 in IRPC v3
Deprecate the CSR format from v1 and v2 of the HAL, again. The older CSR
versions were allowed in order to ease migration from the
RemoteProvisioner app over to rkpd and that has now been completed.

Bug: 260920864
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I4d16eb64e4ffe602b4b252159202a4ddb56d63d7
2023-03-28 18:17:34 +00:00
Tommy Chiu
fde3ad1db5 Add checks for different size of challenge
RKP allows 0 ~ 64 byte challenge to be provided.
Test it by several different size inputs.

Bug: 272392463
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I488c75745dc68778ff6d862506a5beeec82f7ac1
2023-03-28 00:57:43 +00:00
Seth Moore
192c575ffb Note the relationship of patchlevels with keymint
Some of the DeviceInfo must match existing tags in KeyMint, but this
was not documented.

Test: n/a
Change-Id: I7733e2a4b0c08b0b89ece41390c0ce0711459d82
2023-03-17 15:36:11 -07:00
Seth Moore
d0c02789ad Merge "Add old DeviceInfo version documentation" 2023-03-17 20:48:35 +00:00
Seth Moore
47194fa089 Add old DeviceInfo version documentation
Since comments are stripped from the stable AIDL snapshots, the CDDL
describing the DeviceInfo contents is lost for the older versions. Add
the comments from older DeviceInfo versions as a reference for
maintainers of older HAL implementations.

Test: n/a
Change-Id: I7dd3d285b3d8422a6df4228ad0cf5797e78609c1
2023-03-16 16:24:57 -07:00
Steven Moreland
184f64bcee rkp: add keymint v2 hash into rkp v2
When we split the rkp interface, we only added one hash to rkp v2, but
on Android S devices, this interface was in keymint v2, and so it used
the keymint v2 hash.

In order for that old implementation to be recognized, we need to add the hash in specifically.

Note: v1 was missed in b/264549860, but this was v2.

Fixes: 271513408
Test: vts_treble_vintf_vendor_test
Change-Id: I58c7c41633000df933261a147edd3477afd09a36
2023-03-15 19:48:45 +00:00
Seth Moore
3182cc00a3 Fix minimum size description of challenge
The server-provided challenge is almost always smaller than 32 bytes,
so we cannot enforce that as a minimum. I fixed up the CDDL a while
back, but missed one mention of the 32 byte minimum in the description.

Test: n/a (it's a comment)
Bug: 272392463
Change-Id: Ia5994e2b7cf107ab131c6b028bee7881d0e657ac
2023-03-09 12:54:08 -08:00
Tri Vo
ec50ee162a Add test for IRPC DeviceInfo
Bug: 243148852
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: If873996f0d756662808d785d2ef57118737a5aab
2023-02-23 20:01:31 -08:00
David Drysdale
bf0ae8a0f0 Merge "RKP spec: fix public key info description" 2023-02-13 16:37:49 +00:00
David Drysdale
cdf8ed3f6f RKP spec: fix public key info description
The PartyInfo for a P-256 public key is encoded as (x||y) not
(0x04||x||y).

Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Iae5dc624228d4e1e538e230968443925ec8b55fc
2023-02-13 12:07:17 +00:00
Steven Moreland
5419c2dbe5 rkp: add keymint v1 hash into rkp v1
When we split the rkp interface, we only added one hash to rkp v1, but
on Android S devices, this interface was in keymint v1, and so it used
the keymint v1 hash.

In order for that old implementation to be recognized, we need to add the keymint v1 hash into rkp v1.

The hash added here is copied from this file:
hardware/interfaces/security/keymint/aidl/aidl_api/android.hardware.security.keymint/1/.hash

Bug: 264549860
Change-Id: I3fce46b3e9bd09d79fa8e2f203b4eb9ebb517c15
Test: vts_treble_vintf_vendor_test
2023-02-10 22:44:28 +00:00
David Drysdale
28b953032e RKPv2 spec clarifications
- Rename keysToCertify to keysToSign to match param name in a few
  places.
- Make clearer that P-256 is allowed in EEK.
- Make clearer that EEK curve should match that specified in
  RpcHardwareInfo.supportedEekCurve.
- Add note about AAD for AES-GCM encryption.
- Add note about format of public key data in KDF context.

Test: None, comments only
Change-Id: Ie775a453b4d3941b7d24396da66681ab91978d81
2023-01-26 06:31:02 +00:00
Andrew Scull
9132147d0a Merge "Allow P-384 and SHA-384 in RKP v3" 2023-01-20 20:49:14 +00:00
Andrew Scull
5bdc9f92bb Allow P-384 and SHA-384 in RKP v3
Following requests from partners, document P-384 and SHA-384 as
officially supported signing algorithms and hash functions in the DICE
chain.

Bug: 265455904
Test: n/a -- documentation-only change
Change-Id: Id7b5eaf81be17fda9278dc7ad5f2b441931c6b83
2023-01-19 14:18:12 +00:00
Treehugger Robot
ed2054123f Merge "Check for failures in base SetUp()" 2023-01-19 10:39:57 +00:00
Seth Moore
8a0f18051d Drop minimum RKP challenge size to 16 bytes
The current RKP server produces challenges smaller than 32 bytes.
As existing devices in the field may have some length limitations
due to this, let's not start sending larger challenges to those
devices. Instead, drop the challenge to 16 bytes to maintain compat.
There should be plenty of entropy in 16 bytes.

Test: n/a
Change-Id: I1dfd9b4b06131df907683207e4b6bfb2d1c93d65
2023-01-13 15:37:33 -08:00
Treehugger Robot
7a15fa5005 Merge "Add more clarity about integer encoding for keys" 2023-01-07 00:36:40 +00:00
Hasini Gunasinghe
eb3e5d16cf Merge "Fix VtsRemotelyProvisionedComponentTests for IRPC V3" 2023-01-06 22:13:16 +00:00
Seth Moore
1386742e52 Add more clarity about integer encoding for keys
Add references to appropriate documentation, as well.

Test: N/A
Bug: 251687782
Change-Id: I93adb940406c924879606137bb813d7735d9aee2
2023-01-06 09:56:27 -08:00
Hasini Gunasinghe
666b2717e4 Fix VtsRemotelyProvisionedComponentTests for IRPC V3
This updates the test: supportsValidCurve, for IRPC implementations
that supports only V3+.

Bug: 239476788
Test: atest VtsRemotelyProvisionedComponentTests with IRPC V3
implementation

Change-Id: Ic0f1223b30e31dc537155e19e800b3001ce0fc01
2023-01-05 21:35:51 +00:00
Tommy Chiu
88a0fd42c8 Correct some descriptions of IRemotelyProvisionedComponent
- STATUS_TEST_KEY_IN_PRODUCTION_REQUEST is still required for V3
- PubKeyEcdhP256 & PubKeyX25519 are unused in V3
- SignedDataSigStruct and DiceChainEntryInput should be an cbor array
  when being the input of PureEd25519/ECDSA

Bug: 243454124
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ice400bb15413eac164f2630cc2fbb66e6d3624b1
2023-01-05 10:37:22 +08:00
Andrew Scull
1bcb602b85 Check for failures in base SetUp()
If the base set up fails, the RKP version number might not be valid so
we shouldn't try to work out whether the test should be skipped based on
the version.

Assert that there weren't any fatal errors from the base set up rather
than reporting that the test should be skipped as that can be a bit
confusing.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Icaf946ef4cf6b31dcfe7187131538b9eb3892798
2022-12-27 10:52:17 +00:00
Max Bires
a9b3bb96b2 Add VSR enforcement testing for IRPC versioning.
Check the VSR API level for the device under test and ensure that the
appropriate HAL version for the IRemotelyProvisionedComponent interface
is present. E.g. a VSR 13 chipset should have IRPC v2 or newer.

Bug: 251185719
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I136cac27953d1d5acaa45510ad9efec2a75d8038
2022-12-14 15:16:35 -08:00
Seth Moore
34d856e8f7 Add RKP-specific owners file
Test: N/A
Change-Id: I844f3e88b2b89337d843f63e63c9dcbcbb921b77
2022-12-13 13:26:41 -08:00
Seth Moore
8f810b1303 Move remotely provisioned component tests to rkp directory
Now that the RKP HAL AIDL has been moved to it's own directory, we
should keep the tests with the AIDL.

Test: atest VtsAidlKeyMintTargetTest
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ia87d3ea0a1b9e6704f0dea8f98b0bbaa049472fe
2022-12-13 11:03:59 -08:00
Tri Vo
b0b8acc849 Make IRPC v3 optionally backwards compatible
Specifically, we want IRPC v3 to be able to serve old v2 clients. This
way we can ship parts IRPC v3 stack incrementally.

To that end, allow IRPC v3 to implement v2 behavior of
generateCertificateRequest and testMode.

Bug: 260920864
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I9e47697bd948c8fd6b82147165d0c67bdef9fbd3
2022-11-30 16:30:31 -08:00
Treehugger Robot
4ad2bb150e Merge "Document changes and clean up spec" 2022-11-22 21:15:18 +00:00
Max Bires
8d046265b8 Document changes and clean up spec
This change clarifies some more items that have changed between v2 and
v3 of the IRPC spec, along with fixing and clarifying some more
messaging in the .aidl documentation.

Test: Someone else can intelligibly read what was written
Change-Id: Ia9fa1595a72c818f93ce6fb31ea38c97d997488b
2022-11-22 10:45:55 -08:00
Seth Moore
557a1dbd03 Allow rkpd mainline module to link rkp aidl bits
Test: Build
Change-Id: Ide8b4ec4b8994368d035f79054818542aba306e5
2022-11-21 17:15:37 -08:00
Tri Vo
2ac5066335 Merge "Add an implementation defined limit on number of keys in CSR" 2022-11-16 03:44:22 +00:00
Tri Vo
9cab73c8bd Add an implementation defined limit on number of keys in CSR
Rationale here is that many IRPC implementations are memory constrained.
We add a way for implementations to report the maximum number of
supported keys. This way we can guarantee consistent behavior across
different devices.

For implementation of IRPC version 3 and later we define the lowest
number of keys supported to be 20. This specific value was chosen
because the current implementation of RemoteProvisioner already combines
keys into batches of exactly 20.

Bug: 254137722
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ib6fb6d6ec7c74004524a5505a37aa82c9e44ef91
2022-11-15 14:19:55 -08:00
Andrew Scull
9aa150cee7 Adjust CSRv3 CDDL after implementation experience
Rename from AuthenticatedMessage to AuthenticatedRequest in order to
make the direction of the message clear.

Move the challenge out of the endpoint-specific message and up into the
common authentication wrapper as it is uesd in the authentication
protocol.

Simplify the versioning by having the CSR version continue sequentially,
making the current version 3. Have the AuthenticatedMessage version
start from 1 as it's value isn't used to distinguish v2 and v3 CSRs
anyway and it will avoid confusion with the CSR version which has
already moved beyond this value.

Bug: 250910137
Test: n/a -- comments only
Change-Id: I13836e90fa76b1b22cb6627f3d987828ffeb0adc
2022-11-10 21:50:55 +00:00
Seth Moore
f479b4b902 Update README and CHANGELOG for RKP
Bug: 254112961
Test: vts_treble_vintf_vendor_test
Merged-In: Ib66fcbdbaadda3f32cd8423f61bd31d5f43dc44b
Change-Id: Ib66fcbdbaadda3f32cd8423f61bd31d5f43dc44b
2022-11-10 01:56:49 +00:00
Seth Moore
3a810627e0 Split rkp from keymint
Bug: 254112961
Test: vts_treble_vintf_vendor_test
Merged-In: I3734bd7647cbb7b33ef654ba2fb40fe8a648689e
Change-Id: I3734bd7647cbb7b33ef654ba2fb40fe8a648689e
2022-11-10 01:56:41 +00:00