Commit Graph

1090 Commits

Author SHA1 Message Date
David Drysdale
6c4bc494ee Merge "Delete standard output in VtsAidlKeyMintTargetTest" into main am: fd7119ea67 am: 77c246444b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3088725

Change-Id: I700c9aa0e817c21ac50e3d0ecfc9d757b659390f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 06:26:27 +00:00
David Drysdale
fd7119ea67 Merge "Delete standard output in VtsAidlKeyMintTargetTest" into main 2024-05-17 05:59:57 +00:00
Alice Wang
59e2a0804f Merge "Run VtsHalRemotelyProvisionedComponentTargetTest only on V+ devices" into main am: 938c0177e3 am: 04e1d59cdc
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3084447

Change-Id: Ib95a67a47d94f33e756b3e9d017525e9cd66f338
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 08:07:47 +00:00
Alice Wang
46ff286f6d Run VtsHalRemotelyProvisionedComponentTargetTest only on V+ devices
Bug: 340188780
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Id20a01b23324eb46620d96bd29c30b8cf9acd162
2024-05-15 15:27:26 +00:00
Huang Rui
ca3ea117ef Delete standard output in VtsAidlKeyMintTargetTest
The Done flag of VtsAidlKeyMintTargetTest is false during running
the module with ‘--collect-tests-only’ because it uses standard
output to print logs.

Bug: 340576534
Test: run vts -m VtsAidlKeyMintTargetTest --collect-tests-only

Change-Id: I3d81f7e59b6189fab1b146320263509f2694c11e
Signed-off-by: Huang Rui <rui1.huang@intel.com>
Signed-off-by: Liu Kai <kai1.liu@intel.com>
2024-05-15 11:42:59 +01:00
Treehugger Robot
4446dd1c04 Merge "insecure keymint: in-process initialization ordering" into main am: 75b081dad1 am: 67a1607700
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3077417

Change-Id: I78f616c287983d9edb5b973d4b74fbe8f038d793
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-08 19:16:16 +00:00
A. Cody Schuffelen
fbc3089310 insecure keymint: in-process initialization ordering
This creates an ordering of

1. In-memory HALs are initialized
2. Secure AIDL HALs are exposed

There are some dependencies on the information, e.g.

Boot info:
https://cs.android.com/android/platform/superproject/main/+/main:system/keymint/ta/src/keys.rs;l=705;drc=72ed18b226a9944330ecd97d776d57ea1b2eb9e8
https://cs.android.com/android/platform/superproject/main/+/main:system/keymint/ta/src/lib.rs;l=356;drc=4f8cad1bf0b3392414e5735b95a7c5d80d64d6e6
https://cs.android.com/android/platform/superproject/main/+/main:system/keymint/ta/src/rkp.rs;l=75;drc=747e5931be387fb600f6865d2308390646243610

HAL info:
https://cs.android.com/android/platform/superproject/main/+/main:system/keymint/ta/src/rkp.rs;l=79;drc=747e5931be387fb600f6865d2308390646243610

Bug: b/339121782
Test: launch_cvd --resume=false --secure_hals=oemlock:guest_insecure_keymint:guest_insecure_gatekeeper
Change-Id: Ifbe8655bf14c248e886725217d261dae5458e15f
2024-05-07 16:56:42 -07:00
Treehugger Robot
db71f8424a Merge "Fix formatting around rkp-vm tag" into main am: 26b5ae0fc2 am: 6dfe13ebed
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3064428

Change-Id: Iaa78a2389ca568e131066948265b73f73441639c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-30 10:56:45 +00:00
Seth Moore
8e57f5e434 Fix formatting around rkp-vm tag
Change-Id: I5d073427204596bc86e11d550e86da4c56745f72
2024-04-29 19:04:20 +00:00
David Drysdale
0e77465013 Merge "KeyMint: more warnings around non-secure test impl" into main am: b2adc861ee am: 7bb131aa12
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2991691

Change-Id: I2832009aa12895037aff5f2db4fb431827dd3a16
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-29 07:57:20 +00:00
David Drysdale
b2adc861ee Merge "KeyMint: more warnings around non-secure test impl" into main 2024-04-29 07:25:08 +00:00
David Drysdale
350150546d Merge "KeyMint: test for unique HMAC results" into main am: e4d1d2dec7 am: 81a12dd31a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3055482

Change-Id: I803ae94110890599c9ef151f60fde13bcad81fea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-29 06:50:50 +00:00
David Drysdale
33a132f13f KeyMint: more warnings around non-secure test impl
Make it clearer that the default implementation is non-secure in
various ways, most notably because the TA code is running in-process
in the HAL service.

