Commit Graph

842 Commits

Author SHA1 Message Date
Priyanka Advani (xWF)
6c01282b0f Merge "Revert "Use platform security domains in keymint/gatekeeper sepolicy"" into main 2024-10-23 01:01:46 +00:00
Priyanka Advani (xWF)
82e13c4269 Revert "Use platform security domains in keymint/gatekeeper sepolicy"
Revert submission 3312283-2024-10-18-schuffelen-sepolicy

Reason for revert: Droidmonitor created revert due to b/375059051. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3312283-2024-10-18-schuffelen-sepolicy

Change-Id: Icebd34eb9e2941a6480d9943986a104cc5249729
2024-10-22 23:51:23 +00:00
Roman Kiryanov
c1136a5b92 Merge "Use platform security domains in keymint/gatekeeper sepolicy" into main 2024-10-22 20:07:34 +00:00
Treehugger Robot
094b92841f Merge "Add proposed trendy teams for VTS modules" into main 2024-10-22 16:17:21 +00:00
A. Cody Schuffelen
580ae4e9b8 Use platform security domains in keymint/gatekeeper sepolicy
... rather than Cuttlefish sepolicy.

Issue reported by rkir@.

Bug: b/374158137
Test: cvd create
Change-Id: I7522187100e4c8ec94aade5f3cb791087900f7e0
2024-10-17 14:01:23 -07:00
Alice Wang
f112ec92ee [vts] Verify RKP VM DICE chain in IRPC VTS
This cl adds verifications to the IRPC VTS to check that:

- RKP VM DICE chains have a continuous presence of RKP VM markers
till the last DICE certificate.
- Non-RKP VM DICE chains do not have such continuous presence of
RKP VM markers.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Test: atest libkeymint_remote_prov_support_test
Bug: 314128697
Change-Id: Ib966b4bd584f1f931b7f19b4b58a1a37b5266f5e
2024-10-15 08:22:12 +00:00
Yihan Dong
8c111de52b Add proposed trendy teams for VTS modules
Change-Id: Iedaa3412d58aa501a8ecdeceb9f87e2473f3b422
Test: build locally
Bug: 368362374
2024-10-12 08:59:17 +00:00
David Drysdale
7b05efd13f KeyMint: coalesce device ID failure code
Test: VtsAidlKeyMintTargetTest
Change-Id: I7c94af96010f5c5f708f54bf02e0f85a96cece3f
2024-10-10 18:19:51 +01:00
Abdelrahman Daim
7c60a7a0cb Explicitly include libhardware_header for vendors
Summary: This seems to  be not implicit when building vendor, so it's now necessary to explicitly include.

Test: Succesful build on master

Change-Id: Ie9720a3ae4c9f94210bc34c60d14756c7d0cf56f
Signed-off-by: Abdelrahman Daim <adaim@meta.com>
2024-09-27 07:47:17 -07:00
Karuna Wadhera
e2346b7a13 Merge "Revert "Revert "Optionally (dis)allow degenerate DICE chains in ..."" into main 2024-09-11 13:06:14 +00:00
Karuna Wadhera
6a0dd7014d Revert "Revert "Optionally (dis)allow degenerate DICE chains in ..."
Revert submission 3260534-revert-3254876-disallow_degenerate_chains-RZRFZAKDEJ

Reason for revert: Breakage fixed

Reverted changes: /q/submissionid:3260534-revert-3254876-disallow_degenerate_chains-RZRFZAKDEJ

Change-Id: I972b9b0cae932cc39be3f8d44ac59f82e878ca53
2024-09-10 22:41:53 +00:00
Tommy Chiu
b501642820 Correct the UDS_pub source
The UDS_pub is supposed to be the first element of DiceCertChain
according to generateCertificateRequestV2.cddl.

