Commit graph

1012 commits

Author SHA1 Message Date
David Drysdale
bef8d3ae89 Secretkeeper: add message encryption
All request messages are encrypted, but response messages have an outer
unencrypted layer, with an inner response (and the result values inside
that).

Make the SecretManagement.cddl file clearer to reflect that, and make
the schema valid along the way.

Move the outer (unencrypted) error code values into `ErrorCode.aidl` and
use them as service-specific error codes, thus reducing the number of
error types from 3 to 2.

Bug: 291228560
Test: VtsSecretkeeperTargetTest
Test: validate CDDL with https://atacama.informatik.uni-bremen.de/
Change-Id: I46c5bfd7e40b03919d7d3779b265b3bb3ff1ce1e
2023-12-12 16:03:04 +00:00
Shikha Panwar
cbad9a37d3 Test store & get Secret functionality
Test Store/Get api of SecretManagement HAL. We use a hard coded
hypothetical chain & a dice policy (which the dice chain matches
against) for testing the store/get functionality.

This patch also adds required error codes in SecretManagement.cddl

Bug: 291224769
Test: atest VtsSecretkeeperTargetTest
Change-Id: I0aa2dfc7413791e9de62a6e753bda4ab2f813d2c
2023-12-12 14:24:14 +00:00
Shikha Panwar
2759df0d3c [Secretkeeper] In-memory KeyValueStore
We introduce InMemoryStore, an implementation of KeyValueStore trait.
This can be used for implementing backends that VTS can run against.

Bug: 291224769
Test: atest VtsSecretkeeperTargetTest
Change-Id: Id109ee3bd38ec0979953b6285019c97d418172ef
2023-12-12 14:24:14 +00:00
Seth Moore
121fedaa46 Replace string copies with const-ref
Change-Id: Ie3ea65cc81aa8b9a92a7718ca2003440a3189a4b
Test: Treehugger
2023-12-11 10:32:02 -08:00
Treehugger Robot
05585eb79a Merge "Replace secretkeeper_comm_nostd->secretkeeper_core_nostd" into main 2023-12-08 17:17:43 +00:00
Treehugger Robot
4de610c690 Merge "Vendor api level cannot use sdk api level" into main 2023-12-08 16:24:15 +00:00
Shikha Panwar
5afbeec13d Create OWNERS file for secretkeeper interface
Bug: 291224769
Test: N/A
Change-Id: I650d4e640522876f79ea583cbbddd159776c8955
2023-12-08 15:16:41 +00:00
Shikha Panwar
0b0895a49b Merge "Secretkeeper VTS: Use trait CborSerializable" into main 2023-12-08 14:56:47 +00:00
Shikha Panwar
3f136b2914 Replace secretkeeper_comm_nostd->secretkeeper_core_nostd
Moving SecretkeeperTa struct to secretkeeper_core

Bug: 291224769
Test: Builds
Change-Id: I6f1a7ef08580e2c9383abcb88997a8eb11c6b14a
2023-12-08 13:51:51 +00:00
Justin Yun
31002f5d2e Vendor api level cannot use sdk api level
Update __ANDROID_API_V__ with 202404 for the vendor api level.

Bug: 312798205
Bug: 315246126
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I0e6ff71e57137e3f6d7e5e5bf082d10026cec2e0
2023-12-08 21:10:37 +09:00
Shikha Panwar
72e99b7604 Secretkeeper VTS: Use trait CborSerializable
With Request/Response packets impl CborSerializable. Use the methods
from those.

Test: atest libsecretkeeper_comm_nostd
Bug: 291228655
Change-Id: Ib0daf9c0aa3417befedbc130725fb3445b327079
2023-12-08 11:37:59 +00:00
Seth Moore
40f1230a1d Merge "Change the way rkp tool obtains serial number" into main 2023-12-07 19:14:37 +00:00
chuanchuan.gao
18a9fa99a8 Change the way rkp tool obtains serial number
[Description]
1.Add patch to modify rkp_factory_extraction_tool, so
 that it can meet TV customer's factory product line.
2.Change the method for
rkp_factory_extraction_tool to get the serial number.
3.Introduce a new input parameter, serialno_prop,
to the function jsonEncodeCsrWithBuild.
4.Use the new property of serialno_prop if it is set,
otherwise defaults to "ro.serialno".

