Commit graph

8612 commits

Author SHA1 Message Date
Roland Levillain
89e7cddf9c Merge "Update OWNERS files under system/security." into main 2024-01-03 14:21:12 +00:00
Roland Levillain
d5efc86c25 Update OWNERS files under system/security.
Test: n/a
Change-Id: Ic0e0d868eb715e20f41e14ee5146d54dded2e43b
2024-01-03 13:05:38 +00:00
Shaquille Johnson
df2668bd96 Merge "When wal flag not enabled set db back to default" into main 2023-12-28 15:25:08 +00:00
Treehugger Robot
d315965968 Merge "Rename bssl-ffi to bssl-sys" into main 2023-12-21 21:48:19 +00:00
Shaquille Johnson
52b8c9321b When wal flag not enabled set db back to default
When a database is set once it will still maintain that
setting even if on the next connection it is not specified.
Any databases that set the wal flag will need to turn the
database back to its default when the flag is disabled or
there will be an error in the access of the database.

Bug: 314419678
Test: atest keystore2_test && atest legacykeystore_test
Change-Id: I008f2d2f6ac055704b721cdd451fc8bdfe448832
2023-12-21 18:30:50 +00:00
Ludovic Barman
c41feb0932 Merge "Remove unused use_protobuf3 flag" into main 2023-12-20 15:27:57 +00:00
Treehugger Robot
0ac69e8ba3 Merge "Changes made to compile keystore2_client_tests module with compile_multilib set to first." into main 2023-12-19 15:44:36 +00:00
Robert Shih
156716d72e Merge "rkp_factory_extraction_tool: log description when binder fails" into main 2023-12-19 05:00:44 +00:00
Robert Shih
6c3e15b8ac rkp_factory_extraction_tool: log description when binder fails
Service specific error will be part of the description if applicable.

Bug: 312671886
Test: adb shell rkp_factory_extraction_tool
Change-Id: I071cf8bd892c3731de052dafb69a7d2029bf8b03
2023-12-18 20:09:14 -08:00
Maurice Lam
47b4facecf Rename bssl-ffi to bssl-sys
Test: TreeHugger
Change-Id: Ie8108ef5d5f8e6c8252409d1e9aceb76613dff9f
2023-12-18 23:28:21 +00:00
Ludovic Barman
6f86b6031c Remove unused use_protobuf3 flag
This is a No-op.
Protobuf3 is used regardless of this flag since https://android-review.git.corp.google.com/c/platform/build/soong/+/2817733
Test: m rust

Bug: 308790516
Change-Id: Icd38fa3976d93af730c315a112d50591fe9d00c5
2023-12-16 10:56:12 +00:00
Rajesh Nyamagoud
b061f9cf67 Changes made to compile keystore2_client_tests module with
compile_multilib set to first.

To avoid missing dependent library (libkeymaster_portable.so) error,
enforcing to compile for 64-bit on a 64-bit platform, and 32-bit on
a 32-bit platform.

Bug: 314110490
Test: run vts -m keystore2_client_tests
Change-Id: I5e8bf94ed37209f69ace2d7dd2c0ca1b680fc86d
2023-12-15 02:48:01 +00:00
Henri Chataing
76cd505946 Merge "Update fmtlib to 10.1.1" into main 2023-12-14 18:47:39 +00:00
Eran Messeri
5704b7ebae Merge "Updated libkeystore-engine library to be cc_test_library instead of cc_library_shared." into main 2023-12-13 19:16:18 +00:00
Rajesh Nyamagoud
21e7cadafd Updated libkeystore-engine library to be cc_test_library instead of
cc_library_shared.

Since libkeystore-engine used only in keystore2_client_tests test
module, creating it as cc_test_library.

