Commit graph

9159 commits

Author SHA1 Message Date
Eran Messeri
cfe79f1828 Correcting permission check for App UIDs listing
Correct the permission check for the Keystore maintenance method
that returns the list of app UIDs which have keys that are
bound to a specific SID.

The previous check relied on SELinux policies. But the Settings
app that calls this method has a permission - MANAGE_USERS -
that is more appropriate to check.

Bug: 302109605
Test: Manual.
Change-Id: Ia26256cf995d16d03d0bb92d8b237f7bbea30d07
2024-02-06 14:58:09 +00:00
Android Build Coastguard Worker
d1b5531080 Snap for 11406759 from 88d3df423e to 24Q2-release
Change-Id: I073af5679879e0bbcecfc818e0afff0508b67cab
2024-02-06 00:29:17 +00:00
Treehugger Robot
83bb7cc03f Merge "Set the container field of aconfig flags" into main am: 4a8dc192c3 am: 71b89efc7e
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2947640

Change-Id: I09edafc97ad664715090ccd94e98fc06c00c3a45
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05 23:29:09 +00:00
Treehugger Robot
71b89efc7e Merge "Set the container field of aconfig flags" into main am: 4a8dc192c3
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2947640

Change-Id: I6e23ceb71a2c696a764a72ad922c50c316c957c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05 22:49:06 +00:00
Treehugger Robot
4a8dc192c3 Merge "Set the container field of aconfig flags" into main 2024-02-05 22:08:34 +00:00
Stefano Cianciulli
88d3df423e [automerger skipped] Merge "Add libstatspull and libstatssocker to odsign" into main am: a57741efb9 -s ours am: 92296495c5 -s ours
am skip reason: Merged-In I619784b71c0a87574dc633d641aec91da1fc3475 with SHA-1 9987d80385 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/security/+/2942886

Change-Id: I9a52e48380f7d7a4ff33327acbcb8b9ba603d0eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05 11:23:36 +00:00
Stefano Cianciulli
95cbfb707b [automerger skipped] Add libstatspull and libstatssocker to odsign am: 5cacaefd20 -s ours am: a09d6c878c -s ours
am skip reason: Merged-In I619784b71c0a87574dc633d641aec91da1fc3475 with SHA-1 9987d80385 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/security/+/2942886

Change-Id: Ide9d957401b2eeaecf982ba2fa64f241a1ccedb9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05 11:23:28 +00:00
Stefano Cianciulli
92296495c5 [automerger skipped] Merge "Add libstatspull and libstatssocker to odsign" into main am: a57741efb9 -s ours
am skip reason: Merged-In I619784b71c0a87574dc633d641aec91da1fc3475 with SHA-1 9987d80385 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/security/+/2942886

Change-Id: Iea73083f6e4a67441577b917a26af5ffd059a236
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05 10:42:19 +00:00
Stefano Cianciulli
a09d6c878c [automerger skipped] Add libstatspull and libstatssocker to odsign am: 5cacaefd20 -s ours
am skip reason: Merged-In I619784b71c0a87574dc633d641aec91da1fc3475 with SHA-1 9987d80385 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/security/+/2942886

Change-Id: Icdeda328ff756256308160a1ed0ab4b1a89c1c15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05 10:42:12 +00:00
Stefano Cianciulli
a57741efb9 Merge "Add libstatspull and libstatssocker to odsign" into main 2024-02-05 09:56:53 +00:00
Oriol Prieto Gasco
85d84ff9ed Set the container field of aconfig flags
Test: m
Bug: 312769710
Change-Id: I366717c7139886e30360914256ad7710da5095e9
2024-02-03 02:39:40 +00:00
Android Build Coastguard Worker
7b6db8c389 Snap for 11399958 from ecb030613f to 24Q2-release
Change-Id: If7b64fac8507d8b5fa5f24e442cf4377b7dd84bd
2024-02-03 02:24:09 +00:00
Stefano Cianciulli
5cacaefd20 Add libstatspull and libstatssocker to odsign
Bug: 257028435
Test: atest ArtGtestsTargetChroot
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d0737bfd5bd288c291ec454d09e1c80d0a2cc95e)
Merged-In: I619784b71c0a87574dc633d641aec91da1fc3475
Change-Id: I619784b71c0a87574dc633d641aec91da1fc3475
2024-02-02 11:18:15 +00:00
Stefano Cianciulli
ecb030613f [automerger skipped] Add libstatspull and libstatssocker to odsign am: 9987d80385 -s ours
am skip reason: Merged-In I619784b71c0a87574dc633d641aec91da1fc3475 with SHA-1 d0737bfd5b is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/security/+/26097780

