Commit graph

7706 commits

Author SHA1 Message Date
Shaquille Johnson
bce0cac39f Remove java generated files
Remove improper import and make the flag a constant
with the read only option

Bug: 191777960
Test: m keystore2
Change-Id: I34bd2d0d891686c93a167456e8d50eec75374244
2023-09-27 22:28:05 +01:00
Treehugger Robot
2ff4165d26 Merge "Add aconfig flags for rust keystore2" into main 2023-09-27 19:48:49 +00:00
Shaquille Johnson
6a751993d5 Add aconfig flags for rust keystore2
Test: m keystore2
Change-Id: I0bdd3d34a4e78500b266b8aac321ff1e2903dffb
2023-09-27 17:08:42 +01:00
Seth Moore
373225c6c5 Merge "Include challenge in test_rkpd_attestation_key_upgrade" into main 2023-09-26 19:25:05 +00:00
Seth Moore
29fd461ceb Include challenge in test_rkpd_attestation_key_upgrade
KeyMint.generateKey requires a challenge to be passed when a key
blob is also passed. The test missed this, and was thus failing on
compliant HALs.

Bug: 301223273
Test: keystore2_test
Change-Id: Icf7a32683c85d87fddd7d05ba07a110bb4e38c79
2023-09-26 10:45:43 -07:00
Treehugger Robot
6b57def860 Merge "Reuse error mapping logic for key operation metrics" into main 2023-09-20 15:23:14 +00:00
Treehugger Robot
63207be169 Merge "[dice] Add nostd version of libdiced_sample_inputs" into main 2023-09-20 11:46:29 +00:00
Alice Wang
db748d251e [dice] Add nostd version of libdiced_sample_inputs
This cl adds a version of libdiced_sample_inputs
that is compatible with the nostd environment.

This allows the sample inputs to be used as DICE
chain in the non-protected rialto later for testing
purposes.

Test: atest libdiced_sample_inputs.integration_test \
libdiced_sample_inputs_nostd.integration_test
Bug: 287233786

Change-Id: I6e96e051a8ba0b232521b259d5473520ac767383
2023-09-20 10:01:42 +00:00
Tri Vo
cd6fc7a578 Reuse error mapping logic for key operation metrics
Define SerializedError wire type for convenience and type safety. It
does not change the rules of how errors are downcasted to an i32.

Change operation outcome errors from Keymint ErrorCode to
SerializedError. This has an intended effect of binder errors being
reported to metrics as ResponseCode::SYSTEM_ERROR instead of
ErrorCode::UNKNOWN_ERROR.

Also update comments.

Bug: 298194325
Test: m
Change-Id: Ieff70245b776c38845c4f5142ab13d438ff79104
2023-09-19 16:28:37 -04:00
Devin Moore
a764eb9f45 Merge "keystore2 compat: stop crashing without hwservicemanager" into main 2023-09-06 17:33:15 +00:00
Tri Vo
0140d4b523 Merge "Updated to use shared library instead of static library." into main 2023-09-01 21:01:54 +00:00
Rajesh Nyamagoud
42276da855 Updated to use shared library instead of static library.
Removed `libkeymint_vts_test_utils` and its dependent libs from static
libs list and added only `libkeymint_vts_test_utils` in shared libs
list.

Test: m libkeystore2_test_utils; atest keystore2_client_tests; atest keystore2_test_utils_test;
atest keystore2_test
Bug: 194359114

Change-Id: Iab4b8c174af81a8c64a9f44fcd634d54f78773da
2023-09-01 16:50:01 +00:00
Tri Vo
8ace735b6e Merge "Remove IRPC error handling" into main 2023-08-31 22:18:06 +00:00
Devin Moore
bf520df50e keystore2 compat: stop crashing without hwservicemanager
New devices will no longer have hwservicemanager installed as part of
HIDL deprecation. So this service must not crash when it's not found.
From keystore2's perspective, this is the same as not having the HIDL
Keymaster HALs installed.

Test: remove hwservicemanager from
device/google/cuttlefish/shared/device.mk && launch_cvd
Bug: 298454031

Change-Id: I4c7cefd388936aff821cff572a8af1b6f69f82d1
2023-08-31 21:43:03 +00:00
Seth Moore
daff0e6c64 Merge "Static link libcrypto into rkp_factory_extraction_tool" into main 2023-08-31 19:00:54 +00:00
Tri Vo
dc8d6c06bb Remove IRPC error handling
Keystore no longer talks to IRPC directly. Remove corresponding error
handling code.