Bug: 298668920
Test: atest keystore2_client_tests
Change-Id: I656e989186610266c8a59ac11db8ac8a47d3514f
2023-12-12 18:34:14 +00:00
Eric Biggers
93a028a391 Merge "Increase RLIMIT_MEMLOCK for keystore2" into main 2023-12-12 17:43:43 +00:00
Seth Moore
2dba2d9092 Merge "Add parameter for serial number property to rkp tool" into main am: 670aca611d
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2861555

Change-Id: Ide067532b43de0eae3cc59bf9f2a15fe16e8aeb8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-07 19:53:00 +00:00
Seth Moore
670aca611d Merge "Add parameter for serial number property to rkp tool" into main 2023-12-07 19:14:37 +00:00
Eric Biggers
d736af9e43 Merge "Split Keystore's onLockScreenEvent into onDevice{Unlocked,Locked}" into main am: a2609f539d
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2855064

Change-Id: Ib7977850d20b247dda3c809e0040d1863327b717
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-07 18:31:25 +00:00
Eric Biggers
a2609f539d Merge "Split Keystore's onLockScreenEvent into onDevice{Unlocked,Locked}" into main 2023-12-07 17:57:55 +00:00
Henri Chataing
ecaf5c8420 Update fmtlib to 10.1.1
Test: m
Change-Id: I75e5e3e2dc3f7608872f36c8fe3894f988a7b9d5
2023-12-07 17:41:48 +00:00
chuanchuan.gao
8ef6d1a6be Add parameter for serial number property to rkp tool
[Description]
1.Add patch to modify rkp_factory_extraction_tool, so
 that it can meet TV customer's factory product line.
2.Introduce a new input parameter, serialno_prop,
to the function jsonEncodeCsrWithBuild.
3.Use the new property of serialno_prop if it is set,
otherwise defaults to "ro.serialno".

Test:
1.build pass
2.AC on/off pass
3.run "rkp_factory_extraction_tool
--output_format build+csr
--serialno_prop $(customer_prop) > csr.json" pass
4.run "rkp_factory_extraction_tool
--output_format build+csr > csr.json" pass
5.VtsHalRemotelyProvisionedComponentTargetTest pass
6.libkeymint_remote_prov_support_test pass
7.VtsAidlKeyMintTargetTest pass

Bug: 313811996
Change-Id: I261f7ae1b3b4c3e2776ec4013c77b7be355477cf
2023-12-07 18:21:15 +08:00
Eric Biggers
2202fcc19f Increase RLIMIT_MEMLOCK for keystore2
By default Android only allows processes to lock up to 65536 bytes of
memory, resulting from the command 'setrlimit memlock 65536 65536' in
system/core/rootdir/init.rc.  The recent Keystore changes to create each
user's super keys at user creation time cause Keystore to sometimes lock
more memory and sometimes exceed this limit.  To reproduce this issue
myself, I had to create almost 100 users.  However, it apparently can
happen with fewer users too, based on CTS test failure report.

Fix this issue by setting the memlock limit for keystore2 to unlimited.
Note that the amount actually used remains fairly small, but I don't
think there's a reason to set an arbitrary limit here.  A memlock limit
makes sense for unprivileged apps but not for system processes.

Bug: 296464083
Bug: 314474709
Bug: 314561033
Test: adb shell setprop debug.user.creation_override 1
      for i in `seq 1 100`; do adb shell pm create-user --profileOf 0 --managed profile; done
      adb logcat | grep -i keystore
      # Saw ENOMEM error near the end without this CL, but not with it.
Flag: Not feasible to flag this CL, and it's a pretty safe change.
Change-Id: I3ef062d737ffb1431dca78c0d568ad6c2d713de6
2023-12-04 19:43:16 +00:00
Eric Biggers
10afa966fa Split Keystore's onLockScreenEvent into onDevice{Unlocked,Locked}
Currently Keystore is notified of the device being unlocked and locked
for each user via onLockScreenEvent(lockScreenEvent, userId, password,
unlockingSids), where lockScreenEvent is UNLOCK or LOCK.  This is a bit
confusing because the password parameter is only meaningful for UNLOCK,
and the unlockingSids parameter is only meaningful for LOCK.  This
problem will get worse when we add a parameter that tells Keystore
whether unlocking via a weak biometric or trust agent is possible, as
that will be another parameter that is only meaningful for LOCK.