Bug: 365711214
Test: rkp_factory_extraction_tool
Change-Id: I454a99058d92ce9743810a9334c7ccacccc694e0
2024-09-10 10:15:47 +00:00
Priyanka Advani (xWF)
704df56108 Merge "Revert "Optionally (dis)allow degenerate DICE chains in verifyCsr"" into main 2024-09-09 20:57:18 +00:00
Priyanka Advani (xWF)
ebc265f0bc Revert "Optionally (dis)allow degenerate DICE chains in verifyCsr"
Revert submission 3254876-disallow_degenerate_chains

Reason for revert: Droidmonitor created revert due to b/365592588.

Reverted changes: /q/submissionid:3254876-disallow_degenerate_chains

Change-Id: I31f78d6c708f34f0a6fe9f54daef82981a91ac8f
2024-09-09 20:44:24 +00:00
Karuna Wadhera
f3d44a7bac Merge "Optionally (dis)allow degenerate DICE chains in verifyCsr" into main 2024-09-09 18:18:27 +00:00
Karuna Wadhera
39de0cb35b Optionally (dis)allow degenerate DICE chains in verifyCsr
Bug: 323246910
Test: atest libkeymint_remote_prov_support_test & manual testing of
 `rkp_factory_extraction_tool` with/without `allow_degenerate=false` on a
 device with a degenerate DICE chain
Change-Id: Ia1833c0bb6a895ae5b8aefea24850a41cf956f38
2024-09-06 19:10:04 +00:00
Kiyoung Kim
4a518d2e1e Reapply "Define vintf_fragments as modules"
Previous commit was reverted as it removed wifi vintf fragment from
devices, which was caused by 'no_full_install' property from
vintf_fragment module. This change relands the change, with removing
no_full_install property from the vintf_fragment module

Bug: 322089980
Test: aosp_cf_x86_64_phone build succeeded
Test: mokey_go32 build contains
/vendor/etc/vintf/manifest/android.hardware.wifi.supplicant.xml file

Change-Id: I523ce570068b180805b65f984a0d6def0612db87
2024-09-04 15:55:29 +09:00
Treehugger Robot
bee59e3b47 Merge "Revert "Define vintf_fragments as modules"" into main 2024-08-30 15:58:23 +00:00
Greg Kaiser
3892274102 Revert "Define vintf_fragments as modules"
This reverts commit cf0a2dd5b0.

Reason for revert: b/363215494, breaks WiFi for at least some devices

Change-Id: I5137957087dde51c0049416404f410f53dd912f3
2024-08-30 14:07:37 +00:00
Kiyoung Kim
71af7d2bfe Merge "Define vintf_fragments as modules" into main 2024-08-30 08:26:49 +00:00
Karuna Wadhera
69a761318f Merge "Pass in allow_any_mode when verifying DICE chains" into main 2024-08-28 14:03:19 +00:00
Pranav Garg (xWF)
f74d274807 Fixing isDeviceIdAttestationRequired to require both cases instead of just one
Bug: 356536705

Change-Id: I15326e68fc2ea1ce9a2dfbe7498790900ebb43e4
2024-08-27 18:36:15 +00:00
Karuna Wadhera
eabdb6edf0 Update getDiceChainKind for VSR >15
Bug: 346861728
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I8698663c29c8d91e7b39ca02e588b87377356363
2024-08-26 12:25:04 +00:00
Karuna Wadhera
ca6d8cce51 Pass in allow_any_mode when verifying DICE chains
1. allow_any_mode is set as true when the VM RKP instance is being
   tested (since the bootloader is unlocked for VTS tests and therefore
   the VM DICE chain will necessarily have at least one non-normal
   mode.)
2. allow_any_mode is set as true for non-user type builds.

Bug: 318483637
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I15ec3ad32f08eecd8478df14f8efa71fdb0b5d08
2024-08-22 18:48:58 +00:00
Yi Kong
99df7ced5d security: Remove unnecessary std::move
Moving a temporary object prevents copy elision, and could reduce
performance.

This fixes -Wpessimizing-move compiler warning.

Test: presubmit
Bug: 154270751
Change-Id: I378f1b9029f1a0711728ff14e4071263ad330504
2024-08-14 01:56:18 +08:00
Kiyoung Kim
cf0a2dd5b0 Define vintf_fragments as modules
Define vintf_fragments as modules if the file is shared among multiple
modules to avoid any conflicts.