Bug: 314513765
Test: VtsAidlKeyMintTargetTest
Change-Id: I83509110c32a4df8df6c0b288d14659e022442ff
2024-04-29 07:09:34 +01:00
David Drysdale
b4598740de KeyMint: test for unique HMAC results
Bug: 218713582
Test: VtsAidlKeyMintTargetTest
Change-Id: I5babfa67e707dc1bf15dd40b1ee4c8c8b97f44a7
2024-04-25 10:00:05 +01:00
Cody Schuffelen
1e3f885162 Merge "C++ AIDL on-device GateKeeper / SharedSecret impl" into main am: e23e450487 am: e6273eff1d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3023986

Change-Id: I6bda0795988c354187e4b4903be553cc42a780d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-14 22:44:43 +00:00
A. Cody Schuffelen
097e625335 C++ AIDL on-device GateKeeper / SharedSecret impl
Because Keystore2 always requires valid auth tokens for user keys, this
copies and extends the existing in-guest GateKeeper implementation to
negotiate a shared secret key with Keymint in order to generate a
session key for signing auth tokens.

This implementation also uses AIDL rather than HIDL to interact with the
framework. It's also packaged in an APEX.

The files are cobbled together from a few sources:

- SoftGateKeeper.h is based on hardware/interfaces/gatekeeper/1.0/software/SoftGateKeeper.h
- GateKeeper.{cpp,h} are based on device/google/cuttlefish/guest/hals/gatekeeper/remote/remote_gatekeeper.{cpp,h}
- SharedSecret.{cpp,h} are based on device/google/cuttlefish/guest/hals/keymint/remote/remote_shared_secret.{cpp,h}
- Apex files are based on device/google/cuttlefish/guest/hals/keymint/rust/

Keymint modifications to use BOOT_TIME are lifted from

https://android-review.git.corp.google.com/c/platform/hardware/interfaces/+/2856649/6..8/security/keymint/aidl/default/ta/clock.rs#38

Bug: 332376454
Change-Id: I81845d5e6370bdddb1a24d67437964e03a5fb243
Test: Run with rust-nonsecure keymint on Cuttlefish
2024-04-11 13:53:32 -07:00
Seth Moore
923e2a6183 Merge "Allow RKP-only devices to pass keymint VTS" into main am: fae563acb0 am: dc2d3dfbdb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3029929

Change-Id: Iec1433c892be25669adf00a75a7c86ccffbd32d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-09 16:14:35 +00:00
Seth Moore
fae563acb0 Merge "Allow RKP-only devices to pass keymint VTS" into main 2024-04-09 15:31:26 +00:00
David Drysdale
589f7ac4d5 Merge "Make batch attestation keys/certs optional" into main am: 61c9ab4d87 am: 9985cdb9e1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3002898

Change-Id: I91627fad20c36b111714ac20739b3dec8ad540f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-09 09:34:00 +00:00
David Drysdale
61c9ab4d87 Merge "Make batch attestation keys/certs optional" into main 2024-04-09 09:11:54 +00:00
Nikolay Elenkov
ea595e8e4f Merge "Enable Java backend for ISecretKeeper" into main am: 6e71b471a9 am: 7243db7045
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3007148

Change-Id: I27e6da54bed1b5fec01ef6f5a7582aedba4e01a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-09 02:20:53 +00:00
Nikolay Elenkov
6e71b471a9 Merge "Enable Java backend for ISecretKeeper" into main 2024-04-09 01:59:35 +00:00
Seth Moore
c5c52ce1d3 Allow RKP-only devices to pass keymint VTS
Add test paths for HALs that are RKP-only so that they may pass tests.

Fix up a few tests that were just being skipped for RKP-only HALs.

Test: ran VTS against cuttlefish with no factory key
Bug: 329409739
Change-Id: I5400874dd2f9885c061970a30ea44985353d23ed
2024-04-08 12:38:20 -07:00
David Drysdale
fe5f33a61e Make batch attestation keys/certs optional
Test: VtsKeyMintTargetTest
Bug: 329399923
Bug: 329269183
Change-Id: I4ef49fcbda7a69ea5623c084e276eb64d34c5813
2024-04-05 16:54:31 +00:00
Charisee Chiw
00557198eb Merge "Update needed for Rust v1.77.1" into main am: 0c2179c224 am: 7dfc18cd09
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3026125