Test:
1.build pass
2.AC on/off pass
3.run "rkp_factory_extraction_tool
--output_format build+csr
--serialno_prop $(customer_prop) > csr.json" pass
4.run "rkp_factory_extraction_tool
--output_format build+csr > csr.json" pass
5.VtsHalRemotelyProvisionedComponentTargetTest pass
6.libkeymint_remote_prov_support_test pass
7.VtsAidlKeyMintTargetTest pass

Bug: 313811996
Change-Id: I8aa83bacab22f0a28bc54aea9e816f75a382ffde
2023-12-07 18:23:15 +08:00
David Drysdale
986e92e098 Merge "Secretkeeper: add AuthGraph key exchange" into main 2023-12-07 06:56:12 +00:00
Seth Moore
0293d63b50 Fix incorrect link rendering.
The MD format was wrong for some RKP-VM links.

Change-Id: I03c9b4c394cbfc9c85b6c5cb3ea3625da2eb09a3
2023-12-06 15:53:19 +00:00
David Drysdale
8898d2ec57 Secretkeeper: add AuthGraph key exchange
Add `ISecretkeeper::getAuthGraphKe()` method to the Secretkeeper HAL.

Align the AIDL targets between AuthGraph and Secretkeeper, and add
some defaults that automatically link to the current version of the
Secretkeeper AIDL targets.

Move the non-secure implementation of AuthGraph to run the TA in a
separate thread.

Alter the nonsecure implementation of Secretkeeper so that it no longer
directly implements Secretkeeper functionality, but instead re-uses
common code from the Secretkeeper reference implementation.  This
involves re-using the common implementation of the HAL service (from
`authgraph_hal`), but also involves using the reference implementation
of the the TA code that would normally run in a separate secure
environment.  The latter code expects to run in a single-threaded
environment, so run it in a single local thread.

Note that the negotiated session keys emitted by AuthGraph are not yet
used by Secretkeeper (coming in a subsequent CL).

Extend the Secretkeeper VTS tests to invoke the AuthGraph VTS inner
tests on the returned IAuthGraphKeyExchange instance, exercising the
instance as an AuthGraph sink.

Bug: 291228560
Test: VtsSecretkeeperTargetTest
Change-Id: Ia2c97976edc4530b2c902d95a74f3c340d342174
2023-12-06 06:50:19 +00:00
Jooyung Han
577cc0ac9b Merge "Create secretkeeper HAL APEX" into main 2023-12-06 01:45:22 +00:00
Treehugger Robot
3cf2309b7b Merge "Add new CertificateType for the RKP VM" into main 2023-11-30 17:00:20 +00:00
Seth Moore
690571283b Add new CertificateType for the RKP VM
The RKP VM is part of the Android Virtualization Framework. It will be
uniquely authenticated by the RKP server, and therefore needs its own
certificate type.

Bug: 300624493
Change-Id: Ice586ad85ae43235dd80a5d220603e7394c1c49b
2023-11-30 15:55:54 +00:00
David Drysdale
2ae2061864 Merge "KeyMint: check length of verified boot key" into main 2023-11-29 10:41:13 +00:00
Jooyung Han
bc19229812 Create secretkeeper HAL APEX
Bug: 276190333
Test: VtsSecretkeeperTargetTest
Change-Id: Ia932b8eaaccf806d7fbfd764db2922a5ff1a9a1b
2023-11-29 14:27:07 +09:00
David Drysdale
20c6549f34 AuthGraph: drop now-unused StdClock
Test: build
Bug: 291228560
Change-Id: Ie4bd2c7ebca1ceae07012f406c2dcbb5efbd915d
2023-11-23 15:50:42 +00:00
Jooyung Han
28b3387f4c Merge "Add authgraph HAL APEX" into main 2023-11-23 02:03:18 +00:00
Alice Wang
c9655da294 Merge "Revert^4 "[avf] Adjust IRPC VTS tests to handle AVF in unsupported env"" into main 2023-11-22 09:49:19 +00:00
David Drysdale
f4cb6de19c Merge "AuthGraph VTS: detect additional errors" into main 2023-11-22 06:23:38 +00:00
Shikha Panwar
0da7c09716 Merge changes from topic "sk_hal" into main
* changes:
  VTS test for ISecretkeeper
  Secretkeeper implementation: in-HAL/nonsecure impl
  Introduce Secretkeeper HAL interface