Bug: 322089980
Test: aosp_cf_x86_64_phone build succeeded
Change-Id: I1d00623e3e6da6bb787a152d81eb94822153388f
2024-08-12 15:31:10 +09:00
Karuna Wadhera
550caafbfd Merge "Amend tests on GSI that rely on RKP-only props" into main 2024-07-17 14:28:45 +00:00
Karuna Wadhera
0c5b6503ed Amend tests on GSI that rely on RKP-only props
GSI replaces the values for remote_prov_prop properties (since they’re
system_internal_prop properties), so on GSI the properties are not
reliable indicators of whether StrongBox/TEE are RKP-only or not.

Also included is the removal of the helper skipAttestKeyTestIfNeeded()
so the skipping can happen in the tests directly.

Bug: 348159232
Test: VtsAidlKeyMintTargetTest
Change-Id: I2075e1f76ddd0f87620a212e1aa389803139a117
2024-07-17 12:41:51 +00:00
Akhilesh Sanikop
aae715f927 Updated fuzz_config in Android.bp file
Added fuzz_config and its fields like - cc, componentid,
hotlists, description, vector, service_privilege,
users & fuzzed_code_usage.

Bug: 306435930
Test: Build the updated fuzz targets

Change-Id: Ib537f4c4c98860de431e33dedbd106930cf8e45a
2024-07-16 16:17:20 +05:30
Akhilesh Sanikop
ee2196d155 Added keymint_rkpsupport_fuzzer
exec/s: 30
Test: ./keymint_rkpsupport_fuzzer
Bug: 337985606

Change-Id: Ib6955d188351ce3fc598a0f27ad626f718d542b8
2024-07-03 15:07:54 +05:30
Akhilesh Sanikop
ddbaa66bbc Added keymint_remote_prov_fuzzer
exec/s: 12
Test: ./keymint_remote_prov_fuzzer
Bug: 337985606

Change-Id: Ifaa5c32616904c1aa5b6d8a21c566a014ed882cf
2024-07-03 15:07:33 +05:30
Treehugger Robot
6435b744d7 Merge "Add NID_secp384r1 support on parsing UDS public key" into main 2024-07-02 03:01:51 +00:00
Tommy Chiu
10ee304f01 Add NID_secp384r1 support on parsing UDS public key
It used to be hard coded to secp256.

Bug: 330791928
Test rkp_factory_extraction_tool64

Change-Id: I759d94a7112bb9fb50906b8e0d45b851f82c898f
2024-07-02 02:01:29 +00:00
Treehugger Robot
af7df71799 Merge "Fix invalid access on nullptr" into main 2024-07-01 21:29:05 +00:00
Tommy Chiu
2165de0046 Fix invalid access on nullptr
Should return when there's no content be parsed.

Bug: 330791928
Test: rkp_factory_extraction_tool64
Change-Id: I45302ec20a0a931d2f44a7e36f613858c10fe21e
2024-07-01 06:43:30 +00:00
David Drysdale
e9dcae53e4 KeyMint: version gate attestation of IMEI2
aosp/3106417 added extra tests with for device ID attestation, but
didn't include a version gate for attesting to the second IMEI value,
which is only present in KeyMint v3+.

Test: VtsAidlKeyMintTargetTest
Change-Id: I95f47942058781709efe96d38442e0518e39705d
2024-06-11 15:43:12 +01:00
David Drysdale
ef1123b24e KeyMint: add VTS test with all IDs
Add a test that includes all of the device IDs for attestation, which
helps to check whether the emitted extension is including everything in
the correct order.

(This is already tested in CTS since aosp/2650044)

Also fix test of first API level to use `get_vsr_api_level` helper.