Therefore, this CL splits onLockScreenEvent into two methods
onDeviceUnlocked and onDeviceLocked, each with the appropriate
parameters.  No change in behavior intended.

Bug: 296464083
Test: atest -p --include-subdirs system/security/keystore2 \
      && atest CtsKeystoreTestCases \
      && atest TrustTests \
      && atest com.android.server.locksettings
Flag: N/A, straightforward refactoring
Change-Id: Ie2afd118bddca6112a5469558569c63b68ee10fb
2023-12-02 03:05:43 +00:00
Shaquille Johnson
a96ee28bf2 Merge "Remove duplicate code and add fn for flag check" into main am: 6f80e95312
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2852952

Change-Id: I45fbbdd55db2326ffa6f03b1fe1e1b09a2a0925c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 16:13:21 +00:00
Shaquille Johnson
6f80e95312 Merge "Remove duplicate code and add fn for flag check" into main 2023-12-01 15:22:59 +00:00
Shaquille Johnson
f015af1d56 Remove duplicate code and add fn for flag check
Test: atest CtsKeystoreTestCases
Change-Id: I47975e028896ebe5777bae8efe8b17507bb36500
2023-11-30 15:23:21 +00:00
Eric Biggers
d4553715a3 Merge "Rename the fix_unlocked_device_required_keys flag" into main am: 4835baecd7
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2843813

Change-Id: I672f702632447e66fa34eed4b866ea75497dc6e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-30 00:21:18 +00:00
Eric Biggers
4835baecd7 Merge "Rename the fix_unlocked_device_required_keys flag" into main 2023-11-29 23:28:13 +00:00
Shaquille Johnson
abfc6f99d1 Merge "Deprecate put and return error in ILegacyKeystore" into main am: 2dc300aee0
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2797796

Change-Id: I0c99eff2ad660c565b2dba1c8e41293c33a7394d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-28 17:41:16 +00:00
Shaquille Johnson
2dc300aee0 Merge "Deprecate put and return error in ILegacyKeystore" into main 2023-11-28 16:13:22 +00:00
Shaquille Johnson
be6e91d15f Deprecate put and return error in ILegacyKeystore
Legacy keystore is a old relic that was suppoed to be
disabled a while ago. It has enabled functionality that was
supposed to be removed but wasn't because it would break
changes in the VPN and WIFI code. This would begin the
process of permanently removing it.

Test: atest CtsKeystoreTestCases
Change-Id: Iedc1dca24a40eb0cf30c5280fc2842ff79cf7f17
2023-11-28 15:12:04 +00:00
Shaquille Johnson
c705c146ba Merge "Rename flag wal_db_journalmode" into main am: 9c7503368f
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2843638

Change-Id: I57212c35ffd8b6ca9fe930480ce1ff3b9b132d60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-27 17:14:26 +00:00
Shaquille Johnson
9c7503368f Merge "Rename flag wal_db_journalmode" into main 2023-11-27 16:07:15 +00:00
Shaquille Johnson
d28f5cbe9b Rename flag wal_db_journalmode
This flag was defined as a regular flag and then was later changed to a
fixed_read_only flag.  This scenario is currently "unsupported" by the
flags infrastructure; an error occurs when trying to advance the flag to
staging. Work around this by renaming the flag so that the flags
infrastructure sees it as an entirely new flag. This cl adds this flag
to the legacykeystore code as well.

Bug: 296464083
Bug: 311648623
Test: m keystore2
Change-Id: If62a5fac2404113ca0bbc0807f154401c4241bf1
2023-11-27 12:17:13 +00:00
Alice Wang
7835719ca7 Merge "[keystore2] Update comment when fetching rkpd attestation key" into main am: 0ecec06af2
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2845534

