platform_system_security/keystore2
Eric Biggers b5613dae22 Remove broken and unused support for expiring keys when off-body
Remove IKeystoreMaintenance#onDeviceOffBody(), as it's no longer called.

In addition, remove the code that tried to enforce the AllowWhileOnBody
key parameter.  This code was broken during the rewrite of Keystore in
Android 12, and as a result, AllowWhileOnBody has no user-visible
effect.  AllowWhileOnBody is *supposed* to cause the key's
authentication timeout, if it has one, to automatically expire when the
device is removed from the user's body.  (A better name for it might
have been something like UserAuthenticationExpiresWhenRemovedFromBody.)
Android 11 Keystore implemented this behavior; see
https://android.googlesource.com/platform/system/security/+/refs/heads/android11-release/keystore/auth_token_table.cpp#165

Android 12 Keystore changed AllowWhileOnBody to have no effect.
Apparently due to a misunderstanding, the (incorrect) behavior that was
attempted to be implemented was "The key may be used after
authentication timeout if device is still on-body".  But what was
actually implemented was that the Keystore daemon stopped enforcing
authentication timeouts for AllowWhileOnBody keys entirely, except after
a wearable device was removed from the body in which case the timeout is
enforced for any earlier authentications.  Yet, this has no user-visible
effect because KeyMint still enforces the authentication timeout as
usual.  So, AllowWhileOnBody has really been a no-op since Android 12.

We can always bring this code back, fixed and with tests, if this
feature comes back.  But for now there is no reason to keep it around.

Bug: 289849354
Test: atest -p --include-subdirs system/security/keystore2
Test: atest CtsKeystoreTestCases
Change-Id: I4a7b3a90b56dacbb5316e30a30bf3fabc0debe48
2024-03-14 17:43:49 +00:00
..
aaid Format Android.bp files with bpfmt 2024-01-18 08:34:35 +01:00
aconfig Set the container field of aconfig flags 2024-02-03 02:39:40 +00:00
aidl Remove broken and unused support for expiring keys when off-body 2024-03-14 17:43:49 +00:00
apc_compat Format Android.bp files with bpfmt 2024-01-18 08:34:35 +01:00
legacykeystore Fix style warnings for rustc 1.76.0 2024-02-28 21:53:07 +00:00
message_macro [refactor] Split the message macro in a standalone library for reuse 2023-11-07 13:47:54 +00:00
rkpd_client Make librkpd_client available to com.android.virt 2023-11-13 10:31:19 +00:00
selinux Replace use of deprecated logging functions 2024-02-07 14:33:36 +01:00
src Remove broken and unused support for expiring keys when off-body 2024-03-14 17:43:49 +00:00
test_utils Fixes for the issues found while running Keystore2 client tests on a 2024-02-19 20:24:47 +00:00
tests Merge "Added not_multi_abi configuration for keystore2_client_tests module." into main 2024-03-06 20:37:33 +00:00
watchdog Replace use of deprecated logging functions 2024-02-07 14:33:36 +01:00
Android.bp Migrate structured logging for audit logging to the Rust macro. 2024-03-07 16:56:22 +00:00
android.system.keystore2-service.xml Add new error for system errors that are retryable 2024-01-12 15:50:54 +00:00
keystore2.rc Increase RLIMIT_MEMLOCK for keystore2 2023-12-04 19:43:16 +00:00
OWNERS Adding an OWNERS file as requested in b/288143537 2023-06-30 21:42:52 +00:00
rustfmt.toml Run rustfmt and add rustfmt.toml to directory 2022-09-19 11:23:31 +00:00
TEST_MAPPING [rkpd] Refactor rkpd_client into an independent lib for reuse 2023-11-13 10:31:08 +00:00