Test: VtsAidlKeyMintTargetTest
Test: with/without KeyMint hacked to emit tags in wrong order
Change-Id: Ic6e489aa99c773d794ad8cbddbe5153b1a145ea5
2024-05-31 12:05:04 +01:00
Treehugger Robot
7884619140 Merge "Added keymint_authSet_fuzzer" into main 2024-05-28 08:24:05 +00:00
Treehugger Robot
02a086bdaa Merge "Added keymint_attestation_fuzzer" into main 2024-05-28 06:45:29 +00:00
David Drysdale
fd7119ea67 Merge "Delete standard output in VtsAidlKeyMintTargetTest" into main 2024-05-17 05:59:57 +00:00
Huang Rui
ca3ea117ef Delete standard output in VtsAidlKeyMintTargetTest
The Done flag of VtsAidlKeyMintTargetTest is false during running
the module with ‘--collect-tests-only’ because it uses standard
output to print logs.

Bug: 340576534
Test: run vts -m VtsAidlKeyMintTargetTest --collect-tests-only

Change-Id: I3d81f7e59b6189fab1b146320263509f2694c11e
Signed-off-by: Huang Rui <rui1.huang@intel.com>
Signed-off-by: Liu Kai <kai1.liu@intel.com>
2024-05-15 11:42:59 +01:00
Akhilesh Sanikop
0e568bc8e5 Added keymint_authSet_fuzzer
exec/s: 490
Test: ./keymint_authSet_fuzzer
Bug: 337985606

Change-Id: I47ee42e6e97b98110bab8f923a94ed7b6e8b992d
2024-05-13 23:47:19 +05:30
Akhilesh Sanikop
007129a7fd Added keymint_attestation_fuzzer
exec/s: 2
Test: ./keymint_attestation_fuzzer
Bug: 337985606

Change-Id: I2c0d56e1af97190a5eb06a34e15bcd93123f39a6
2024-05-13 23:46:36 +05:30
A. Cody Schuffelen
fbc3089310 insecure keymint: in-process initialization ordering
This creates an ordering of

1. In-memory HALs are initialized
2. Secure AIDL HALs are exposed

There are some dependencies on the information, e.g.

Boot info:
https://cs.android.com/android/platform/superproject/main/+/main:system/keymint/ta/src/keys.rs;l=705;drc=72ed18b226a9944330ecd97d776d57ea1b2eb9e8
https://cs.android.com/android/platform/superproject/main/+/main:system/keymint/ta/src/lib.rs;l=356;drc=4f8cad1bf0b3392414e5735b95a7c5d80d64d6e6
https://cs.android.com/android/platform/superproject/main/+/main:system/keymint/ta/src/rkp.rs;l=75;drc=747e5931be387fb600f6865d2308390646243610

HAL info:
https://cs.android.com/android/platform/superproject/main/+/main:system/keymint/ta/src/rkp.rs;l=79;drc=747e5931be387fb600f6865d2308390646243610

Bug: b/339121782
Test: launch_cvd --resume=false --secure_hals=oemlock:guest_insecure_keymint:guest_insecure_gatekeeper
Change-Id: Ifbe8655bf14c248e886725217d261dae5458e15f
2024-05-07 16:56:42 -07:00
David Drysdale
b2adc861ee Merge "KeyMint: more warnings around non-secure test impl" into main 2024-04-29 07:25:08 +00:00
David Drysdale
33a132f13f KeyMint: more warnings around non-secure test impl
Make it clearer that the default implementation is non-secure in
various ways, most notably because the TA code is running in-process
in the HAL service.

Bug: 314513765
Test: VtsAidlKeyMintTargetTest
Change-Id: I83509110c32a4df8df6c0b288d14659e022442ff
2024-04-29 07:09:34 +01:00
David Drysdale
b4598740de KeyMint: test for unique HMAC results
Bug: 218713582
Test: VtsAidlKeyMintTargetTest
Change-Id: I5babfa67e707dc1bf15dd40b1ee4c8c8b97f44a7
2024-04-25 10:00:05 +01:00
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
Seth Moore
fae563acb0 Merge "Allow RKP-only devices to pass keymint VTS" into main 2024-04-09 15:31:26 +00:00
David Drysdale
61c9ab4d87 Merge "Make batch attestation keys/certs optional" into main 2024-04-09 09:11:54 +00:00