2023-11-21 17:56:46 +00:00
Alice Wang
895f4b33e8 Revert^4 "[avf] Adjust IRPC VTS tests to handle AVF in unsupported env"
Revert submission 2829351-revert-2812456-revert-2812435-revert-2778549-expose-avf-rkp-hal-GTFGLMUUKQ-PAWNEHUQBT-WYENGHRTXK

Reason for revert: Relands the original topic:
https://r.android.com/q/topic:%22expose-avf-rkp-hal%22
PS2 is the same as the original cl: aosp/2796032

Reverted changes: /q/submissionid:2829351-revert-2812456-revert-2812435-revert-2778549-expose-avf-rkp-hal-GTFGLMUUKQ-PAWNEHUQBT-WYENGHRTXK

Test: atest MicrodroidHostTests librkp_support_test
Change-Id: I7200599131c01908db7fa3bb4a6f989418a89288
2023-11-21 12:26:53 +00:00
Shikha Panwar
a6eaf55d7d VTS test for ISecretkeeper
Add VTS for testing ISecretkeeper implementation. At present, VTS is
limited to testing GetVersion operation of SecretManagement.

Test: atest VtsSecretkeeperTargetTest
Bug: 291224769
Change-Id: I6084af2fa6cb578e27996e26a0505b267a10b4ef
2023-11-21 12:00:49 +00:00
David Drysdale
087ead1608 AuthGraph VTS: detect additional errors
A failure to get the IAuthGraphKeyExchange/nonsecure instance might
be because it's not registered (likely on most non-Cuttlefish devices)
or it might be for some other reason, such as SELinux denial.

So detect other kinds of failure to get the service, and also change
the VTS to require root so SELinux denials don't happen.

Also tweak the expected return code when a source is given a corrupt
key; now that replay protection is implemented, the reference
implementation rejects this earlier (and with a different error)
because the session lookup fails.

Test: VtsAidlAuthGraphRoleTest
Bug: 291228560
Change-Id: I032600ac809f43a3642fa9ef9aae788d3ca2378f
2023-11-21 11:09:42 +00:00
David Drysdale
3fb1cddadc Merge "KeyMint: tweak spec to allow for no v4 in V" into main 2023-11-21 09:38:53 +00:00
Jooyung Han
9f3f37f288 Add authgraph HAL APEX
Bug: 309463258
Test: VtsAidlAuthGraphSessionTest
Change-Id: I5ac32a6e5d70321f31321b613a982020bf51db68
2023-11-21 17:14:33 +09:00
David Drysdale
1405dbc7a4 KeyMint: tweak spec to allow for no v4 in V
Given that we are not expecting to release a v4 of the KeyMint HAL for
Android V, tweak some spec and test details so that existing v3
implementations do not need to change.

- Soften the requirement to use (1970-01-01, 9999-12-31) as cert dates
  when secure-importing an asymmetric to be a suggestion instead.
- Change the version gate for the test of importing an EC key with no
  specified `EC_CURVE` to be VSR-gated rather than gated on a putative
  future version of the HAL.

Test: VtsAidlKeyMintTargetTest
Bug: 292318194
Bug: 292534977
Change-Id: Ib8d6e79ea948ee77eeb2528d698205179f026fd3
2023-11-20 12:13:42 +00:00
David Drysdale
d847ef9f03 KeyMint: check length of verified boot key
Only police for future versions of KeyMint, so that any existing
implementations that use the full key don't suddenly start to fail
VTS.

Bug: 305103215
Test: VtsAidlKeyMintTargetTest
Change-Id: If6534b84b6eff8cdb281586e17a5f89c7bf5f5d0
2023-11-20 11:41:31 +00:00
Shikha Panwar
eb223ba883 Secretkeeper implementation: in-HAL/nonsecure impl
Create the default/reference implementation of Secretkeeper HAL. Status
quo, this is non-secure implementation. In reality, the HAL should be
backed by a privileged component such a trusted app.

Bug: 291224769
Test: Topic includes VTS
Change-Id: I6a4ad50482d537f5438de6201275f4020cd827df
2023-11-17 18:21:35 +00:00
Shikha Panwar
18cafa0a11 Introduce Secretkeeper HAL interface
Secretkeeper is a privileged component which seals the secrets of pVM
instances & releases them on successful authentication of the pVM.

The HAL should be backed by a secure TA of higher privilege than a pVM.

This patch introduces a subset of HAL spec - the SecretManagement api. The
protocol is cbor based (specified in SecretManagement.cddl).

