David Drysdale 30196cf77c KeyMint: default to Rust reference implementation
Copy code that can be re-used from the Cuttlefish KeyMint
implementation, specifically from the following directories
under device/google/cuttlefish:

- HAL-side code from guest/hals/keymint/rust/
- TA-side code from host/commands/secure_env/rust/

Create a corresponding pair of libkmr_{hal,ta}_nonsecure libraries here.
The only changes to the copied code are:

- Convert `pub(crate)` to `pub` in `attest.rs`.
- Add some missing doc comments.
- Add comment noting need for SELinux permission to read ro.serialno.
- Add comment noting need for clock to be in sync with Gatekeeper.

(A subsequent CL aosp/2852598 adjusts Cuttlefish so that it uses the
copied modules here, and can remove the original copies.)

In addition to the moved code, the default implementation also needs
a new implementation of a monotonic clock, added here in clock.rs
using `std::time::Instant`.

With the new nonsecure HAL and TA libraries in place, implement the
default KeyMint HAL service using the former, and spin up a single
thread running a nonsecure TA using the latter.  Communicate between
the two via a pair of mpsc::channel()s.

Test: VtsAidlKeyMintTargetTest with normal Cuttlefish (all pass)
Test: VtsAidlKeyMintTargetTest with default/nonsecure impl (auth
      tests fail, but this is expected as Gatekeeper hasn't moved)
Bug: 314513765
Change-Id: Ia450e9a8f2dc530f79e8d74d7ce65f7d67ea129f
2024-03-01 07:20:57 +00:00
2023-09-13 21:18:46 +00:00
2023-09-08 20:25:29 +00:00
2023-10-10 10:30:03 +09:00
2023-04-07 23:41:20 +00:00
2023-09-19 23:48:35 +09:00
2023-04-07 23:41:20 +00:00
2024-02-14 09:48:00 +09:00
2023-12-12 18:06:34 +09:00
2023-09-15 13:16:28 +09:00
2023-09-08 21:06:03 +00:00
2024-01-09 14:42:22 -08:00
2023-09-11 17:03:06 +00:00
2023-09-11 16:32:19 +00:00
2022-08-01 16:19:14 +00:00
Description
No description provided
134 MiB
Languages
C++ 56.3%
AIDL 41.2%
C 1.5%
Rust 0.4%
Java 0.4%
Other 0.1%