Commit graph

67 commits

Author SHA1 Message Date
Alice Wang
cdf9d2c936 Revert "[avf] Adjust IRPC VTS tests to handle AVF in unsupported env"
Revert submission 2778549-expose-avf-rkp-hal

Reason for revert: SELinux denial
avc:  denied  { find } for pid=3400 uid=10085 name=android.hardware.security.keymint.IRemotelyProvisionedComponent/avf scontext=u:r:rkpdapp:s0:c85,c256,c512,c768 tcontext=u:object_r:avf_remotelyprovisionedcomponent_service:s0 tclass=service_manager permissive=0


Reverted changes: /q/submissionid:2778549-expose-avf-rkp-hal

Bug: 308596709
Change-Id: Id6a930d16949389048713cef20dfa06cdbb9ac95
2023-10-31 15:01:15 +00:00
Alice Wang
87f8dce549 [avf] Adjust IRPC VTS tests to handle AVF in unsupported env
This cl adjusts IRPC VTS tests so that it can handle the IRPC AVF
impl in an environment where the IRPC operations are not supported.

Bug: 299257581
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Iae96076c20e360e6a4aca5518ca8df21920f6978
2023-10-27 09:50:19 +00:00
Alan Stokes
8cbbc15bc3 Give a name to the ConfigurationDescriptor.
Test: N/A
Change-Id: Ia2f4198e97a61494ba50e46fd198ee1f1ad44f0d
2023-10-13 13:43:21 +00:00
Andrew Scull
68e76934b2 Merge "Select the DICE validation rules based on the VSR" into main am: b484308d5c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2678076

Change-Id: I4694e2508d1381537a25e663382563e24221af7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 19:33:43 +00:00
Andrew Scull
1ca978f373 Select the DICE validation rules based on the VSR
Check the VSR of the device to select the DICE validation rules that
will be appropriate to use for VTS.

Test: TH
Change-Id: Iff19debd1e442a0b318da1a4d8a08d470efba0ae
2023-09-20 14:30:48 +00:00
David Drysdale
46b80f12da Merge "rkp: pull out remaining CDDL and make compliant" into main am: 05f682fd3d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2745396

Change-Id: I1e44e873db4b6f846f3e28248ed3bfec9b1ba859
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-12 08:49:45 +00:00
David Drysdale
04d2ed4ff0 rkp: pull out remaining CDDL and make compliant
Extract CDDL from MacedPublicKey.aidl and DeviceInfo.aidl.

Make -70000 optional in `PublicKey`.

Make CDDL compliant with RFC8610:

- Move `bstr` contents for generated data (e.g. `ECDSA(..)`) to comments.
- Fix alternatives in CBOR-encoded bstr instances.

Add more RFC references and unify reference style.

Try to use a standard format to indicate that external files are needed
for the complete CDDL schema.  (Hopefully in the future we might have
tooling that uses these to check the schemas.)

Test: Compile with docs.rs/cddl-cat and https://cddl.anweiss.tech/
Change-Id: Ie1d6c39f1cc0314e312df9205b570b89178ebd16
2023-09-11 17:23:09 +01:00
Alice Wang
e537902a03 Merge "Make android.hardware.security.rkp-rust available for virt apex" into main am: 01fc1b7279
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2727795

Change-Id: Ida99a60bf01d57ea1853f8b2c72746805ee20c7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 08:04:00 +00:00
Alice Wang
01fc1b7279 Merge "Make android.hardware.security.rkp-rust available for virt apex" into main 2023-09-06 07:36:55 +00:00
Treehugger Robot
76c929f01e Merge "Move CDDL into separate CDDL files" into main am: f9e524c5b1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2727995

Change-Id: Iedd1e8b48ba470d4c16d4306e0f9dc05008b25d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-01 23:08:44 +00:00
Paul Crowley
6aae9b6432 Move CDDL into separate CDDL files
Move CDDL out of comments and into files, per-method
generateCertificateRequest.cddl
generateCertificateRequestV2.cddl

This makes it easier to read and it means tools can parse it.

Test: Treehugger
Change-Id: I9b71b094d128a5a4566a4d352aaa11d1c9b595ff
2023-09-01 19:27:57 +00:00
Xin Li
879960bdce Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: I7b6fffac2ada0e039f79bad8cc9b4d954e9c3460
Change-Id: I9466127d8d0fa38df36ca99f704853b2db871e67
2023-08-25 13:29:30 -07:00
Alice Wang
d6281e7d82 Make android.hardware.security.rkp-rust available for virt apex
Bug: 274881098
Test: atest MicrodroidHostTests
Change-Id: I5791bc8f0aa4dd5938871edb8b67f4d0d1ee2599
2023-08-25 12:06:08 +00:00
Alan Stokes
5004b8b5ae Fix typo in CDDL
Test: N/A
Change-Id: Iba25acb24306d36c97be07987857237363654bb5
2023-08-25 09:34:35 +01:00
Andrew Scull
d49d16a7f3 Merge "Require the config hash" am: 122b4986d4 am: a45d765922 am: e204f73890
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2587808