Change-Id: Id4714af5490de9e3fe70042ced53fc8d58c5f521
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-02 10:35:50 +00:00
Android Build Coastguard Worker
d49c151736 Snap for 11392706 from b4adac4035 to 24Q2-release
Change-Id: I00538f570551b0a53d167423fb074595070c6200
2024-02-02 00:24:12 +00:00
Stefano Cianciulli
9987d80385 Add libstatspull and libstatssocker to odsign
Ignore-AOSP-First: adding related changes in frameworks/proto_logging
Bug: 257028435
Test: atest ArtGtestsTargetChroot
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d0737bfd5bd288c291ec454d09e1c80d0a2cc95e)
Merged-In: I619784b71c0a87574dc633d641aec91da1fc3475
Change-Id: I619784b71c0a87574dc633d641aec91da1fc3475
2024-02-01 15:57:16 +00:00
Treehugger Robot
b4adac4035 Merge "Replace use of deprecated logging functions" into main am: 2730678378 am: 51a05b61ab
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2939100

Change-Id: I94bc59806ff6be0f2d505434dc13a99d1e47619a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-01 12:25:40 +00:00
Treehugger Robot
51a05b61ab Merge "Replace use of deprecated logging functions" into main am: 2730678378
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2939100

Change-Id: I2bd19f66f96c8a93d4f5b7dca908b547d6a1f3a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-01 11:45:38 +00:00
Treehugger Robot
2730678378 Merge "Replace use of deprecated logging functions" into main 2024-02-01 11:11:14 +00:00
Eric Biggers
19b3b0d894 keystore2: rename MonotonicRawTime to BootTime
Due to https://r.android.com/2822970 ("Use CLOCK_BOOTTIME for keystore2
auth token received time"), MonotonicRawTime now uses CLOCK_BOOTTIME
instead of CLOCK_MONOTONIC_RAW.  Therefore, rename it to BootTime.

Bug: 309686873
Test: atest -p --include-subdirs system/security/keystore2
Change-Id: If1fbbac2eccb03dc7360ae742d79e58f871fb80d
2024-01-31 22:54:54 +00:00
Jeff Vander Stoep
940820cfa1 Replace use of deprecated logging functions
This is needed to upgrade the android_logger crate from 0.12.0
to 0.13.3.

with_max_level provides the same functionality as with_min_level.
The renaming is admittedly confusing, but the new name is accurate
and it makes sense that they deprecated and then removed the
previously poorly named with_min_level.

See crate documentation [1] and code [2].

[1]: https://docs.rs/android_logger/0.12.0/android_logger/struct.Config.html#method.with_min_level
[2]: https://docs.rs/android_logger/0.12.0/src/android_logger/lib.rs.html#227

Bug: 322718401
Test: build and run CF with the change.
Test: m aosp_cf_x86_64_phone
Change-Id: I8d9d7c42100ede48496f9846068ed312fb8a15cb
2024-01-31 10:55:55 +01:00
Stefano Cianciulli
d0737bfd5b Add libstatspull and libstatssocker to odsign
Ignore-AOSP-First: adding related changes in frameworks/proto_logging
Bug: 257028435
Test: atest ArtGtestsTargetChroot
Change-Id: I619784b71c0a87574dc633d641aec91da1fc3475
2024-01-30 09:39:28 +00:00
Android Build Coastguard Worker
64da99925d Snap for 11373247 from 5e05ff0cd3 to 24Q2-release
Change-Id: I38422b30d85bde8bb85e833cead5f93172b9312c
2024-01-30 02:24:18 +00:00
Shaquille Johnson
5e05ff0cd3 Merge "Deprecating the aidl for Android Protected Confirmation" into main am: 53d2763a23 am: 3f433ffc32
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2863108

Change-Id: I4f82edeeeab1a777765117331885c301dc3af5e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-29 15:02:19 +00:00
Shaquille Johnson
3f433ffc32 Merge "Deprecating the aidl for Android Protected Confirmation" into main am: 53d2763a23
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2863108