Test: atest VtsSecretkeeperTargetTest
Bug: 293429085
Change-Id: I8e650f27d506d378a94bbc8834c68a005fb12253
2023-11-17 18:17:24 +00:00
Hasini Gunasinghe
7a32f3e555 Documentation updates as per the API council review and proof reading.
This CL updates description of the `Nonce` used in key exchange as per
API council review.

Additionally, this includes updates to the documentation that are found
to be suitable as per further proof reading.

Test: N/A
Change-Id: Ie59e3a10eb8844fcfac9dad60c9d431ae499ee40
2023-11-17 02:18:23 +00:00
Hasini Gunasinghe
5df6ed5e66 Update the VTS module according to the refactoring in aosp/2826571
Test: atest VtsAidlAuthGraphRoleTest, atest VtsAidlAuthGraphSessionTest
Change-Id: I6cc3bd17952f602b58668d35e09c6a5385c7de61
2023-11-16 06:49:05 +00:00
Treehugger Robot
2000d6735a Merge "Revert "Revert "Revert "[avf] Adjust IRPC VTS tests to handle AV..."" into main 2023-11-14 02:41:56 +00:00
Alan Stokes
9cf6ef128f Revert "Revert "Revert "[avf] Adjust IRPC VTS tests to handle AV..."
Revert submission 2812456-revert-2812435-revert-2778549-expose-avf-rkp-hal-GTFGLMUUKQ-PAWNEHUQBT

Reason for revert: SELinux denials: b/310744536

Reverted changes: /q/submissionid:2812456-revert-2812435-revert-2778549-expose-avf-rkp-hal-GTFGLMUUKQ-PAWNEHUQBT

Change-Id: Ibfbb80fed423d722362115e744fa13c376537e92
2023-11-14 01:40:45 +00:00
Alice Wang
ae656627a0 Merge "Revert "Revert "[avf] Adjust IRPC VTS tests to handle AVF in uns..."" into main 2023-11-13 21:33:49 +00:00
David Drysdale
0a44da8589 Merge changes from topic "ag-wire" into main
* changes:
  AuthGraph: add per-role VTS tests
  AuthGraph: add fuzzer
  AuthGraph: move code into library
  AuthGraph: reduce dependency on authgraph_core
2023-11-09 07:11:51 +00:00
David Drysdale
fe41825f1c AuthGraph: add per-role VTS tests
Add VTS tests that just exercise a single role, sink or source.

Use the AuthGraph core library to provide the implementation of the
other role.  This means that the tests are best written in Rust.

Put the test code into a library, so that other HALs which include
AuthGraph as a component can exercise the AuthGraph parts in their own
VTS tests.

Test: VtsAidlAuthGraphRoleTest
Bug: 284470121
Change-Id: I73f6aa277b41cc728587d707d7a6f82f0d18e08f
2023-11-08 12:43:29 +00:00
David Drysdale
6fb22dc9ef AuthGraph: add fuzzer
Test: m android.hardware.authgraph-service.nonsecure_fuzzer
Bug: 284470121
Change-Id: Ib702b5b0cf69a4a839326297c2d71355562b46c3
2023-11-06 13:26:25 +00:00
David Drysdale
6c09af215d AuthGraph: move code into library
Use the core library's new service implementation, which wraps a
channel to the TA.

In this nonsecure case, the TA is local in-process, so use the core
library's AuthGraphTa, and implement the SerializedChannel as just
a direct invocation of the TA.

Move this code into a _nonsecure library, so the main.rs just has
the code needed to start the executable and register the service.

Test: VtsAidlAuthGraphSessionTest
Bug: 284470121
Change-Id: I738d3876872a8cd248f0ebec708676d1173b6e37
2023-11-06 13:08:45 +00:00
Frederick Mayle
9891be01f8 use getDescription in test failure message
getMessage is often empty. getDescription will always include at least
the status code.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Id401184a3c3642188e26fa2ec03f19515f89ae4f
2023-11-03 14:41:06 -07:00
David Drysdale
f2117ff77c AuthGraph: reduce dependency on authgraph_core
The authgraph_hal library should only depend on libauthgraph_wire, not
on libauthgraph_core, so adjust error processing accordingly.