Change-Id: Iad1047e9613c55cce51e294b2582c7c3fdfe89b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-04 18:35:16 +00:00
Charisee
5fc736d96d Update needed for Rust v1.77.1
error: field `0` is never read
  --> hardware/interfaces/security/keymint/aidl/default/main.rs:38:24
   |
38 | struct HalServiceError(String);
   |        --------------- ^^^^^^
   |        |
   |        field in this struct
   |
   = note: `HalServiceError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
38 | struct HalServiceError(());
   |                        ~~

error: aborting due to 1 previous err


Bug: http://b/330185853
Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz  --target aosp_cf_x86_64_phone --image
Change-Id: I57f3bd1d702c97929f5fd34f909aa72aa2f2ba02
2024-04-03 20:05:19 +00:00
Treehugger Robot
95f6cc8bd2 Merge "Package the rust_nonsecure keymint default HAL in an APEX" into main am: d741ab8a51 am: 780804059f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3017012

Change-Id: Iee3e2172174926dd6d494416d86408dfe8934cd1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-30 10:45:33 +00:00
Treehugger Robot
d741ab8a51 Merge "Package the rust_nonsecure keymint default HAL in an APEX" into main 2024-03-30 10:06:52 +00:00
Treehugger Robot
b68cf21914 Merge "Remove unnecessary "_external" suffix from libcppbor" into main am: 86d8bf593a am: 3e3c194ec3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3019944

Change-Id: I6e94b39523a0ad54d9c31cad6172c26bca6d936d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-29 21:46:08 +00:00
Treehugger Robot
86d8bf593a Merge "Remove unnecessary "_external" suffix from libcppbor" into main 2024-03-29 21:18:28 +00:00
A. Cody Schuffelen
895ba8bdfa Package the rust_nonsecure keymint default HAL in an APEX
This will make it easier to swap in and out with the Cuttlefish remote
implementation.

Bug: 331474817
Test: m com.android.hardware.keymint.rust_nonsecure
Change-Id: I0e9a350b62a90ef6126db109195e19b4181d0cf8
2024-03-29 11:48:31 -07:00
Treehugger Robot
d1c156be22 Merge "Remove reference to factory reset of K" into main am: c523f76846 am: 938d7e68e0
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2502335

Change-Id: I66527c4afa7d69f76131caf1d446a59b2109580d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-29 03:39:09 +00:00
Shawn Willden
98125926c1 Remove unnecessary "_external" suffix from libcppbor
Test: Build
Change-Id: Ied163d1f40c3b86d7b85cae1700310f5cb674e2d
2024-03-28 20:42:34 -06:00
Shawn Willden
deaa5dd808 Remove reference to factory reset of K
The ISharedSecret.aidl description of the pre-shared secret K
mentioned that K was set up during factory reset.  While that could be
done, it is almost never done; most OEMs inject K in the factory.
Removed the reference to setup in factory reset to reduce confusion.

Test: N/A, comment-only change
Change-Id: Idbbd5a8d64197ef4713a75075a9730d06162ad05
2024-03-29 01:22:06 +00:00
Treehugger Robot
7f788a7bb0 Merge "Update needed for Rust v1.77.0" into main am: f814c97702 am: 1a67e24cb7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3017016

Change-Id: Ib28f40dd6b807fef8d137d48035f2066eefe553d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-28 07:01:18 +00:00
Charisee
c3a74935a1 Update needed for Rust v1.77.0
error: field `0` is never read
  --> hardware/interfaces/security/authgraph/default/src/main.rs:34:24
   |
34 | struct HalServiceError(String);
   |        --------------- ^^^^^^
   |        |
   |        field in this struct
   |
   = note: `HalServiceError` has derived impls for the traits `Clone` and `Debug`, but these are intenti
onally ignored during dead code analysis
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field
 numbering, or remove the field
   |
34 | struct HalServiceError(());
   |                        ~~

error: aborting due to 1 previous error


Test: ./build.py --lto thin

bug: http://b/330185853
Change-Id: I08b79176fb5edea9e24990e4884e521c24660d68
2024-03-27 22:58:56 +00:00
David Drysdale
1140c9623d Merge "Secretkeeper: more VTS tests" into main am: c8b02ff6e7 am: 27d3d27cc4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3000947

Change-Id: Ib3650363b229dafdc47ac509526d622cde04bdeb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-27 12:51:29 +00:00
David Drysdale
c8b02ff6e7 Merge "Secretkeeper: more VTS tests" into main 2024-03-27 12:22:06 +00:00
A. Cody Schuffelen
7550cc0225 Fix .rc file for keymint-service.nonsecure am: ddc6a8dbdf am: 34781e1bbb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3015573

Change-Id: Idad6e8a9cc8493b00a0eadad053b2e08557940e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-27 09:40:21 +00:00
Nikolay Elenkov
03cf716392 Enable Java backend for ISecretKeeper
Bug: 324321147
Test: Manual -- trigger factory reset, confirm ISecretKeeper.deleteAll()
is being called in Trusty logs.

Change-Id: I0f033b53e83ff549f80271ba4a6ebeabac3db922
2024-03-27 06:51:05 +00:00
A. Cody Schuffelen
ddc6a8dbdf Fix .rc file for keymint-service.nonsecure
This target was using the same `.rc` as the keymint-service target,
though it had a different name.

Bug: 331474817
Test: LOCAL_KEYMINT_PRODUCT_PACKAGE=android.hardware.security.keymint-service.nonsecure m && launch_cvd --noresume --secure_hals=keymint,oemlock
Change-Id: I0f744b75e451f6780d8f6c9bddbd5ea80c579a20
2024-03-26 15:40:37 -07:00
Andrew Scull
f50a2e1c2d Merge "Require proper DICE if StrongBox is present" into main am: 6cb40f35b6 am: ce5c85e2c3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3009660

Change-Id: I6966aa039553123f5ce9bc8cc1f665d19f853f9d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-25 21:32:35 +00:00
Andrew Scull
2146152db9 Require proper DICE if StrongBox is present
If a decice provides a StrongBox KeyMint instance then the default IRPC
instance is required to use a proper, non-degenerate DICE chain.

Expose a function to check whether the CSR contains a proper DICE chain
and use that from VTS to implement the test.

Bug: 302204396
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I90cf070bc2279fc52e0a8e7fd0039d3fdb68c1d7
2024-03-25 18:16:24 +00:00
Tri Vo
c49bc4764b Tests for imported wrapped RSA and EC keys am: b02ff886be am: a1e3ba1cbd
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2769758

Change-Id: I05082f74b9c2283b0f84c1951c6d47f4c00b25ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-14 15:59:37 +00:00
David Drysdale
5f4493d75b Secretkeeper: more VTS tests
Add tests for:
- large number of session creations
  - also use a bigger identity, to better simulate real use
- attempt to retrieve a secret with an incorrect identity

Test: VtsSecretkeeperTargetTest (shiba)
Bug: 327526008
Change-Id: I8dddf643d03a8fb679511564cb03c2248477c116
2024-03-14 15:00:37 +00:00
Tri Vo
b02ff886be Tests for imported wrapped RSA and EC keys
Only applies for devices on VSR API level 35 and above, so that existing
devices which previously passed VTS should not need to pass the new
tests.

Bug: 292534977
Test: VtsAidlKeyMintTargetTest
Change-Id: I8281c3cebf05795e3f9a1ed2b112fc149d8a104c
2024-03-14 13:04:16 +00:00
Seth Moore
a5f0340d01 Update docs to use the correct canonicalization reference am: fcff3dd6c7 am: dc3733e189
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2994271

Change-Id: I557c93de4aab496cb9d8eea282ace3d4961bed1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-08 19:40:00 +00:00
Seth Moore
fcff3dd6c7 Update docs to use the correct canonicalization reference
Bug: 325906414
Change-Id: I1eb5bc52df4627c713bb2611101e2c3238ac7b9d
2024-03-08 14:10:49 +00:00
David Drysdale
151c372fb9 Merge "Reinstate C++ KeyMint impl as default" into main am: 1e6a078326 am: cde647a820
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2994049

Change-Id: Ie00152dfbed80a0020be3d2276a09f5c44cfb08a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-07 13:59:07 +00:00
David Drysdale
764199f2c9 Reinstate C++ KeyMint impl as default
This is a partial revert of aosp/2856649, changeID
Ia450e9a8f2dc530f79e8d74d7ce65f7d67ea129f, because it turns out
that there are Wear devices that are using the default implementation
(but which are not covered by TreeHugger/presubmit).

It restores the C++ implementation for KeyMint as
android.hardware.security.keymint-service, but preserves the Rust
libraries that were moved here in that CL as a subsequent CL
(aosp/2852598) means that Cuttlefish now uses the libraries here.

Test: VtsAidlKeyMintTargetTest on Cuttlefish
Bug: 328251011
Bug: 314513765
Change-Id: Id6f3491144588e418cd6e18e51262fe839bfdf39
2024-03-07 10:33:22 +00:00