Change-Id: Ib06a2441034b42f2126bf282856331729aa8eb08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-17 00:18:28 +00:00
Andrew Scull
790b5d23dd Merge "Add security version to config descriptor" am: 1d23120bad am: abf2969751 am: 411d1dcc5d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2587032

Change-Id: I90070b3a444e6d25b45e4362b45240da6cd5669c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-16 00:20:41 +00:00
Andrew Scull
b804354851 Require the config hash
Align with the Open Profile for DICE by requiring that the configuration
hash be included because the configuration input is a hash of the
specified configuration desscriptor.

Test: n/a
Change-Id: I9d2ef560dc8e6f567b5b8d1a244f5138c45ae420
2023-05-14 23:24:25 +00:00
Andrew Scull
0d520e8e17 Add security version to config descriptor
Introduce a field to the configuration descriptor that provides a
standard semantically-defined version number rather than the
vendor-defined component version which acts more like a build ID.

Test: n/a
Bug: 282205139
Change-Id: Idb0c991ab12ae75687236f2489e639e4422a0225
2023-05-13 21:17:07 +00:00
Seth Moore
82c8f1f895 Merge "Add VSR annotations for RKP DICE" am: 5fc0168163 am: 68af3d71f8 am: 802a456489
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2568770

Change-Id: I25f29ea8963f558924da0d84f38d2cfd6971049d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-28 00:56:57 +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
d029c3cc70 Merge "Strictly deprecate IRPC test mode key generation" am: 29b1d626ba am: 67b98a3a24 am: 6a4ab98db1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2559010

Change-Id: I6806f9c75ee1a0378d9a43379745e188f08dfb50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 14:41:50 +00: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
3e925253ad Merge "Add checks for different size of challenge" am: a95f69da2e am: 15ffcaf669 am: 6b32036b41
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2495456

Change-Id: Iab818789f86cf498e40a4e6fb2f592b7be7d9822
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-17 05:43:33 +00:00
Treehugger Robot
a95f69da2e Merge "Add checks for different size of challenge" 2023-04-17 04:20:54 +00:00
Alex Buynytskyy
ec1198d941 UpsideDownCake is now 34
Ignore-AOSP-First: UpsideDownCake Finalization
Bug: 275409981
Test: build
Change-Id: I832ab7a8b5445ba85e27bbcf5be64906bfa0e5be
2023-04-07 23:41:20 +00:00
Andrew Scull
37ce42ae95 Merge "Document that the component version can be a string" am: de49fca027 am: f82e894f01 am: 35b6a90035
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2513920

Change-Id: I2c535f073f752bc145d8a8f8770b23a5bfa0962d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-07 22:53:13 +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
aae2f5adde Merge "Deprecate CSR v1 and v2 in IRPC v3" am: 74a699c4d8 am: eb06c44f4f am: 2379f9b037
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2510195

Change-Id: I65fbce13aa8cae31acc1f0eb01794de09fff0caa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 15:41:45 +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
bc1363bb5c Merge "Note the relationship of patchlevels with keymint" am: 58686e5882 am: 0eaa396dc0 am: e68cc7b3e8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2496162

Change-Id: I02a90a63169115344a1ec8e98b60360071de3cbe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-20 20:56:33 +00:00
Seth Moore
33d654b693 Merge "Add old DeviceInfo version documentation" am: d0c02789ad am: ec275b18d7 am: a6f398aa75
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2494236

Change-Id: I41f460d25f4992a895ae7c9d6c833b27afe5e799
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-17 22:49:57 +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
18fc2fe524 rkp: add keymint v2 hash into rkp v2 am: 184f64bcee am: 817bdea5fc am: 80513bcab3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2492259

Change-Id: Ib24ebeae1d897b092011f6e8347201a85c7c9c95
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-15 23:12:02 +00: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
Cole Faust
f437e65d60 Merge "Baseline NewApi issues" into udc-dev 2023-03-10 18:33:57 +00:00
Cole Faust
e76cbec982 Baseline NewApi issues
NewApi was recently updated to support linting methods in
the system, module_lib, and system_server sdks, and was
demoted to a warning due to the new issues it finds.
Baseline all the new issues that NewApi can be made an error
again.

These cls were generated automatically by a script that
copied the NewApi issues from the reference baselines.

Bug: 268261262
Test: m lint-check
Change-Id: I22f3b3575b6ea00d72d143019d9eed028aa98b56
2023-03-09 14:20:10 -08: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