Test: VtsAidlAuthGraphSessionTest
Bug: 284470121
Change-Id: I48056db6ceeab409d0f165f8e051809129643c6f
2023-11-03 12:22:42 +00:00
Eran Messeri
4f73689e26 Merge "Document the allowed challenge size" into main 2023-11-02 13:59:09 +00:00
Eran Messeri
79cb992033 Document the allowed challenge size
KeyMint should be able to handle challenges up to 128 bytes.
Document this (and the expected error code) in Tag.aidl.

Bug: 307714384
Test: m
Change-Id: Id099dd055c81b10d777effdf364395f84d8b35c6
2023-11-01 19:22:30 +00:00
David Drysdale
7fd838c0fe Add (nonsecure) default AuthGraph impl
Add an implementation for the AuthGraph key exchange HAL, to allow
testing and policy compliance.

In real use, IAuthGraphKeyExchange instances are expected to be
retrieved from some other HAL, allowing the AuthGraph instance to be
specifically correlated with the component that uses it.

Bug: 284470121
Bug: 291228560
Test: hal_implementation_test
Test: VtsAidlAuthGraphSessionTest
Change-Id: Ib064292d60bead663af7721fd1406f2a9b5d8ecd
2023-10-31 23:18:56 +00:00
David Drysdale
d42cb6fa69 authgraph: add parallel session VTS tests
Test: VtsAidlAuthGraphSessionTest
Change-Id: Idcf79afe838fdbfb88bd7f43fe758ac03d9ba0d1
2023-10-31 23:18:56 +00:00
David Drysdale
c8625a8963 authgraph: add placeholder VTS test
Test: VtsAidlAuthGraphSessionTest (with nonsecure default impl)
Change-Id: I1a94071da8de8d4934709fa7875f89a0bb00a142
2023-10-31 23:18:56 +00:00
Hasini Gunasinghe
0e2495f107 Define the AIDL interface for AuthGraph key exchange.
Introduce the AIDL methods for key exchange and the CDDLs for
the relevant input/output types that are CBOR encoded.

Use a standard comment format in CDDL files to indicate where additional
structure definitions can be found, in the hope that one day tooling
will be available to automatically check schema syntax.

Add authgraph to compatibility matrix

This CL merges the CLs: aosp/2750484, aosp/2750485, aosp/2750486 by
drysdale@google.com

Co-authored-by: David Drysdale <drysdale@google.com>

Bug: 284470121
Test: validate schemas with https://cddl.anweiss.tech/
Test: VtsAidlAuthGraphSessionTest (with nonsecure default impl)
Change-Id: I2793666ede028f8abe91569587c09dcac21c67e0
2023-10-31 23:18:56 +00:00
Alice Wang
247b39a92f Revert "Revert "[avf] Adjust IRPC VTS tests to handle AVF in uns..."
Revert submission 2812435-revert-2778549-expose-avf-rkp-hal-GTFGLMUUKQ

Reason for revert: This change relands the topic
https://r.android.com/q/topic:%22expose-avf-rkp-hal%22
This SELinux denial has been fixed in system/sepolicy

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

Change-Id: Ia1aed212bf8de4b81239997cc1d1ca665cc456eb
2023-10-31 15:16:55 +00:00
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
Prashant Patil
2114dca2aa RSA OAEP MGF1 digest VTS relaxed for keymint < V3
Since there were no VTS test to strictly check RSA_OAEP_MGF_DIGEST,
there are released devices with Keymint which do not include this tag in
key characteristics, hence these test fails on such Keymint and UDC
Android framework.

Hence version check is added before asserting MGF digest checks.

Bug: 297306437
Test: atest VtsAidlKeyMintTargetTest
Change-Id: I43054f8dbbd46de53deef5e6771c736e770280e0
2023-10-10 10:03:30 +00:00
Treehugger Robot
3877b6094b Merge "Skip known VTS failures on vendor code till U" into main am: 87e6b60eb3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2654142

Change-Id: If63ff188c3e82b4648706b910ee02e729409cdc1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-25 19:58:54 +00:00
Treehugger Robot
87e6b60eb3 Merge "Skip known VTS failures on vendor code till U" into main 2023-09-25 19:24:14 +00:00
Ryan Prichard
2abfe4abc7 Merge "Fix nonce uniqueness tests" into main am: 8d333ff410
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2758146

Change-Id: Ifc31204eaea700e50e8ac0601fa77911b590b65c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-22 20:51:37 +00:00
Ryan Prichard
8d333ff410 Merge "Fix nonce uniqueness tests" into main 2023-09-22 19:43:55 +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
Treehugger Robot
6375a4ce87 Merge "Don't require UNKNOWN_ERROR" into main am: 606a406750
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2757927