Change-Id: I799fd3db0051c667445ce76ee4e5c6887fbb8091
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-29 14:21:39 +00:00
Shaquille Johnson
53d2763a23 Merge "Deprecating the aidl for Android Protected Confirmation" into main 2024-01-29 13:49:22 +00:00
Shaquille Johnson
07fec0ff0c Deprecating the aidl for Android Protected Confirmation
Android Protected Confirmation is deprecated due to the high
support/maintenance cost for Android device makers and low adoption rate
among app developers. APC requires Android device makers to have a
substantial amount of device-specific UI code running in the trusted
execution environment. That has proven to be expensive to maintain and
non-scalable, as there cannot be a single implementations device makers
can share or use as a reference. Additionally, app developers have not
adopted this feature, as the Android platform offers other mechanisms
for authentication a user's intent. These mechanisms, such as
authentication-bound Keystore keys, are less secure than Trusted UI, but
are more wide-spread. While we explore alternatives to APC that are
viable to the device makers ecosystem, we sunset the APC API.

Bug: 313856313
Test: atest keystore2_test && atest CtsKeystoreTestCases
Change-Id: If065697ed13e3de706b8dde5cc5e2b6018592018
2024-01-25 16:02:32 +00:00
Android Build Coastguard Worker
c7ed2dce01 Snap for 11355999 from 262237b5b3 to 24Q2-release
Change-Id: Icb17e09929a3fcdb2e5759718aa43a5fd84e4b3b
2024-01-25 02:55:05 +00:00
Eran Messeri
262237b5b3 Merge "List apps affected by secure user ID" into main am: 1841a55ebf am: 2795bb6437
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2921730

Change-Id: Ic55cb9e1c9881b64680cdceda66ab628f7078ea7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-24 18:09:23 +00:00
Eran Messeri
2795bb6437 Merge "List apps affected by secure user ID" into main am: 1841a55ebf
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2921730

Change-Id: I286b41eab78f95590f6aa809ab2a580d558c5d3f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-24 17:27:35 +00:00
Eran Messeri
1841a55ebf Merge "List apps affected by secure user ID" into main 2024-01-24 16:43:36 +00:00
Eran Messeri
4dc27b52eb List apps affected by secure user ID
Add a method to the Keystore maintenance interface to list the UIDs of
apps that are affected by a given secure user ID.

With this method, it would be possible to tell if removing a given
user's LSKF or enrolling new biometrics will invalidate Keystore keys,
thus affecting some apps.

Bug: 302109605
Test: atest keystore2_test
Change-Id: If5888506e0c72a56eca3339778889c7d8038acc5
2024-01-24 14:48:54 +00:00
Android Build Coastguard Worker
7e8207bb7e Snap for 11336776 from 518274f7ce to 24Q2-release
Change-Id: I25afbb5b59ee67c1ef3dc6ff992ca05dd217d54e
2024-01-20 02:24:23 +00:00
Android Build Coastguard Worker
077f47cc4a Snap for 11330025 from 46589b8c19 to 24Q2-release
Change-Id: I31a8f0e375064084373611aff0b23541935fffcd
2024-01-19 00:24:14 +00:00
Eric Biggers
518274f7ce Merge "Fix UnlockedDeviceRequired with weak unlock methods" into main am: 3b862a87dd am: 41f887b7cf
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2906736

Change-Id: Ib09e2efe08d7882f8be13aec1554ab5a6177a816
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-19 00:23:54 +00:00
Eric Biggers
41f887b7cf Merge "Fix UnlockedDeviceRequired with weak unlock methods" into main am: 3b862a87dd
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2906736

Change-Id: I6baebd5d3d7fc2049543ab7189d058aacdce0966
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-18 23:41:59 +00:00
Eric Biggers
3b862a87dd Merge "Fix UnlockedDeviceRequired with weak unlock methods" into main 2024-01-18 22:22:12 +00:00
Eric Biggers
4ef912e00e Merge "keystore: remove unused Keystore1 files" into main am: ed4f8be6be am: 545463ccbb
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2915233

Change-Id: Ie882f84b5948e7edece2ef49c80d69a682790843
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-18 21:47:57 +00:00
Eric Biggers
545463ccbb Merge "keystore: remove unused Keystore1 files" into main am: ed4f8be6be
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2915233

