Commit graph

11 commits

Author SHA1 Message Date
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
David Drysdale
8cf2649f8b gatekeeper: generate Rust bindings
Test: TreeHugger
Change-Id: I125a2a682f39070720a3038b9b5e3407b2b467bb
2023-10-30 08:17:12 +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
Eric Biggers
8bf0780fd9 Test that the password isn't truncated (again)
Test that Gatekeeper doesn't truncate passwords, either due to them
containing NUL bytes or being long.

This is https://r.android.com/2151558 ported to the AIDL test.  Even
though the AIDL test wasn't added until after my change, it was forked
from an earlier version of the HIDL test that didn't have my change.

Bug: 238919794
Test: atest VtsHalGatekeeperTargetTest # on Cuttlefish
Change-Id: I6fec951e67a35d5275a67244fbef07d1435c9f4f
2023-08-05 02:47:59 +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
David Drysdale
d84ca74a66 Link static version of KeyMint lib in VTS tests
Also add transitive `secureclock` dep.

Bug: 270492370
Bug: 270484471
Test: VtsHalConfirmationUITargetTest
Test: VtsHalGatekeeperTargetTest
Change-Id: I5fd7cba8af035fde6d24c076c4e1ed90abb15645
2023-02-27 14:26:24 +00:00
Subrahmanyaman
31d630b6aa Updated the comments where the status code is used in other types.
Bug: 205760843
Test: VtsHalGatekeeperTarget
Change-Id: I6a1ed4008989f607a37b53a966b3ba8327cc1381
2023-01-24 19:34:58 +00:00
subrahmanyaman
e840cade52 aidl: corrected ERROR_GENERAL_FAILURE description.
Corrected the description for ERROR_GENERAL_FAILURE error code
to Operation failed.

Bug: 265288984
Test: VtsHalGatekeeperTarget
Change-Id: I0cf3cd01226efae57103ad07149c8ff1bba8dbd5
2023-01-12 14:48:17 +00:00
Tri Vo
f48a2a7bbf Bump Identity and KM AIDL API versions
Imported interfaces are versioned, i.e. bumping an interface version
necessiates bumping the version of importing interfaces.

Keystore and Identity import KM. We are uprevving KM, so all three need
to be bumped at the same time.

Test: m
Change-Id: I46b253e72f2f245bd628ed2ae1f2f4e0572827e7
2022-10-17 15:04:59 -07:00
Subrahmanyaman
afb74878e1 hidl2aidl: conversion of gatekeeper vts tests to use aidl service.
Added vts tests to test the gatekeeper stable aidl implementation.

Bug: 205760843
Test: run vts -m VtsHalGatekeeperTarget
Change-Id: I8ff66855490ec1bd01069512654bbf240773b2dd
2022-09-20 01:20:48 +00:00
Subrahmanyaman
82599ddafa hidl2aidl: conversion of gatekeeper hidl to aidl
Conversion of the gatekeeper hidl interface to stable aidl interface.

Bug: 205760843
Test: run vts -m VtsHalGatekeeperTarget
Change-Id: Iacba60935581c38348437875b452aeb4b5121f9e
2022-09-20 01:19:48 +00:00