Change-Id: Iea95e5d2e565bdc4908587e5d07203946d24efbb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-21 19:32:52 +00:00
Andrew Scull
b484308d5c Merge "Select the DICE validation rules based on the VSR" into main 2023-09-21 18:48:49 +00:00
Treehugger Robot
606a406750 Merge "Don't require UNKNOWN_ERROR" into main 2023-09-21 18:30:15 +00:00
Tri Vo
7b565c4e7b Don't require UNKNOWN_ERROR
Negative test cases should not expect UNKNOWN_ERROR from Keymint since
the exact cause of failure is known.

In general, we should avoid UNKNOWN_ERROR because it makes error
attribution difficult.

To avoid adding retroactive requirements KM implementation, relax the
check to expect any error.

Bug: 298194325
Test: VtsAidlKeyMintTargetTest
Change-Id: I136fb6d36ae92c9e3722ffefe9a067d3515dcbf9
2023-09-20 19:31:48 -04:00
Ryan Prichard
b2c9d5c9a6 Fix nonce uniqueness tests
std::unique consolidates the unique nonces at the start of the `nonces`
vector, but it doesn't modify nonces.size(), so these tests weren't
actually verifying that the nonces were unique. Add a vector::erase
call to shrink the vector.

After upgrading libc++, std::unique is [[nodiscard]] and this bug is
a compiler error.

Bug: 175635923
Test: treehugger
Test: m VtsAidlSharedSecretTargetTest VtsHalKeymasterV4_0TargetTest
Change-Id: I7fd8c40a3920bf3a8988c8065503c78ba36dc742
2023-09-20 16:11:35 -07: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
Eran Messeri
4b7b07e24d Merge "Enable EcdsaAttestationIdTags VTS for GSI" into main am: 801c76b13e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2745873

Change-Id: If827b01dfb1e5cb4d395d32e29fe34d548ea9a42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 11:28:53 +00:00
Eran Messeri
801c76b13e Merge "Enable EcdsaAttestationIdTags VTS for GSI" into main 2023-09-19 10:55:45 +00:00
David Drysdale
069412e781 Merge "KeyMint: clarify EC_CURVE on import" into main am: a2d3f2499c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2740353

Change-Id: Ie52807c884e5e52ac07845ae8e0275a0eacba2a4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-18 16:11:40 +00:00
David Drysdale
a2d3f2499c Merge "KeyMint: clarify EC_CURVE on import" into main 2023-09-18 15:00:57 +00:00
David Drysdale
e865448a4e Merge "KeyMint VTS: re-order auth failure arms" into main am: 2ef3749cba
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2750968

Change-Id: I03e4e696611bee62c71fc6e50fea8136329e1510
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 11:04:31 +00:00
David Drysdale
60a02ab943 Merge "KeyMint: check missing EC_CURVE on v3+" into main am: c91d05699f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2750972

Change-Id: Ibe592cb6ba1b9107ea6972fa085dad9a4a89154e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 11:04:07 +00:00
David Drysdale
2ef3749cba Merge "KeyMint VTS: re-order auth failure arms" into main 2023-09-15 10:36:47 +00:00
David Drysdale
9ed7d2c5bf KeyMint: check missing EC_CURVE on v3+
The original change to add this test didn't make it into the Android 13
version of the VTS test, so the version gate needs to be updated to be
v3+

Bug: 292318194
Test: VtsAidlKeyMintTargetTest --gtest_filter="*EcdsaMissingCurve*"
Change-Id: I94bf816688e57c7c04893a23cf0399129de94229
2023-09-14 15:16:27 +01:00
David Drysdale
a35699cb5c KeyMint VTS: re-order auth failure arms
Allow for devices that claim to need external timestamps, but don't.

Test: VtsAidlKeyMintTargetTest
Bug: 300211206
Change-Id: Ie450d9969c337d5274502f3600e14c0b481e8b34
2023-09-14 11:34:15 +01: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
Prashant Patil
24f7579130 Enable EcdsaAttestationIdTags VTS for GSI
Earlier, attestation properties didn't match on GSI images, hence
EcdsaAttestationIdTags VTS test case was skipped on GSI images.