Change-Id: I1a3be97659a324c170d5e559b5047f16867c31af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-18 21:06:17 +00:00
Eric Biggers
ed4f8be6be Merge "keystore: remove unused Keystore1 files" into main 2024-01-18 20:25:36 +00:00
Andrew Walbran
46589b8c19 Merge "Format Android.bp files with bpfmt" into main am: 4a04e9195e am: ce3f70a164
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2913584

Change-Id: I4f9a25163b54aa9f6ee5007b5552ab332881e74f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-18 20:20:00 +00:00
Andrew Walbran
ce3f70a164 Merge "Format Android.bp files with bpfmt" into main am: 4a04e9195e
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2913584

Change-Id: Id99c6ee22e94749a5960cb9bc5bace45e78639be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-18 19:43:12 +00:00
Andrew Walbran
4a04e9195e Merge "Format Android.bp files with bpfmt" into main 2024-01-18 19:01:27 +00:00
Luca Stefani
481b5d663b Format Android.bp files with bpfmt
Change-Id: I083e96e3dd94a48ebad473bcfbbb7fcbb89ce466
2024-01-18 08:34:35 +01:00
Android Build Coastguard Worker
4c5955132f Snap for 11324029 from 3cd9c842c9 to 24Q2-release
Change-Id: I8c9f160ca5a42ec825c80b5d9f3ff3ba78535772
2024-01-18 00:24:26 +00:00
Eric Biggers
c2a146fc92 Merge changes I1a855726,Ib7976671,I76e5ee5a into main am: 0e77b347e7 am: 49a251f117
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2912655

Change-Id: I1a8c99b667a0fe8b45119ef05f3ba42e1b356784
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 23:12:20 +00:00
Eric Biggers
6946daa1ab Fix UnlockedDeviceRequired with weak unlock methods
Starting in Android 12, unlocking the device with a class 1
("convenience") biometric, class 2 ("weak") biometric, or a trust agent
unexpectedly doesn't allow the use of UnlockedDeviceRequired keys.  The
cause of this bug is that the cryptographic protection that Keystore now
applies to UnlockedDeviceRequired keys incorrectly assumes that the
device can only be unlocked using LSKF or via a biometric that
participates in Keystore (has a SID and uses HardwareAuthTokens).
Actually, Keyguard also allows the device to be unlocked using weaker
biometrics that do not particiate in Keystore, if they are enrolled.
Similarly, there are also cases where a trust agent can actively unlock
the device, e.g. unlocking a phone using a paired watch.

In combination with the system_server changes in
I34dc49f1338e94755e96c1cf84de0638dc70d311, this CL fixes the bug by
making Keystore retain the UnlockedDeviceRequired super keys in memory
if a weak unlock method is enabled at device lock time.  This does mean
that UnlockedDeviceRequired is enforced only logically when a weak
unlock method is enabled, but this is the best we can do in this case.

This CL also adds methods by which Keystore can be notified of the
expiration of unlock methods, causing the security level of
UnlockedDeviceRequired keys to be upgraded.  A future CL for
system_server is planned to use these.

Test: see I34dc49f1338e94755e96c1cf84de0638dc70d311
Bug: 296464083
Change-Id: I1b0d9ec4f9e31dc91642e865045766bd17e34cad
2024-01-17 22:51:37 +00:00
Eric Biggers
74b6c752da keystore: remove unused Keystore1 files
Remove files from the "keystore" directory that are unused, i.e. not
referenced by an Android.bp, or in the case of header files not included
from anywhere.  This mostly includes files belonging to Keystore1 that
were missed when Keystore1 was deleted.  This also includes a couple
outdated test scripts that were never actually wired up to anything.

Bug: 171305684
Test: m; mmm system/security
Change-Id: Ie31f773b5f15b0a0f95dffa9cad109fbf3a84970
2024-01-17 22:38:36 +00:00
Eric Biggers
49a251f117 Merge changes I1a855726,Ib7976671,I76e5ee5a into main am: 0e77b347e7
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2912655

Change-Id: Ie1183739d25cccea727d3599c11827f81fc0c4d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 22:30:02 +00:00
Eric Biggers
0e77b347e7 Merge changes I1a855726,Ib7976671,I76e5ee5a into main
* changes:
  keystore: remove misleading error message from AES_gcm_decrypt()
  keystore: eliminate redundant key stretching
  keystore: rename the PBKDF2 functions
2024-01-17 21:49:02 +00:00