Test: m
Change-Id: I47ce41a0f48a30b994b18e794b1dd94fdbf9aa52
2023-08-30 17:00:12 -04:00
Eran Messeri
19e80fc8a0 Merge "Re-structured keystore test-utils module." into main 2023-08-30 15:11:43 +00:00
Rajesh Nyamagoud
10f02e705a Re-structured keystore test-utils module.
- Created separate build file.
- Moved ffi-utils from keystore2-client-tests to test-utils.
- Updated calling apis.

Test: atest keystore2_client_tests; atest keystore2_test_utils_test;
atest keystore2_test
Bug: 194359114

Change-Id: Ia2404218b7d13a9ae43b3fc4e481899576d24e63
2023-08-29 17:03:35 +00:00
David Drysdale
6f7a9b6bbc Merge "keystore2: add more logging" into main 2023-08-25 09:48:36 +00:00
David Drysdale
e85523f34a keystore2: add more logging
Also remove benign logging when there are multiple strong
biometrics.

Test: adb logcat on CF while adding/removing user/pwd
Change-Id: I777404d566990a4a604554133c0d87abba2200bc
2023-08-23 14:41:59 +01:00
Alan Stokes
07ef2a8b15 Merge "Better API for creating a DICE config descriptor" into main 2023-08-22 15:26:41 +00:00
Alan Stokes
82b1239acc Better API for creating a DICE config descriptor
Instead of listing all the possible parameters, put them in a struct
(as the C API does).

This means callers only have to list the ones they use, and a new
parameter doesn't require all clients to change.

Bug: 291241882
Test: atest -p in diced
Change-Id: I7c4925385e30ba9fcec0dc188747a23d7df614d7
2023-08-22 15:16:04 +01:00
Andrew Scull
81fcb6170d Merge "Migrate to new open-dice API for Android" into main 2023-08-21 16:16:14 +00:00
Hasini Gunasinghe
7d690da73b Merge "Adding an OWNERS file as requested in b/288143537" into main 2023-08-18 21:45:07 +00:00
Andrew Scull
0275aa5d1a Migrate to new open-dice API for Android
Symbols for Android in open-dice now use the DiceAndroid* prefix rather
than the Bcc* prefix. This does not migrate the whole library away from
the legacy BCC nomencalture.

Test: TH
Change-Id: I878de15f663ee2bcb678db12475cae6c45fc8b87
2023-08-18 18:42:10 +00:00
Tri Vo
dc4d64daff Merge "Generate certificates for importWrappedKey" into main 2023-08-18 18:37:47 +00:00
Tri Vo
3b0d703da8 Generate certificates for importWrappedKey
Bug: 291671113
Test: atest android.keystore.cts.ImportWrappedKeyTest
Change-Id: Ie195ac3931c4c79c738d583bfe272eb6a9314f8f
2023-08-17 13:57:01 -04:00
Treehugger Robot
e6dfdf59af Merge "keystore2_unsafe_fuzzer: Bug Fix" into main 2023-08-17 15:45:27 +00:00
Treehugger Robot
dd3664fa98 Merge "Changes for Rust 1.72" into main 2023-08-17 15:08:58 +00:00
Treehugger Robot
3be54faa4a Merge "Use String8/16 c_str" into main 2023-08-17 14:40:04 +00:00
James Farrell
2899721a5e Changes for Rust 1.72
Remove useless calls to vec!

Test: toolchain/android_rust/test_compiler.py
Bug: 295883071
Change-Id: Ie6cc07df6d27c522daf24f85d9fbaf673bdb413f
2023-08-17 04:37:05 +00:00
James Farrell
fdd6245e88 Merge "Changes for Rust 1.72" into main 2023-08-16 14:51:53 +00:00
James Farrell
d77b97f0b6 Changes for Rust 1.72
Replace fold with try_fold

Bug: 295883071
Change-Id: I2b0b102d673f051ec52f6ba8caa6bd73030100b0
2023-08-15 20:03:38 +00:00
Seth Moore
9b0fb4573a Static link libcrypto into rkp_factory_extraction_tool
We publish a prebuilt rkp_factory_extraction_tool online, so we should
only dynamically load the libraries that we cannot avoid (e.g. libdl)