Recently attestation properties reading priority changed as
ro.product.*_for_attestation -> ro.product.vendor.* -> ro.product.*
that means on GSI images ro.product.vendor.* properties could be used
and hence attestation should work. Incase ro.product.vendor.* properties
are not same as provisioned values to KM. They should be set as
ro.product.*_for_attestation on base build.

Bug: 298586194
Test: atest VtsAidlKeyMintTargetTest:PerInstance/NewKeyGenerationTest#EcdsaAttestationIdTags/0_android_hardware_security_keymint_IKeyMintDevice_default
Change-Id: Ie945bd8f7060e0e768daf9681d121ea5f170a6e1
2023-09-07 15:40:33 +00:00
David Drysdale
9b8d75eacb KeyMint: clarify EC_CURVE on import
Bug: 292318194
Test: VtsAidlKeyMintTargetTest
Change-Id: I4194b70f1da8816e19f231331c738050c2b7d59f
2023-09-06 13:37:57 +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
David Drysdale
d8fecae7a1 Merge "Summarize security HALs" into main am: 06717b5ec2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2727975

Change-Id: Ib3aa50a0fe48d6ec148f027bdcdbdcb0abe019e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 06:29:31 +00:00
David Drysdale
06717b5ec2 Merge "Summarize security HALs" into main 2023-09-06 06:04:26 +00:00
Istvan Nador
6d3ce4954e Enable the keymaster logger in the default Keymint am: 8f28f8b8ea
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2738433

Change-Id: I4ed1aad6a176685e53492e5f8eaaac98c4975e95
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-05 16:10:25 +00:00
Istvan Nador
8f28f8b8ea Enable the keymaster logger in the default Keymint
This solution was adopted from Cuttlefish's host side Keymint
implementation: I22bde00aed311c6774f83acc08a2c21e6e75141f.

Bug: 296983430
Test: Tested with Cuttlefish that the logs are present in logcat.
Change-Id: I942b0200bb164a2a865b255c6f26d628cbd345a4
2023-09-04 12:05:58 +00:00
David Drysdale
1d5b2daffe Summarize security HALs
Test: nope
Change-Id: Ie222c457a7637aa41bafbdb6c875624fbb82a397
2023-09-04 13:04:45 +01: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
Treehugger Robot
f9e524c5b1 Merge "Move CDDL into separate CDDL files" into main 2023-09-01 22:20:54 +00:00
Andrew Scull
f8d5b437b1 Merge "Test the format of patch level device info" into main am: 92bd93934a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2736075

Change-Id: I0901620654d311c76880dd3856ef55bf7ae17cea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-01 21:28:37 +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
Andrew Scull
e780dbf0d0 Test the format of patch level device info
On top of checking that the patch level are a UINT, also check that they
follow the YYYYMM or YYYYMMDD format in the CSR v3 as is required by the
server validation logic. This check is not applied in the factory as the
value might not yet be correctly provisioned.

Bug: 269813991
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I5c62ba176dae390ea0a387bba6cb975226e3873a
2023-09-01 17:42:31 +00:00
Tri Vo
075ff6faf0 Merge "keymint: Clarify usage of certificate tags with importWrappedKey" into main am: d284817690
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2693003

Change-Id: Iea46167531e74c6eaffc663adeeb32ffcc4ccb19
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-30 16:03:20 +00:00
Tri Vo
d284817690 Merge "keymint: Clarify usage of certificate tags with importWrappedKey" into main 2023-08-30 15:12:13 +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
Treehugger Robot
7bed173e4c Merge "Only require RKP on T+ chipsets" into main 2023-08-25 19:08:06 +00:00
Seth Moore
8be875e0d0 Only require RKP on T+ chipsets
It turns out we had a bug (b/263844771) in how RKP support was
detected, and that was fixed. However, due to this bug, some S chipests
shipped without RKP support which is now required by the tests.

This change drops the RKP requirement from S chipsets. There should be
no new S chipsets, so this effectively grandfathers in the previous
ones that were skipped by the RKP VTS tests.

T+ tests (both VTS and other suites) will verify that RKP support is
there, so there is no gap introduced by this change.

Bug: 297139913
Test: VtsAidlKeyMintTargetTest
Change-Id: I387e5f058ada698747aac103c1745682291f2d1c
2023-08-25 11:13:41 -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
Treehugger Robot
ee6590ef2d Merge "Fix typo in CDDL" into main 2023-08-25 09:52:42 +00:00