Change-Id: Ic9875170ce43bd7cce719d53daeb77e978f22e6b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-24 16:19:06 +00:00
Alice Wang
0ecec06af2 Merge "[keystore2] Update comment when fetching rkpd attestation key" into main 2023-11-24 15:40:49 +00:00
Alice Wang
f7148408b5 [keystore2] Update comment when fetching rkpd attestation key
No code change.

Test: atest keystore2_test
Bug: 310047761
Change-Id: I4269bd4bc146ac0d0aa7b5ca9af93957399aa7b6
2023-11-24 08:36:51 +00:00
Treehugger Robot
ab102cfc7b Merge "Fix android.keystore.cts.KeyAttestationTest" into main am: 111900fbc6
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2843680

Change-Id: Id2497d12d94a7f49178ac45b2b66696535304ee8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-23 13:47:46 +00:00
Treehugger Robot
111900fbc6 Merge "Fix android.keystore.cts.KeyAttestationTest" into main 2023-11-23 13:04:09 +00:00
Alice Wang
b03ed83251 Fix android.keystore.cts.KeyAttestationTest
This cl moves the RPC name searching logic inside the attestation
key fetch function to fix the failing tests.

Test: atest keystore2_test
Bug: 310047761
Change-Id: Ied5fbd3248cae6aec230cacfa6807b3cb2b7cf4b
2023-11-23 11:59:45 +00:00
Eric Biggers
6ea1c60e67 Rename the fix_unlocked_device_required_keys flag
This flag was defined as a regular flag and then was later changed to a
fixed_read_only flag.  This scenario is currently "unsupported" by the
flags infrastructure; an error occurs when trying to advance the flag to
staging.  Work around this by renaming the flag so that the flags
infrastructure sees it as an entirely new flag.

Bug: 296464083
Bug: 311648623
Test: build
Change-Id: Iafde2d63578bf65b3f5a08ab57561eadbe8f6b7a
2023-11-22 16:21:59 +00:00
David Drysdale
eed416d4a8 Merge changes I28f673b6,I146f7cfd into main am: 39b7af2fcd
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2821841

Change-Id: Ie8a1edf47feacc1a8a2be827e5f3cc82160d5742
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-20 11:18:03 +00:00
David Drysdale
39b7af2fcd Merge changes I28f673b6,I146f7cfd into main
* changes:
  Flag for import of previously-emulated keys
  Cope with previously-emulated keys
2023-11-20 10:43:44 +00:00
Alice Wang
6722754e43 Merge "Make librkpd_client available to com.android.virt" into main am: 416683bc23
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2817842

Change-Id: I24e5bc60d318e6d8cd5cdf725d082e86947faac0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 09:29:37 +00:00
Alice Wang
416683bc23 Merge "Make librkpd_client available to com.android.virt" into main 2023-11-17 09:05:45 +00:00
Eric Biggers
9a4da544c1 Merge "keystore2: fix UnlockedDeviceRequired to work without LSKF" into main am: dfbab7e6bc
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2805742

Change-Id: I04dceb29e39ab4683035edf03c8d89dcb6f4f920
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 18:32:36 +00:00
Eric Biggers
dfbab7e6bc Merge "keystore2: fix UnlockedDeviceRequired to work without LSKF" into main 2023-11-15 17:33:33 +00:00
Shaquille Johnson
e2b3a0b53e Merge "Change name of flag to specify put" into main am: f1a07b2fe1
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2830010

Change-Id: I21001255c15e5745a70693af9e4d123bee780798
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 12:40:46 +00:00
Eran Messeri
ea60fe79fc Merge "Test added to generate a key with specifying cerificate subject and certificate serial number. Test generates a key and verifies the specified key characteristics." into main am: a68eb23f51
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2619159

Change-Id: I1234289746a32bae2134b07274dff1c693b18d93
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 12:40:34 +00:00