Test: built and ran tool
Change-Id: Id109e12dde841797169f0a4e54fa2ede558da252
2023-08-11 13:34:39 -07:00
Tomasz Wasilczyk
102d33af23 Use String8/16 c_str
Bug: 295394788
Test: make checkbuild
Change-Id: I5f61f412c117e5121a7026dc3e364826577f2e55
2023-08-11 16:10:37 +00:00
Shaquille Johnson
39d70965bc Merge "[Keystore]Fix abort unsafe check in keystore fuzz" into main 2023-08-11 15:47:07 +00:00
Shaquille Johnson
718036a8ad [Keystore]Fix abort unsafe check in keystore fuzz
Fuzzer finds issue when checking return message after response code
fails.

```
m -j$(nproc) keystore2_unsafe_fuzzer
adb sync data
adb shell /data/fuzz/${TARGET_ARCH}/keystore2_unsafe_fuzzer/keystore2_unsafe_fuzzer
```

Test: description
Bug: 292231203
Change-Id: I27bdcb91fa05a75239aeeb34d817e4f04387b41f
2023-08-10 15:16:43 +01:00
Seth Moore
b39efe2469 Merge "Move rkp_factory_extraction_tool dist dir to "rkp"" into main 2023-08-03 19:44:51 +00:00
Seth Moore
ab493724db Move rkp_factory_extraction_tool dist dir to "rkp"
We will be publishing more tools for partners, and they should live
together. With that in mind, move the rkp_factory_extraction_tool dist
to "rkp/" instead of "rkp_factory_extraction_tool/".

Test: Built it
Change-Id: Ic86fe555a75dfe12a4cae1b4be48c33bae95ecbb
2023-08-02 13:00:53 -07:00
Treehugger Robot
b00c8ef0c5 Merge "Add safety comments." into main 2023-07-31 11:09:41 +00:00
Treehugger Robot
9c38948bc5 Merge "Add, standardise or temporarily opt out of safety comments for keystore2." into main 2023-07-28 10:20:42 +00:00
Andrew Walbran
a47698a88f Add, standardise or temporarily opt out of safety comments for keystore2.
These will soon be required by a lint.

Some functions were incorrectly marked as safe which were not actually
safe, so I've fixed those too.

Bug: 290018030
Test: m rust
Change-Id: I38df6a8162d430617f123ab1aace38b741458fce
2023-07-28 10:32:08 +01:00
Pierre-Clément Tosi
88e1231c3a Merge "diced: Limit availability of no_std libraries" into main 2023-07-28 09:08:28 +00:00
Tri Vo
f814e4a24f Merge "Verify key characteristics of generated/imported keys." into main 2023-07-27 18:45:16 +00:00
Pierre-Clément Tosi
da662b0bf0 diced: Limit availability of no_std libraries
Rework the defaults to avoid enabling vendor_available, apex_available,
or host_supported in the "_nostd" libraries, where they shouldn't be
used as the static libraries built from these modules aren't distributed
through APEXes or vendor code and are not expected to be compatible with
the host.

Bug: 293260907
Test: mmma external/open-dice
Change-Id: Ia922ed6b8d525c89724a5dc70bbd0d9621f1ba92
2023-07-27 17:17:36 +01:00
Rajesh Nyamagoud
d0213ef0e6 Verify key characteristics of generated/imported keys.
Changes made in keystore2-client-tests to verify the key characteristics
of generated and imported keys.

Bug: 279721870
Test: atest keystore2_client_tests
Change-Id: I30c1fb2bdb1d69d321d356453d895db73347acde
2023-07-27 15:51:41 +00:00
Eric Biggers
20b7b90f40 Merge "Revert "Remove fsverity_init"" into main 2023-07-26 18:06:52 +00:00
Yunkai Lim
0d850139b6 Revert "Remove fsverity_init"
Revert submission 2662658-fsverity-init-cleanup

Reason for revert: Culprit for test breakage b/293232766

Reverted changes: /q/submissionid:2662658-fsverity-init-cleanup

Change-Id: Ib29f082e5a48cacc726a5228029ec3a1b6561cb1
2023-07-26 06:21:30 +00:00
Tri Vo
dbeb6aaa7d Merge "keystore: Fix ID rotation window" into main 2023-07-25 23:55:46 +00:00
Eric Biggers
50805a8b25 Merge "Remove fsverity_init" into main 2023-07-25 22:49:09 +00:00