Commit graph

1037 commits

Author SHA1 Message Date
Seth Moore
e5f44a081d Merge "Rename OUT_OF_KEYS -> OUT_OF_KEYS_TRANSIENT" 2023-01-30 17:11:37 +00:00
Tri Vo
ca8707344b Merge "keystore2: Add test for RKPD key upgrade" 2023-01-27 18:20:49 +00:00
Tri Vo
02f0fa46a5 keystore2: Add stress test for getting RKPD key
Bug: 266607003
Test: keystore2_test
Change-Id: Iaf73c26c6d5c9430e06b4c34ed720158f6b81f00
2023-01-26 15:40:44 -08:00
Tri Vo
30268daa50 keystore2: Add test for RKPD key upgrade
Also require root permisions so that the test can talk to KeyMint.

Test: keystore2_test
Change-Id: I265c2a05fdf0393adb81576e895009ed07dd2d46
2023-01-26 15:40:18 -08:00
Charisee Chiw
568c1e4356 Merge "Change requests for Rust update v1.66.0" 2023-01-26 23:26:49 +00:00
Tri Vo
229fe25f67 Merge "keystore2: Add timeout to RKPD get key call" 2023-01-25 17:58:42 +00:00
Charisee
03e0084a39 Change requests for Rust update v1.66.0
error: casting to the same type is unnecessary

Test: ./build.py --lto=thin
Bug: 263153841
Change-Id: Ibf820a90c36c46155d07176b3194b460904140c9
2023-01-25 01:49:59 +00:00
Tri Vo
437d014ae1 keystore2: Add timeout to RKPD get key call
Also replace libfutures with libtokio, as the former doesn't have
support for timeouts.

Bug: 264921138
Test: keystore2_test
Change-Id: I97c9749e93b2d001afe5d17bda8c665f884b0e05
2023-01-24 10:36:11 -08:00
Seth Moore
5dac386370 Use rkpd if the build flag is set
Add a second, read-only build flag indicating that rkpd is enabled.
This flag is not server controlled, and thus cannot be disabled.

Platforms, such as cuttlefish, are RKP only, and are using a new
version of keymint that is not compatible with the old
RemoteProvisioner. Therefore, we must ensure that the configuration
is fixed and cannot be turned off.

Bug: 266482839
Test: RemoteProvisionerUnitTests
Test: keystore2_client_tests
Test: RkpdAppUnitTests
Change-Id: Id61c704a8beca2ad7b5b9bee9433cc4e11964299
2023-01-24 09:10:49 -08:00
Seth Moore
d7ad856c18 Rename OUT_OF_KEYS -> OUT_OF_KEYS_TRANSIENT
More OUT_OF_KEYS errors are coming, and the old "OUT_OF_KEYS" is a
bucket for all transient errors. Rename the enum to better indicate
this.

Also rename OUT_OF_KEYS_REQUIRES_UPGRADE to
OUT_OF_KEYS_REQUIRES_SECURITY_PATCH. This better indicates that
system is potentially vulnerable (rather than simply running old code).

Test: keystore2_test
Change-Id: I1f2d803529c3e43592536016a9261e2294b42bb5
2023-01-24 08:45:47 -08:00
Eran Messeri
4c6a596077 Merge "Limit the number of key descriptors sent back" 2023-01-24 16:24:36 +00:00
Eran Messeri
6e1213f5f5 Limit the number of key descriptors sent back
In case the number of key descriptors and their content exceeds the
binder transaction size limit, only return a subset that does fit.

This is a temporary fix - long-term fix is to introduce new API that
lets the caller specify the range of aliases to be fetched.

Bug: 222287335
Test: Manual: Generate 100 keys with a 6k characters name each.
Change-Id: I5e8543a25dd9f1bb504fbc23f35779da0a0153b0
2023-01-24 14:23:25 +00:00
Tri Vo
a529b14ee3 Merge changes I2f3003a7,I0f66cb6a
* changes:
  keystore2: Test case for storing upgraded RKPD key
  Use separate RKPD key IDs in test cases
2023-01-23 22:35:33 +00:00
Tri Vo
bac3b5273a keystore2: Test case for storing upgraded RKPD key
Bug: 261214100
Test: keystore2_test
Change-Id: I2f3003a73b41330f2973ff1503b642a2cb0c6118
2023-01-23 13:10:24 -08:00
Tri Vo
4b1cd82404 Use separate RKPD key IDs in test cases
This avoids races between test cases for RKPD keys.

Test: keystore2_test
Change-Id: I0f66cb6a2d2b99dfeffb812233eb33d4112b9aaf
2023-01-23 13:09:56 -08:00
Dave McCloskey
435b8f8dff Update the documentation for onLockScreenEvent to be more comprehensive.
Change-Id: Ia66c14a1d03ace0d8be075af3bc5c6673bba09b1
2023-01-19 22:58:44 +00:00
Treehugger Robot
1cd35f0006 Merge "Import macro directly rather than using #[macro_use]." 2023-01-19 13:22:05 +00:00
Andrew Walbran
870a01a9b2 Import macro directly rather than using #[macro_use].
`extern crate` makes it harder to keep track of dependencies, so we
prefer to import macros explicitly instead.

Bug: 261037227
Test: m keystore2_unsafe_fuzzer
Change-Id: I0ec95e9343a05c8f61c2cdca3ba601bae97c9187
2023-01-19 11:30:49 +00:00
Treehugger Robot
a09b2e109a Merge "Revert "Disable cert validation in tests until b/263254184 is fixed"" 2023-01-19 02:29:11 +00:00
Rajesh Nyamagoud
e159fccc1d Adding tests to validate deleteKey APIs.
- Generate a key and delete it using keystore2 service `deleteKey` API.
  Test should delete the key successfully.

- Try to delete a non-existing key with keystore2 service `deleteKey`
  API. Test should fail to delete a key with an error response code
  `KEY_NOT_FOUND`.

- Try to delete a key with domain `BLOB` using keystore2 service
  `deleteKey` API. Test should fail to delete a key with an error code
  `INVALID_ARGUMENT`.

- Generate a key with domain `BLOB`. Delete the generated key using
  underlying security level `deleteKey` API. Test should successfully
  delete key blob.

- Try to delete a key with domain `BLOB` without providing key-blob.
  Test should fail to delete a key with an error code
  `INVALID_ARGUMENT`.

- Try to delete a key with domain `APP` using underlying security level
  `deleteKey` API. Test should fail to delete with an error code
  `INVALID_ARGUMENT`.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I8233ef79b33daff868ad9767903169dc21f4906e
2023-01-18 00:43:30 +00:00
Greg Kaiser
ac300b50f3 Merge "Replaced size_t by int to handle the errors." 2023-01-17 20:35:25 +00:00
David Drysdale
f5a15eeec4 Merge "Make keystore2 unit tests less brittle" 2023-01-16 05:42:21 +00:00
Daniel Angell
69ad6cdad1 Revert "Disable cert validation in tests until b/263254184 is fixed"
This reverts commit c16d6cd77f.

Reason for revert: Root cause has been resolved

Change-Id: Ief83cceb607fa72ca4602588e18d3d06779d027c
2023-01-13 21:23:27 +00:00
Seth Moore
613a1fd729 Clean up rkpd client in keystore2
1. Remove helper functions for binders. Just do the work in the binder
   function (reducing layers).
2. Stop returning Result from new_native_binder. Those functions have
   no failure paths.
3. Add some debug logs

Test: keytore2_test
Change-Id: I99aeeefec1e39891a124e1eb02f5a19f7188ca76
2023-01-13 00:13:48 +00:00
Rajesh Nyamagoud
cebd79d55b Replaced size_t by int to handle the errors.
Bug: 194359114
Test: atest keystore2_client_tests
Change-Id: Ibb1215322a50400d493f875a6e427af8f0d29818
2023-01-12 16:22:00 +00:00
David Drysdale
38f2ca31cf Make keystore2 unit tests less brittle
- Don't specify a BlockMode for RSA operations.
- Don't set ATTESTATION_APPLICATION_ID from the client; keystore will
  fill this in itself whenever an ATTESTATION_CHALLENGE is present.
- Rename `has_trusty_keymint` to `has_default_keymint`, as it has
  nothing to do with Trusty.
- Allow wider ranges of error codes.

Bug: 197891150
Test: keystore2_client_tests
Change-Id: I17d4eff724c554cbd89dfcc0a4e3ec7beb4e08db
2023-01-12 12:56:03 +00:00
Seth Moore
f896d36baa Fix hanging unit test
Since these tests perform actual binder interactions with rkpd, we
need to spin up the binder thread pool so that the callbacks have
a thread to run on.

Test: keystore2_test
Change-Id: If0f67661f915798722d2bf7f9c5072887048cae8
2023-01-11 10:44:06 -08:00
Seth Moore
a55428ecf8 The RKPD store upgraded key interface is now async
Update keystore2 to pass a callback for receiving success/failure from
the storeUpgradedKeyAsync API.

Test: keystore2_test
Bug: 262748535
Change-Id: Ifbae48b697267d05baa83d7d1e42569c7db694b5
2023-01-10 13:07:54 -08:00
Seth Moore
a882c96d61 Create helper type for oneshot::Sender
Move boilerplate for the sender code into a helper type. This moves
all the mutex unwrapping and optional checking into one spot, cleaning
up the call sites.

Test: keystore2_test
Change-Id: I517e091047d11d4ecca73026e5ee288878658fa3
2023-01-10 12:48:01 -08:00
Eran Messeri
6e0f462354 Merge "Tests to verify importWrappedKey functionality." 2023-01-09 17:00:32 +00:00
Treehugger Robot
f3c7e05d60 Merge "Disable cert validation in tests until b/263254184 is fixed" 2023-01-05 17:00:36 +00:00
Rajesh Nyamagoud
c946cc419c Tests to verify importWrappedKey functionality.
- Build ASN.1 DER-encoded wrapped key material `SecureKeyWrapper`.
  Import the wrapped key material. Test should create DER-encoded
  wrapped key material and import the secure key successfully.
  Imported key should be used perform crypto operation successfully.

- Build ASN.1 DER-encoded wrapped key material `SecureKeyWrapper` with
  invalid AAD. Try to import the wrapped key material. Test should
  create DER-encoded wrapped key material. Test should fail to import
  the secure key with error code `VERIFICATION_FAILED`.

- Import wrapped AES key and use it for crypto operations. Test should
  import wrapped key and  user it for performing crypto operations
  successfully.

- Import a key wihtout WRAP_KEY purpose and try to use it as wrapping
  key while importing wrapped key. Test should fail to import wrapped
  key with an error code `INCOMPATIBLE_PURPOSE`.

- Try to import wrapped key using non-existing wrapping key in Android
  keystore. Test should fail to import wrapped key with an error code
  `KEY_NOT_FOUND`.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ic9ed03b6f945bd41c4873f97a84c1658c284e918
2023-01-04 22:42:18 +00:00
Seth Moore
c16d6cd77f Disable cert validation in tests until b/263254184 is fixed
Test: Presubmit
Bug: 263254184
Change-Id: I157718ec8ae5bbc2e8fd5e4a61b252ed964b4e74
2023-01-04 12:02:38 -08:00
Treehugger Robot
26d4222e92 Merge "Remove use of size_t in Rust code" 2023-01-04 00:28:05 +00:00
Tri Vo
b5e43d19b6 keystore2: Support for RKPD attestation keys
Bug: 261214100
Test: TODO
Change-Id: I2234fb01179aec212811b864d68e5f94772c2538
2022-12-22 01:01:27 -08:00
Tri Vo
e8f0444d59 keystore2: Add utils to fetch keys from RKPD
Bug: 261214100
Test: keystore2_test
Change-Id: I87ec83dd700b4e3e24c65ce0650cd5643000a390
2022-12-22 01:01:18 -08:00
Jeff Vander Stoep
76c0f2874b Remove use of size_t in Rust code
Needed to upgrade bindgen from 0.59.0 to 0.63.0. Resolves the
following errors:

//#[path = "../../../src/options.rs"]
//mod options;

error[E0432]: unresolved import `keystore2_apc_compat_bindgen::size_t`
  --> system/security/keystore2/apc_compat/apc_compat.rs:22:82
   |
22 |     abortUserConfirmation, closeUserConfirmationService, promptUserConfirmation, size_t,
   |
      ^^^^^^ no `size_t` in the root

error[E0412]: cannot find type `size_t` in this scope
  --> system/security/keystore2/apc_compat/apc_compat.rs:79:23
   |
79 |     tbs_message_size: size_t,
   |                       ^^^^^^ not found in this scope

error[E0412]: cannot find type `size_t` in this scope
  --> system/security/keystore2/apc_compat/apc_compat.rs:81:30
   |
81 |     confirmation_token_size: size_t,
   |                              ^^^^^^ not found in this scope

error[E0412]: cannot find type `size_t` in this scope
   --> system/security/keystore2/apc_compat/apc_compat.rs:181:37
    |
181 |                 extra_data.len() as size_t,
    |                                     ^^^^^^ not found in this scope

Test: Treehugger
Change-Id: I848f481627f3c14caa6252eee6b5dd40d2f58eed
2022-12-07 11:57:25 +01:00
Seth Moore
003e381103 Merge "Revert "Keystore 2.0 km_compat: Cuttlefish does not return a vendor patch level."" 2022-12-06 21:52:06 +00:00
Shaquille Johnson
615ee36224 Add java_defaults to Android.bp and update default
This makes a java defaults and catches a few
places where the files were not updated
to use the default latest library version

Test: Run and tested using `atest keystore2_test` for Rust test and CTS test with `atest CtsKeystoreTestCases`
Change-Id: I2b67e482f341405e2aa23d53535e8b3d0b41cfab
2022-12-06 17:45:42 +00:00
Eran Messeri
637259c81f ID attestation: Pass 2nd IMEI to KeyMint
Pass the 2nd IMEI tag, if provided, to KeyMint.

Bug: 244732345
Test: atest android.keystore.cts.DeviceOwnerKeyManagementTest
Change-Id: I52aea1ba59c4337ba0003784abfc178ab0efee55
2022-12-05 13:18:01 +00:00
Treehugger Robot
4d6fb44a08 Merge "Add log message when keystore can't find IRPC" 2022-12-01 20:33:42 +00:00
Seth Moore
4685db34ff Add log message when keystore can't find IRPC
On older devices, keystore will not publish the remoteprovisioning
service. Add a log message so it's obvious when this happens instead
of silently swallowing errors.

Test: local build + logcat
Change-Id: Ic15f4574da86031a56f6d7c8a8339d364d9cc7b9
2022-12-01 10:04:09 -08:00
Shaquille Johnson
aec2eca4ca Update logs to use ks_err in rust code
Test: Run and tested using `atest keystore2_test` for Rust test and CTS test with `atest CtsKeystoreTestCases`
Change-Id: Ic8e62f1c5d19c6203945fefeb18b066bf8a32ed7
2022-11-30 17:52:38 +00:00
Chris Wailes
dabb6fe865 Fix warnings from rustc 1.65.0
Bug: 250026064
Test: m rust
Change-Id: I90d1ecde006d16967879cec4138e804ad246698d
2022-11-16 16:07:59 -08:00
Eran Messeri
7002b154de Merge "Route ECDH key import requests to Soft-KeyMint." 2022-11-15 14:49:00 +00:00
Seth Moore
cd6e918fbd Add dependencies on newly-split RKP HAL
Bug: 254112961
Test: vts_treble_vintf_vendor_test
Merged-In: I5506757aaebdf37d42bf7ac0a68e83f2d3c12049
Change-Id: I5506757aaebdf37d42bf7ac0a68e83f2d3c12049
2022-11-09 10:52:39 -08:00
Seth Moore
4c0d4b0a8c Add case for new "second IMEI" key tag
Bug: 244732345
Test: android.keystore.cts.DeviceOwnerKeyManagementTest
Merged-In: I243f83fb56a2397ec2e223bab10751417b49aed9
Change-Id: I243f83fb56a2397ec2e223bab10751417b49aed9
2022-11-09 10:52:32 -08:00
Eran Messeri
44e3fc2b3f Merge "Tests to verify importKey with Asymmetric and symmetric keys." 2022-11-04 15:59:14 +00:00
Rajesh Nyamagoud
2a285631e1 Route ECDH key import requests to Soft-KeyMint.
Since KeyMaster doesn't support ECDH, route all key ECDH key import
requests to Soft-KeyMint.

Bug: 216434270
Test: atest
CtsKeystoreWycheproofTestCases:com.google.security.wycheproof.JsonEcdhTest;
atest CtsKeystoreTestCases:android.keystore.cts.KeyAgreementTest#testGenerateSecret_withImportedKey

Change-Id: Ia4da2b319e2fc2b4fc6cceab7c3b66c6713dc3a0
2022-11-03 19:31:27 +00:00
Shaquille Johnson
32bd2673a9 Changed RP logs to only error when RKP only
This error occurs when there are no attestation keys to give
and is not a true error. In meeting it was decided that the
RKP keys being empty is fine and the only time to warn when
we are on an RKP only device.

Test: Run and tested using `atest keystore2_test` for Rust test and CTS test with `atest CtsKeystoreTestCases`
Bug: 241924261
Change-Id: I234493522ac59babad1a5dd315d7070eab9da3b9
2022-10-31 19:38:21 +00:00
Rajesh Nyamagoud
b8402b6d91 Tests to verify importKey with Asymmetric and symmetric keys.
- Test to import a RSA key and validate imported key parameters.
  Perform an operation using imported key. Test should be able to
  import the key and complete the operation successfully.

- Test to import a RSA key without specifying key size and public
  expenent. Determine key-size and public exponent from key material.
  Validate imported key parameters. Perform an operation using imported
  key. Test should be able to import the key and complete the operation
  successfully.

- Test to import a RSA key with incorrect key-size as import key
  parameter. Test should fail to import a key with an error code
  `IMPORT_PARAMETER_MISMATCH`.

- Test to import a RSA key with incorrect public exponent as import key
  parameter. Test should fail to import a key with an error code
  `IMPORT_PARAMETER_MISMATCH`.

- Test to import a RSA key with multiple pursposes [SIGN and ATTEST_KEY]
  as import key parameters. Test should fail to import a key with an
  error code `INCOMPATIBLE_PURPOSE`.

- Test to import a EC key without specifying curve. Determine ec-curve
  from key material. Validate imported key parameters. Perform an
  operation using imported key. Test should be able to import the key
  and complete the operation successfully.

- Test to import a EC key with incorrect ec-curve as import key
  parameter. Test should fail to import a key with an error code
  `IMPORT_PARAMETER_MISMATCH`.

- Test to import a AES, 3DES and HMAC keys. Validate imported keys
  parameters. Perform operations using imported keys. Test should
  be able to import the key and complete the operation successfully.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ib90c05b93929b8b0e1d4cb9542f5b8493a116c39
2022-10-28 01:33:16 +00:00
Rajesh Nyamagoud
2d532d9b3d Updated to return INVALID_ARGUMENT response code instead of
`SYSTEM_ERROR` while loading attest key.

While loading attest-key if it fails to find its blob or cert
then `INVALID_ARGUMENT` error reponse is returned instead of
`SYSTEM_ERROR`.
Bug: 254703846
Test: atest CtsKeystoreTestCases; atest keystore2_client_tests

Change-Id: Ie0d75c3bd99057b4c775e9c8f9dd91385cd6db81
2022-10-21 19:28:46 +00:00
Rajesh Nyamagoud
4d48337ffd Added tests using attest keys for signing RSA and EC keys.
- Generate EC/RSA attestation keys and use it for signing RSA and EC
  keys. Test should be able to use the attest keys for signing the
  generated keys successfully.

- Generate EC-CURVE_25519 attestation key and use it for signing RSA
  key. Test should be able to generate RSA key with EC-CURVE_25519 key
  as attestation key.

- Generate an asymmetric key which doesn't possess ATTEST_KEY purpose.
  Use this key for attesting asymmetric key. It should fail to generate
  key with incompatible purpose error.

- Generate a symmetric key. Try to use this symmetric key as attestation
  key while generating asymmetric key. It should fail to generate a key
  with system error.

- Try to generate symmetric key with valid attestation key,
  attstation-challenge and attestation-app-id. Test should generate a
  key without attestation record.

- Try to generate RSA/EC attestation keys with multiple purpose. Test
  should fail to generate keys with incompatible purpose error code.

- Generate an attestation key and try to use it for signing a key
  without providing attestation challenge. Test should fail with missing
  attestation challenge error.

Note: These tests are executed on devices where
`android.hardware.keystore.app_attest_key` feature is enabled, otherwise
tests are skipped.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I4228dc5fe5e207995472c3425d5f2696ef95249f
2022-10-20 16:09:02 +00:00
Shaquille Johnson
fd317c72d9 Merge "Changing code to have better error logging" 2022-10-20 15:20:33 +00:00
Tri Vo
4158567f46 Bump KM AIDL API to version 3
Test: m
Change-Id: If52436b0768557522e459ee0049e5cb4fcbf00cd
2022-10-18 12:21:55 -07:00
Shaquille Johnson
9da2e1cd3d Changing code to have better error logging
This changes the error logs to show the file and line number instead of
naming a specific a function where the error originated. In some cases
the function name is kept where it made sense for readibility of the
logs.

Test: Run and tested using `atest keystore2_test` for Rust test and CTS test with `atest CtsKeystoreTestCases`
Bug: 241924261
Change-Id: I2ea970dd83e18033506555f2726c716626697cdf
2022-10-18 15:08:41 +00:00
Tri Vo
113a1c95fb keystore2_test: Update to IRPC v3
Bug: 235265072
Test: m keystore2_test
Change-Id: Id9e9196670e2e18c9d5f509d444c41eafbfc47eb
2022-10-17 15:02:51 -07:00
Treehugger Robot
d45bc5b0bd Merge "Changes made in keystore2_client_tests to avoid test timeout issues." 2022-10-13 12:01:14 +00:00
Shaquille Johnson
1f1d5152b1 Update the Rust test to reflect the new Debug
Debug implementation was changed in https://android-review.googlesource.com/c/platform/frameworks/native/+/2239178.
This changes how enums made with declare_binder_enum are displayed by default. The updated strings print the Debug
implementation for the enum and check the values against that.

Test: Tested using `atest keystore2_test`
Bug: 252968848
Change-Id: I86a124432f83116b87c9b40c023851fac4030fb8
2022-10-11 14:44:35 +01:00
Rajesh Nyamagoud
c7d064d59f Changes made in keystore2_client_tests to avoid test timeout issues.
Added macros to generate test code for RSA and EC keys use cases.
Test cases are split to run them in distict test cases to avoid
timeout issues. Limiting RSA and EC each test cases to generate only
one key and perform an operation.

Bug: 242356276
Test: atest keystore2_client_tests
Change-Id: I2841734f329afb0005727da26cc5b9ff532b9e73
2022-10-05 18:57:51 +00:00
Rajesh Nyamagoud
dc4b612793 Changes to adapt ConfirmationUi AIDL interface.
apc_compat module updated to support confirmationui AIDL service without
altering the existing behavior with HIDL service. Higher precedence is
given to AIDL service.

Bug: b/205760172
Test: Run confirmation UI test using CTS Verifier
Change-Id: I0fac9b3a7ea0d4d63cb76111ccd95d52b10a047e
2022-09-29 18:02:05 +00:00
Shaquille Johnson
f0606d4b2d Merge "Run rustfmt and add rustfmt.toml to directory" 2022-09-20 09:14:08 +00:00
Shaquille Johnson
04a34cf10a Run rustfmt and add rustfmt.toml to directory
Runs the formatting command and adds a directory formatter
to the keystore2 for standardized directory formatting.

Test: Formatting change
Change-Id: I56230f57dcfd3e48c7c9e39e1362bb67ebc7862e
2022-09-19 11:23:31 +00:00
Charisee
28e6f0b066 Change request for Rust v1.64.0
note from clippy: https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain

Please check change for correctness.

bug: 243420629
Test: test_compiler.py
Change-Id: If64daae01c3bf6d83b80f624c1f5603fae171a2d
2022-09-15 23:49:23 +00:00
Tri Vo
735f9cb643 Use latest Keystore2 AIDL API
Test: m
Change-Id: I19510de8dcf384fc30bb8d2b1bf9116de5bd7eb1
2022-09-06 17:27:28 -07:00
Tri Vo
a99ac4e96e Merge "Use latest KM AIDL API" 2022-09-06 20:58:36 +00:00
Tri Vo
d4f0a180dc Use latest KM AIDL API
Test: m keystore2_legacy_blobs_test
Change-Id: Ia76f720ffdacdfe8496e716890df50586e67753e
2022-09-02 18:03:05 -07:00
Eran Messeri
6d9481b7f0 Merge "Run rustfmt on directory" 2022-09-02 14:25:29 +00:00
Shaquille Johnson
bcab601c03 Run rustfmt on directory
Runs rustfmt on keystore2 to standardize formatting changes.

Test: Formatting change so no test needed
Change-Id: I24208f8fe91e6b15108eef0ff5264a3f086497e4
2022-09-02 13:17:54 +00:00
Treehugger Robot
ffcc8fd2ef Merge "Added HMAC key generation tests." 2022-09-02 11:14:01 +00:00
Treehugger Robot
5af917188a Merge "Adding a test to simulate OPERATION_BUSY error from keystore." 2022-09-02 10:00:04 +00:00
Rajesh Nyamagoud
01d4cde74a Adding a test to simulate OPERATION_BUSY error from keystore.
The test tries to create a race condition: It creates an operation
and starts two threads, each trying to use the operation repeatedly
until it gets  `OPERATION_BUSY`  or finishes successfully.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ib3549d6bcad4e24bf621960f0f399481bf2da7c7
2022-08-31 18:27:03 +00:00
Rajesh Nyamagoud
4c6193c217 Added HMAC key generation tests.
- Generate HMAC keys with digest modes [SHA1, SHA_2_224, SHA_2_256,
  SHA_2_384, SHA_2_512], should be able to create operations using
  generated keys successfully.

- Try to generate HAMC keys with key size in the range 0..513. For
  invalid key size, key generation should fail with an error code
  `UNSUPPORTED_KEY_SIZE`.

- Generate HMAC keys with min-mac-lengths in the range 0..257. For
  invalid min-mac-length, key generation should fail with an error
  code `UNSUPPORTED_MIN_MAC_LENGTH`.

- Try to generate HMAC key with multiple digest modes, key generation
  should fail with an error code `UNSUPPORTED_DIGEST`.

- Try to generate HMAC key without providing digest mode, key
  generation should fail with an error code `UNSUPPORTED_DIGEST`.

- Try to generate HMAC key with digest mode `NONE`, key
  generation should fail with an error code `UNSUPPORTED_DIGEST`.

- Generate HMAC key with min-mac-length of 128 bits and digests
  [SHA1, SHA-2-224], try to create operations with mac-len greater than
  digest lengths. Test should fail to create an operation with an error
  code `UNSUPPORTED_MAC_LENGTH`.

- Generate HMAC key with min-mac-length of 128 bits and digests
  [SHA1, SHA-2-224], try to create operations with mac-len less than
  min-mac-length. Test should fail to create an operation with an error
  code `INVALID_MAC_LENGTH`.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I594c9718b0f6a67f2655faca4bf100abf2ced3a3
2022-08-31 18:22:08 +00:00
Ryan Prichard
9cf7f66c51 Add missing assert.h and functional includes
Bug: http://b/175635923
Test: treehugger
Change-Id: Ib062da6888e560fed3abd389dad3dfbf4cb4f3fa
2022-08-30 17:35:03 -07:00
Paul Crowley
f71fe8a1e5 Use ro.keystore.boot_level_key.strategy
Choose the strategy for generating the boot level  key from a property,
if present, instead of looking at KM versions.

Bug: 241241178
Test: set property on Cuttlefish, check logs for strategy used.
Change-Id: I2c7a6fb2c6471ab4a7cb7f650791930f41068bfa
2022-08-24 10:03:46 -07:00
Paul Crowley
e1e1723781 Refactor L0 key handling ahead of fix
Bug: 241241178
Test: treehugger
Change-Id: I3b9c6dcda0a9b8d57d6d4e8be8f9eddf59d3b89f
2022-08-24 10:03:46 -07:00
Treehugger Robot
65f8bf69c5 Merge "Added keystore2_unsafe_fuzzer" 2022-08-22 05:42:53 +00:00
Treehugger Robot
767a2e3f7f Merge "Update source for Rust 1.63.0" am: e3973b49eb
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2184738

Change-Id: I1e3bc3bbb2b22475d103f8944a2fdd85363da811
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-12 19:40:58 +00:00
Treehugger Robot
e3973b49eb Merge "Update source for Rust 1.63.0" 2022-08-12 19:13:34 +00:00
Chris Wailes
263de9f8d7 Update source for Rust 1.63.0
Test: m rust
Bug: 241303140
Change-Id: I3b4d8c1c3101941258e366279bfd2a4a3ab1b948
2022-08-12 10:36:10 -07:00
Eran Messeri
f73b2d0470 Merge "Updated listEntries API response code with invalid domain field." am: 6ec53e3489
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2166105

Change-Id: I85422389dfa79e167cd1258dfa4ef5fba5565104
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-12 14:09:57 +00:00
Eran Messeri
6ec53e3489 Merge "Updated listEntries API response code with invalid domain field." 2022-08-12 13:20:09 +00:00
Treehugger Robot
af75992ff6 Merge "Added tests using 3DES algorithm." am: 99fe2aeaec
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1967149

Change-Id: I1d3622e893b7f99d6aa058b6d172d461d32660e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-12 11:34:28 +00:00
Rajesh Nyamagoud
c3523bacff Added tests using 3DES algorithm.
- Generate 3DES keys with block modes [ECB, CBC] and padding modes
  [NONE, PKCS7]. Should be able to create operations successfully
  with these generated keys.

- Try to generate a key and create an operation with invalid inputs, it
  should fail with proper error codes
  - with unsupported key size
  - with unsupported padding mode
  - with padding mode NONE and input text whose length isn't a
    multiple of the DES block size
  - with unsupported blockmode

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ida98fd2e6f9b7ba84b8beba9ea979d5aeb2240ee
2022-08-12 02:09:46 +00:00
Rajesh Nyamagoud
16198a3ca9 Updated listEntries API response code with invalid domain field.
Updated to return `INVALID_ARGUMENT` instead of `PERMISSION_DENIED`
response code when domain is other than `APP` or `SELINUX`.

Added tests to validate `listEntries` API with valid domains `APP and
SELINUX` and invalid domains like `BLOB`.

Bug: 239719010
Test: atest CtsKeystoreTestCases; atest keystore2_client_tests;
Change-Id: I7d10c13342ca5719682e371e428fa42f992ba07d
2022-08-12 00:03:57 +00:00
Treehugger Robot
727b510c18 Merge "Restructured keystore2 client tests." am: a00741ceb6
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2176242

Change-Id: Ic950a2695f904ac436817fea368779a30e14fc34
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 17:16:45 +00:00
Rajesh Nyamagoud
609846ad49 Restructured keystore2 client tests.
Separated out the tests based on functionalities and created a separate
modules without modifying the existing test cases.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ifc93b3ce69817469d1d5f01844c623f5209e2b62
2022-08-04 23:52:30 +00:00
Devendra Singhi
31863b1ab5 Added keystore2_unsafe_fuzzer
Test: ./keystore2_unsafe_fuzzer
Bug: 240524901

Change-Id: Ibb6d2c649f982bc1b5fc8d4a259087e53bac79aa
2022-08-04 14:33:29 +05:30
Treehugger Robot
3615d1fe47 Merge changes Ibf1b8460,I16843932 am: 32cf305fc5
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1941336

Change-Id: I19df4d4b5221e399010b9cab337834005e6fa5da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 17:40:04 +00:00
Treehugger Robot
32cf305fc5 Merge changes Ibf1b8460,I16843932
* changes:
  Adding tests using AES algorithm.
  Adding generate key tests using RSA algorithm.
2022-08-03 17:32:48 +00:00
Rajesh Nyamagoud
4740993bf1 Adding tests using AES algorithm.
- Generate AES keys with block modes [ECB, CBC] and padding modes [NONE,
  PKCS7]. Should be able to create operations successfully with these
  generated keys.

- Generate AES keys with block modes [CTR, GCM] and padding modes [NONE,
  PKCS7]. Should be able to create operations successfully with padding
  mode NONE. With PKCS7 padding mode creation of an operation should
  fail with incompatible padding mode.

- Try to generate a key and create an operation with invalid inputs, it
  should fail with proper error codes.
  - with unsupported key size
  - with GCM block mode without providing min-mac-length
  - with multiple block modes
  - with multiple padding modes
  - with incompatible padding modes
  - with incompatible block modes
  - with missing mac-length
  - with invalid mac-length
  - with unsupported mac-length
  - With AES-CBC-PKCS7 key without `CALLER_NONCE` authorization, Try to
    set nonce while creating an operation.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ibf1b8460317b4c99d9060d5889c8b3778a80ca5b
2022-07-22 18:58:41 +00:00
Rajesh Nyamagoud
11912eaf78 Adding generate key tests using RSA algorithm.
- Generate RSA signing keys with combinations of digest modes [NONE,
  MD5, SHA1, SHA_2_224, SHA_2_256, SHA_2_384, SHA_2_512] and padding
  modes [NONE, RSA_PKCS1_1_5_SIGN, RSA_PSS]. Should be able to
  create operations using these keys except in below cases.
   - when padding mode is RSA_PSS and digest mode is NONE
   - when padding mode is NONE and digest is other than NONE.

- Generate RSA encrypt/decrypt keys with OAEP padding mode, combinations
  of digests [MD5, SHA1, SHA_2_224, SHA_2_256, SHA_2_384, SHA_2_512] and
  mgf-digests [MD5, SHA1, SHA_2_224, SHA_2_256, SHA_2_384, SHA_2_512].
  Should be able to create operations with these generated keys
  successfully.

- Generate RSA encrypt/decrypt keys with combinations of padding modes
  [NONE, RSA_PKCS1_1_5_ENCRYPT, RSA_OAEP], digests [NONE, MD5, SHA1,
  SHA_2_224, SHA_2_256, SHA_2_384, SHA_2_512]. Should be able to create
  operations with these generated keys successfully except in below case
   - with padding mode RSA_OAEP and digest mode NONE an error is
     expected.

- Generate RSA encrypt/decrypt keys with padding modes [NONE,
  RSA_PKCS1_1_5_ENCRYPT, RSA_OAEP] and without digests. Should be able
  to create operations with these generated keys successfully.

- Generate RSA keys without padding modes and digest modes. Creation of
  an operation should fail with unsupported padding mode error.

- Tests to validate failure of generating RSA keys with incompatible
  purpose, unsupported purpose, unsupported padding mode, unsupported
  digest and unsupported key sizes.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I16843932cc170d0e820208f558587aacf13b9272
2022-07-22 17:54:16 +00:00
Andrew Scull
9cb85479f3 Merge "Allow virt APEX to use diced and open_dice_cbor" am: af43ae73f9
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2151395

Change-Id: I6c44929e72db1bf1d65cfcfa43d9bbcd20d08f89
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 09:51:20 +00:00
Andrew Scull
af43ae73f9 Merge "Allow virt APEX to use diced and open_dice_cbor" 2022-07-19 09:27:41 +00:00
Vikram Gaur
6d4c60eaaa Merge "Support upgrade key for software-emulated keys." am: 65467fba1f
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2155233

Change-Id: I231789a61c60244bb925a53e90bc7a82d1284135
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-18 21:32:17 +00:00
Vikram Gaur
65467fba1f Merge "Support upgrade key for software-emulated keys." 2022-07-18 21:11:36 +00:00
Eran Messeri
794cf95437 Merge "Adding tests using Domain::KEY_ID." am: 75aa039b3d
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1924617

Change-Id: I3843abf5ab1d0d0c284593486d1c0217a88618a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-18 11:38:32 +00:00
Eran Messeri
75aa039b3d Merge "Adding tests using Domain::KEY_ID." 2022-07-18 11:11:16 +00:00
Vikram Gaur
856b1cdc9c Support upgrade key for software-emulated keys.
Currently software-emulated keys do not have any update mechanism. Any
software key that is created in previous versions cannot be used once
the device is upgraded. With this change, keys now can be upgraded and
used by the latest keystore.

Change-Id: Ic791baeedd7775df7eafca405440e645b19ec2bc
Test: TreeHugger
Fixes: 223376764
2022-07-17 23:53:20 +00:00
Rajesh Nyamagoud
54f6590f60 Adding tests using Domain::KEY_ID.
- Test to verify that Domain::KEY_ID is not allowed for generating
   a key. Try to generate a key with domain as KEY_ID and expect an
   error.

 - Test to find key entry with domain as KEY_ID.
   Generate a key and load it with domain as KEY_ID. Test should be
   able to create an operation using the key loaded with domain as
   KEY_ID.

 - Generate a key with an alias. Generate another key and bind it with
   same alias. Verify that originally generated key no longer exists
   and report an error if we try to use it.

 - Generate a key with an alias. Load the generated key with domain
   KEY_ID. Generate another key and bind it with same alias. Verify
   that originally loaded key no longer exists and report an error
   if we try to use it.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: Ibfe237181311decf5f6f00dc222d5cd124e4ac11
2022-07-15 15:00:16 +00:00
Andrew Scull
f4a6e2842d Allow virt APEX to use diced and open_dice_cbor
Microdroid payloads use diced to access their secrets and BCCs. The
open_dice_cbor then gives them safe rust bindings to open-dice to
process them. There's a dependency on ZVec which pulls in
libkeystore2_crypto.

Test: build, TH
Change-Id: I402a9a416d7b0e0eed2e268495b148e5669e5c52
2022-07-12 15:27:00 +00:00
Treehugger Robot
356277b1d0 Merge "Extend attestation key expiration buffer to 12 hours" am: b075b8e4a1
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2147406

Change-Id: Ieeeabab95f50b47ce607dadeae5982833d7d3613
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 21:46:35 +00:00
Treehugger Robot
b075b8e4a1 Merge "Extend attestation key expiration buffer to 12 hours" 2022-07-07 21:32:38 +00:00
Seth Moore
056106fce4 Extend attestation key expiration buffer to 12 hours
This buffer time is how far into the future keystore looks to mark
a key as "old" and needing deletion.

The old buffer time was only 20 seconds, which may not even be enough
for very slow network (where round trips and retries could take
minutes).

Test: keystore2_test
Change-Id: I27869458ec66e546b42fe344bbdffd32881c84e7
2022-07-07 09:53:51 -07:00
Eran Messeri
201f14ce45 Merge "Updated to return INVALID_ARGUMENT on generateKey with invalid domain field." am: 47fce38faa
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2106689

Change-Id: Ie49808093ad5f251055a8dfcb9a2bb50dddcba0e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 11:32:23 +00:00
Rajesh Nyamagoud
caee93eb89 Updated to return INVALID_ARGUMENT on generateKey with invalid domain field.
Bug: 211005249
Test: atest keystore2_client_tests
Change-Id: I1c2a8f66f2e3a6897d5a2bf48b65fb97bcf9903b
2022-07-06 14:43:29 +00:00
Eran Messeri
f57fec002f Merge "Adding generateKey tests with EC key algorithm." am: 28f5a40002
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1920127

Change-Id: I66bb058ce6b1fe73904305a01256caea19462045
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 15:47:22 +00:00
Eran Messeri
28f5a40002 Merge "Adding generateKey tests with EC key algorithm." 2022-07-05 15:23:48 +00:00
Rajesh Nyamagoud
a7766455e9 Adding generateKey tests with EC key algorithm.
Test 1: Should fail to generate a key with domain not listed
        in keystore2::Domain.
Test 2: Should fail to generate a EC key without providing curve.
Test 3: Should fail to generate a EC key with 25519 curve having
        sign and agree_key purposes.
Test 4: Generate a EC keys with `NONE, MD5, SHA1, SHA-2 224,
        SHA-2 256, SHA-2 384 and SHA-2 512` digest modes and P_224,
	P_256, P_384, P_521 ec curves combinations. Should be able
	to create operations with these keys successfully for all
	digest modes except NONE and MD5.
Test 5: Generate a EC key with curve CURVE_25519 and digest mode NONE.
	Should be able to create an operation with digest mode NONE.
Test 6: Generate a EC keys with curve CURVE_25519 and digest modes
        `MD5, SHA1, SHA-2 224, SHA-2 256, SHA-2 384 and SHA-2 512`
	combinations. Creation of an operation should fail with
	unsupported digest error.
Test 7: Should fail to create an operation with incompatible digest
        mode in key authorizations.
Test 8: Test for key owner validation. Generate a key in one user and
        try to use it in another user context where it should fail to
	load the key as it doesn't own the key generated by prior user.
Test 9: Generate a key with Domain::BLOB. Verify that key descriptor
        holds the key blob. Try to use this key to perform an operation
	successfully.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I8b923cfdd9dbd50d1ebaab03560e9378ede7cdee
2022-07-01 16:24:41 +00:00
Treehugger Robot
30a630eaf8 Merge "Update for Rust v1.62.0" am: b304d464ef
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2143072

Change-Id: I4b7feea0880ed6c3ed2c8fffcaf77fdffb713285
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 06:11:58 +00:00
Treehugger Robot
b304d464ef Merge "Update for Rust v1.62.0" 2022-07-01 05:53:18 +00:00
Charisee
9761d85cbb Update for Rust v1.62.0
See https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix
Test: run test_compiler.py

Bug: 236723597
Change-Id: I98230b7584bfda1cb0119aca92e8068dfb588429
2022-07-01 01:49:12 +00:00
Eran Messeri
fcee89c861 Merge "Test keystore grant with invalid access vector values." am: 7293ffc837
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2129785

Change-Id: I410731246ffcaa818bc90fb22c5fd535d79d51da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-30 10:22:57 +00:00
Eran Messeri
7293ffc837 Merge "Test keystore grant with invalid access vector values." 2022-06-30 09:16:06 +00:00
Xin Li
ae7b082370 Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: Ib81fb65570a4e9eb7e7b051f9791071ee78dc02f
Change-Id: Ic18cb2c00c503dae6b663c8895106bb039a73f73
2022-06-27 23:40:17 +00:00
Charisee Chiw
593b919baa Merge "Update for Rust v1.62.0" 2022-06-27 20:37:10 +00:00
Charisee
b48992e50e Update for Rust v1.62.0
Code triggered an error. See https://rust-lang.github.io/rust-clippy/master/index.html#map_identity

Please check for correctness

Test: Ran test_compiler.py
Bug: 236723597
Change-Id: I4f4119f4d9fab5baa58b60a1de3c6e8210df1432
2022-06-27 20:35:41 +00:00
Rajesh Nyamagoud
7fe5592037 Test keystore grant with invalid access vector values.
- Test to verify grant API with invalid access vector, it is expected to
  fail with proper error code.

- Test to verify grant API with empty access vector, it is expected to
  succeed granting a key with empty access vector. In grantee context
  while trying to use this key permission denied error is expected.

- Test to verify grant API with valid access vector, it is expected to
  successfully grant a key. Grantee should be able access the key and
  use it according to granted key permissions.

Bug: 236253306
Test: atest keystore2_client_tests
Change-Id: I20dc31b0e4f888f2bf740f84e3bb7b0e97a1bb52
2022-06-27 15:25:03 +00:00
Eran Messeri
a5de861f0b Merge "Mark unused policy as such." 2022-06-24 12:34:56 +00:00
David Drysdale
66dcde13c9 Merge "Adding tests to Create forced operation with different contexts." am: ab6edec03c am: 58a553fb5c
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1915146

Change-Id: Ifa23368c3f3ad328463531e90bce2fd01b09f5db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 16:24:07 +00:00
David Drysdale
ab6edec03c Merge "Adding tests to Create forced operation with different contexts." 2022-06-22 15:50:04 +00:00
Shawn Willden
c1a95385e5 Merge "Do not use RKP for DEVICE_UNIQUE_ATTESTATION." am: 053c2ad995 am: 8f9115b9c3
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2131735

Change-Id: If963604991cea55349138239e0ff6e5a2b109c30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 17:52:04 +00:00
Shawn Willden
053c2ad995 Merge "Do not use RKP for DEVICE_UNIQUE_ATTESTATION." 2022-06-21 17:12:43 +00:00
Max Bires
285db9f636 Do not use RKP for DEVICE_UNIQUE_ATTESTATION.
Keystore2 previously did not process the DEVICE_UNIQUE_ATTESTATION tag.
This was an unnecessary step when there was no ability to select the
attestation key provided to the backing Keymaster instance. Now,
however, Keystore2 does need to process generateKey requests for this
tag. This is because it will pass in an RKP key by default and append
those certificates to the result if RKP is present.

This change alters Keystore2 behavior during attestation key selection.
If the DEVICE_UNIQUE_ATTESTATION tag is present, it will no longer
attempt to select an RKP key and will instead pass nothing in the
attestKey argument for KM.

Bug: 234413909
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testKeyManagement
Change-Id: Ib81fb65570a4e9eb7e7b051f9791071ee78dc02f
2022-06-20 00:09:31 -07:00
Rajesh Nyamagoud
dc6fb23808 Adding tests to Create forced operation with different contexts.
Verify that the clients (for ex: clients with `vold` context) with
`req_forced_op` permission are allowed to create forced (unpruneable)
operations otherwise the creation of forced operation is denied.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I73d85ac127274e623095e233368b0211f6738d6e
2022-06-16 15:22:09 +00:00
Eran Messeri
653932e4ff Mark unused policy as such.
The usage of unique device identifiers is enforced via Android system
permission, not SELinux policy.

Mark the USE_DEV_ID SELinux policy as unused.

Bug: 235987410
Test: atest keystore2_test
Change-Id: I89e61eaf5d1f708e3ce10a90cf33d90946009201
2022-06-16 14:42:52 +01:00
Eran Messeri
f65864873e Merge "KeystoreDB::load_access_tuple method response code updated." am: 066f33a9a6 am: a9a67a281c
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2100736

Change-Id: Ic4c2748a4bf221db565690c0fdf7cc62c3711f6b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-16 09:48:47 +00:00
Eran Messeri
7753dffc13 Merge "Adding operation pruning test (DoS)" am: b243619833 am: bdf9071602
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1913620

Change-Id: Id780285218cc8908ee55f3830899fb2ead2bbf09
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:57:56 +00:00
Rajesh Nyamagoud
625e589598 KeystoreDB::load_access_tuple method response code updated.
For any Domain value other than APP, SELINUX, GRANT and KEY_ID it is
updated to return response code as ResponseCode::INVALID_ARGUMENT
instead of ResponseCode::SYSTEM_ERROR.

Bug: 232022823
Test: atest keystore2_client_test; atest CtsKeystoreTestCases
Change-Id: I48314558fb2e77636fa99f42f8326fa99f719a4f
2022-06-14 15:18:24 +00:00
Eran Messeri
b243619833 Merge "Adding operation pruning test (DoS)" 2022-06-14 10:57:00 +00:00
David Drysdale
736c9ca282 Merge "keystore2: transfer RootOfTrust from TEE to SB" am: 7fd9887f76 am: 0f76c52307
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2031823

Change-Id: I5c17f1ab30aef36065421fa68f5c4fb73fa5f4ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-06 05:59:17 +00:00
Rajesh Nyamagoud
5a60f2f9d3 Adding operation pruning test (DoS)
Creating n number of operations from same owner. Expecting creation
of all operations should be successful without any error. Whenever all
operation slots are full older operations are expected to be pruned.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I9d231658e77cb10f67cfd248072bde0755c1660d
2022-06-01 20:32:25 +00:00
David Drysdale
ecd403db8b keystore2: transfer RootOfTrust from TEE to SB
Bug: 219076736
Test: manual, RoT between locally modified KeyMints
Change-Id: Iad3f14afc9d853e91cc7f7810fd6e592b48cab2d
2022-05-30 15:41:56 +01:00
Vikram Gaur
593315b166 Merge "Unbind Attestation keys when freeing up namespace." am: cc15f26ecd am: 8d4fe32328
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2105145

Change-Id: Ib7e8de0a26d5b55a70c748c5c1df0ca872670422
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 23:10:54 +00:00
Vikram Gaur
1a98f9cca9 Unbind Attestation keys when freeing up namespace.
In https://android-review.googlesource.com/c/platform/system/security/+/1698833
we added a check only for client keys. However, this means that on application
deletion only the keystore keys related to the application are unbound and the
attestation keys get orphaned.

Through this change, I am planning to unbind the attestation keys related to
the application as well.

Change-Id: I1c9d1ac6d6943cc53f5d74653e3da72cd4f2adf7
Test: atest keystore2_test
BUG: 232534682
2022-05-25 21:58:34 +00:00
David Drysdale
5fc3690ddb Merge "Adding forced operation tests" am: c28640b55e am: 2954e3ebbc
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1908978

Change-Id: Ib6ccae4f671d612d2070fa17ce0ce89d1e081dfc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 08:32:05 +00:00
David Drysdale
c28640b55e Merge "Adding forced operation tests" 2022-05-23 08:07:00 +00:00
Hasini Gunasinghe
64ac1f8e96 Merge "Log SecurityLevel with RkpErrorStats." 2022-05-20 18:04:02 +00:00
Treehugger Robot
95812634ba Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/security" am: b8f4e7c6cc am: c73face06b
Original change: https://android-review.googlesource.com/c/platform/system/security/+/2098085

Change-Id: Ia2da489e76001fdb8d759ea9a2ab391aa820feff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 16:24:16 +00:00
Rajesh Nyamagoud
fa7c0f1c41 Adding forced operation tests
- Forced operation creation with all slots filled with normal operations
- Forced operation creation with all slots filled with forced operations

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I493ea1c25d09597c44add430a20b5ca9c983e8d3
2022-05-20 15:40:03 +00:00
Bob Badour
ae667ea93c [LSC] Add LOCAL_LICENSE_KINDS to system/security
Added SPDX-license-identifier-Apache-2.0 to:
  keystore2/tests/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I816f5ba7db5e359b97f1bd0222ca43eebacfc4d1
2022-05-19 09:15:17 -07:00
Hasini Gunasinghe
1a8524bd0f Log SecurityLevel with RkpErrorStats.
Bug: 230750270
Test: Local testing with statsd TestDrive script
Merged-In: I8490e31df4a111ff6787ea67dd8a170b410566df
Change-Id: I8490e31df4a111ff6787ea67dd8a170b410566df
2022-05-18 06:26:45 +00:00
David Drysdale
636558b60f Merge changes I52f95a7c,Iabe9af74 am: dfa8b21553 am: 519482d959
Original change: https://android-review.googlesource.com/c/platform/system/security/+/1880749

Change-Id: I943aae0c74dc34ae3a9a2dff86b74fb740582878
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-17 06:32:05 +00:00
Rajesh Nyamagoud
b881d5189c Adding test to create BACKEND_BUSY error
Creates multiple child procs and creates opearations in it and
parent proc waits for all child procs operations status, expects
one or more opearations to fail with backeend busy error.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I52f95a7cfd031d80c88bfc2ca478a26572f40150
2022-05-13 22:30:16 +00:00
Rajesh Nyamagoud
45689e569c rust_defaults entry created for Keystore2 AIDL library.
A rust_defaults "keystore2_use_latest_aidl_rust" that includes the latest
Keystore2 AIDL library. Modules that depend on Keystore2 directly can include
this rust_defaults to avoid managing dependency versions explicitly

Test: Compile
Change-Id: Iabe9af743c4ceb787db42ff7cc619bab97ec55c4
2022-05-13 19:33:36 +00:00
Hasini Gunasinghe
5657d5fed1 Log SecurityLevel with RkpErrorStats. am: adf6692b3e
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/security/+/18350667

Change-Id: Ib67a160314b99f48ee0c5cf9e0dc07e2ea76423b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 21:48:04 +00:00
Hasini Gunasinghe
adf6692b3e Log SecurityLevel with RkpErrorStats.
Bug: 230750270
Test: Local testing with statsd TestDrive script
Ignore-AOSP-First: This targets T and will be cherry-picked to AOSP later.
Change-Id: I8490e31df4a111ff6787ea67dd8a170b410566df
(cherry picked from commit d675e225a7)
2022-05-12 16:58:55 +00:00
David Drysdale
e2c4f0fcf4 Merge "Drop ancient default salt value" 2022-04-22 07:12:24 +00:00
Seth Moore
dfdcb87504 Do not cache rkp_only property
To allow for testing, read the rkp_only properties every time instead
of caching the value. This allows the RemoteProvisioner tests to alter
the property, moving the device in and out of rkp-only mode.

Test: RemoteProvisionerUnitTests
Bug: 27306369
Change-Id: If9a616fd36095175f4aea07c897c67a11eb04bcf
2022-04-20 17:14:25 -07:00
Treehugger Robot
90c23a8c17 Merge "Fix lints from Rust 1.60.0" 2022-04-20 08:55:13 +00:00
Chris Wailes
20f50df906 Fix lints from Rust 1.60.0
Bug: 222737227
Test: m rust
Change-Id: I4f35c8e50a1837608ab69a7609caff9c485e8c85
2022-04-19 17:23:52 -07:00
David Drysdale
6a0ec2ca08 Drop ancient default salt value
A value for the salt is present in all code paths:

- All callers of `Password::derive_key` pass a `Some(..)` value for the
  salt.  Remove this `Some` everywhere and...
- Change the signature of `derive_key` to expect a `&[u8]` for `salt`
  rather than an `Option<&[u8]>`.
- `Password::derive_key` is the only caller of `generateKeyFromPassword`
  (via bindgen to C++-land), so...
- Make it clear that the C++ `generateKeyFromPassword()` function
  expects 16 bytes of `salt`.

Bug: 172121323
Test: compile, TreeHugger
Change-Id: I41966cce96b5371785680c13bacfc5f95969372a
2022-04-19 11:25:26 +01:00
Seth Moore
562aebb873 Ensure that "rkp only" forces checks for rkp keys
An empty key pool should not allow fallback to the batch key if the
vendor indicates the system is rkp only.

Additionally, if the system is misconfigured (e.g. marked as rkp only
and has no remotely provisioned component hal) then we should insist
on checking RKP keys anyway. This will result in the given system
always returning OUT_OF_KEYS, which will fail various tests.

Test: keystore2_test
Test: RemoteProvisionerUnitTests
Bug: 227306369
Change-Id: I027bc56ff167abf99b18be01dccf05f90dd07f2a
2022-04-18 17:03:27 -07:00
Treehugger Robot
678a6f5af4 Merge "Turn on AFDO for keystore2" 2022-04-16 05:12:02 +00:00
Seth Moore
8c06c3e872 Fix unique id attestation on devices with keymaster
The wrong tag was included in the km_compat layer filter code for
key generation tags. This prevented the INCLUDE_UNIQUE_ID tag from
being passed to keymaster, breaking unique id attestation on platforms
with keymaster (keymint functionality was correct).

Test: KeyAttestationTest
Fixes: 228851969
Change-Id: I81ef55bb92c9869102a741e64375b883c3443224
2022-04-13 15:31:02 -07:00
Bob Badour
11a8dab786 [LSC] Add LOCAL_LICENSE_KINDS to system/security
Added SPDX-license-identifier-Apache-2.0 to:
  keystore2/tests/legacy_blobs/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ifc2e14a9b60e364323794eaa5a8c181c4f0a78ee
2022-04-07 10:44:12 -07:00
Seth Moore
bdccd287c6 Merge "Add a new permission check around unique id attestation" 2022-04-06 12:40:27 +00:00
Seth Moore
8e95c7ce03 Merge "Return OUT_OF_KEYS if system is rkp only" 2022-04-04 23:10:32 +00:00
Max Bires
65207b5f10 Return OUT_OF_KEYS if system is rkp only
This change leverages the ro.remote_provisioning.rkp_only system
property in order to determine whether or not the system has fallback
keys. If there are no fallback keys, then ks2 will now return
OUT_OF_KEYS as a ResponseCode to the caller over the binder interface.

This will allow the caller to call generateKey() on the
RemoteProvisioner AIDL interface, blocking until the call is returned.
At this point, keys will either have been provisioned, or an actionable
error can be routed back to the developer.

Bug: 227306369
Test: atest RemoteProvisionerUnitTests
Change-Id: I8f5bc5add4ab895ab95c9e4e70e6fc9fa4422da5
2022-04-04 11:20:10 -07:00
Seth Moore
66d9e908bf Add a new permission check around unique id attestation
Allow an application to either have an selinux permission or a
privileged application permission to request a unique id attestation.
Eventually, we will remove the sepolicy permission. However, until
GMSCore is updated to pick up the new permission, keep the policy
around.

Test: KeyAttestationTest
Bug: 216778747
Change-Id: I2401ca630d1599f0399b47e1fd9dd88d78318b95
2022-03-30 11:18:00 -07:00
Janis Danisevskis
005400ef16 Keystore 2.0: Add legacy blob test to TEST_MAPPINGS
Test: keystore2_legacy_blob_test
Change-Id: Ifdd50bf2d837fc9120b0f847adca18bfde2be0ff
2022-03-29 19:59:48 +00:00
Rajesh Nyamagoud
3b6427961c Adding tests to validate support for encrypted legacy blobs.
Bug: 213173772
Bug: 213172664
Bug: 203101472
Test: atest keystore2_legacy_blobs_test
Change-Id: I3c898c4447c114dd6a9481615a3366c76ad3a2bb
2022-03-29 17:48:21 +00:00
Rajesh Nyamagoud
901386c2c4 Create authorizations and key_generations test modules -
- authorizations: helper struct to create set of key authorizations
   - key_generations: helper methods to generate various keys.

Test: N/A
Change-Id: I23250838b7b6d8ad59f5ef8682861a07e856299f
2022-03-25 19:51:23 +00:00
Janis Danisevskis
5d772ef30a Keystore 2.0: Make KeyParameters serializable.
This is required to enable keystore client tests.
Test: keystore2_test

Change-Id: I6e3c81180244e45f403d8d79c86650dcd33cc21a
2022-03-24 14:34:11 -07:00
John Wu
1713e4867d Merge "Remove functionality to migrate keys across app UID" 2022-03-23 16:06:00 +00:00
Treehugger Robot
5a27d8ceac Merge "Restructred blob utilities to make them accessible in tests." 2022-03-19 00:50:48 +00:00
Treehugger Robot
13269794f6 Merge "Don't pass Tag::INCLUDE_UNIQUE_ID to attestKey" 2022-03-18 16:57:35 +00:00
Shawn Willden
bb0d0f4fea Don't pass Tag::INCLUDE_UNIQUE_ID to attestKey
Bug: 214916241
Test: Manual
Change-Id: I6237463ad9aaab76ad81ff6c438a39a703cced65
2022-03-17 10:28:17 -06:00
Rajesh Nyamagoud
69a850511b Restructred blob utilities to make them accessible in tests.
Creating a new library "libkeystore2_with_test_utils" where it includes blob utils
apis and sample test vectors based on feature flag keystore2_blob_test_utils.

Bug: 213173772
Bug: 213172664
Bug: 203101472
Test: keystore2_test
Change-Id: I869d27d1d3e8c6d28d8f5e5d6aed4305b5265816
2022-03-17 00:35:43 +00:00
Janis Danisevskis
04945eba3d Keystore2 Tests: Revisit run_as function.
This CL adds run_as_child which starts a child asynchronously and
returns a handle that allows waiting for and communicating with the
child process.

Test: keystore2_test_utils_test
Change-Id: Ibde858f249c94295b5f1c0c0cb29b8a98fb98a3a
2022-03-16 13:21:56 -07:00
John Wu
889c1ccfcf Remove functionality to migrate keys across app UID
- Remove the listEntries API in IKeystoreMaintenance
- Remove the ability to migrate keys across UIDs in the APP domain

Test: m keystore2
Bug: 220015249
Change-Id: I513e5b485b026825b9e7f8c86a1e8fb89247ab3d
2022-03-14 16:02:56 -07:00
Janis Danisevskis
c5f7b62d69 Keystore 2.0: km_compat: Fix ref counting in software keymint device.
CreateKeyMintDevice now creates a shared_ptr with correct ref counts.

Bug: 219791936
Test: atest keystore2_km_compat_test_cpp does not crash any more.
Change-Id: I3b304c0a4d55883b8f917ce0ef4c70d4bd0e9e9b
2022-03-02 11:25:10 -08:00
Charisee
a1e1c4865a Changes for the Rust 1.59.0 update
bug: 215232614
Test: TreeHugger and compiling with m rust
Change-Id: I1d25f5550f60ff1046a3a312f7bd210483bf9364
2022-02-28 21:29:32 +00:00
Matthew Maurer
f2a147a6be Merge "Send Keystore2 logs to SYSTEM rather than MAIN" 2022-02-24 18:06:01 +00:00
Treehugger Robot
4f5c70cc46 Merge "Provide alternate SE RoT provisioning path." 2022-02-23 18:13:01 +00:00
Seth Moore
79a2e42060 Merge "Add logging around export of IRemotelyProvisionedKeyPool" 2022-02-23 16:52:17 +00:00
Seth Moore
8c14710df1 Add logging around export of IRemotelyProvisionedKeyPool
If we cannot create an IRemotelyProvisionedKeyPool binder, keystore
starts up as normal. However, we were not logging _why_ the operation
failed. This change adds a bit of logging so that we can diagnose when
devices are missing the IRemotelyProvisionedKeyPool service.

Test: keystore2_test
Change-Id: I60a481dc9762d8b156c5bec9e622a7e2192d145d
2022-02-23 16:51:26 +00:00
Shawn Willden
e2fac0c976 Provide alternate SE RoT provisioning path.
On some devices it is infeasible to provision the KeyMint RoT bits in
the Android Bootloader.  This provides an alternate path to provision
them from the TEE during early boot.

Bug: 219076736
Test: VtsAidlKeyMintTargetTest
Change-Id: I8e19a1096087780f8c979f5a6b37f4100e41a975
Merged-In: I8e19a1096087780f8c979f5a6b37f4100e41a975
2022-02-22 23:50:50 -07:00
Treehugger Robot
ca744a7442 Merge changes from topic "expiration_pruning"
* changes:
  Adding additional call to delete expired keys
  Upgrade remotely provisioned keys if necessary.
2022-02-18 21:35:11 +00:00
Matthew Maurer
1f49c6e298 Send Keystore2 logs to SYSTEM rather than MAIN
Test: Boot on cuttlefish, verify log location
Bug: 215419883
Change-Id: If3cc0a5cec4db576d533c7b5d272845e3604f9d7
2022-02-17 20:33:03 +00:00
Max Bires
cd7f7417e0 Adding additional call to delete expired keys
Placing a call to delete all expired attestation keys directly in
the function responsible for retrieving them. This guarantees that any
key selected will be fresh. This also modifies
delete_expired_attestation_keys to create a time buffer so that a key
can't be milliseconds away from expiration when this call returns.

Test: atest keystore2_tests
Change-Id: I6f83eb65d02d8583d054c56ef6c572f3ee2e8e24
2022-02-16 22:12:40 -08:00
Max Bires
55620ff9a8 Upgrade remotely provisioned keys if necessary.
This change applies a key upgrade path to the RKP keys when they are
used in key generation. Without this, RKP keys will fail after a device
receives an update due to version mismatch in KeyMint.

Test: atest keystore2_test && atest RemoteProvisionerUnitTests
Change-Id: I5dddc8fa1fe7fe9d7dd559b337089d607fcc735a
2022-02-16 22:12:37 -08:00
Janis Danisevskis
779e09c9e3 Keystore 2.0: km_compat: Fix operation slot accounting.
Virtual operation slots are leaked when sofware emulation is used.
This can lead to TOO_MANY_OPERATIONS errors despite have plenty of spare
operation slots in the backend.

Also fixes not using the reserved operation slot for signing. All
signing operations during key generation are now serialized and use the
reserved operation slot.

The slot test in keystore2_km_compat_test_cpp now tests that sofware
emulated operations don't impact the virtual operation slot accounting.
It also verifies that key generation that requires an operation slot can
commence even if all virtual slots are depleted.

Bug: 219551178
Bug: 219552427
Test: atest keystore2_km_compat_test_cpp
Change-Id: I6665b06a038e4935b4c751228881d8b500a6dcd4

Slot_test

Change-Id: Ice45c9f67f0ac0aa067825c410bf3ba9257e5bee
2022-02-15 17:03:01 -08:00
Janis Danisevskis
f84d0b0520 Keystore 2.0: Teach keystore to decrypt generic blobs.
This CL addresses various gaps in legacy support.
* Encrypted legacy blobs.
* Encrypted key characteristics files (pre Android Q).
* Encrypted certificate and certificate chain entries
  (pre Android R).

To support key migration even when the corresponding user is locked,
keys can now be migrated in the legacy database by renaming files.
In order to construct a complete a key characteristics cache from old
characteristics files the information must be augmented with the
characteristics that can be extracted from the key blob by calling
KeyMintDevice::getKeyCharacteristics. For this to work, the blob
may need to be decrypted, upgraded, and reencrypted. The crypto steps
may fail with ResponseCode::LOCKED though if the user is locked.
If the key was upgraded in the process both the old and the new key
blob must be inserted into the database in order for the garbage
collector to reap and invalidate the superseded blob correctly.
At the time APPLICATION_ID and APPLICATION_DATA are usually not
available. This would cause such bound keys to fail with
ErrorCode::INVALID_KEY_BLOB. However, APPLICATION_ID/DATA were
never exposed to applications though, so this should be acceptable
for now.

Bug: 213173772
Bug: 213172664
Bug: 203101472
Test: keystore2_test
Change-Id: Id8561d3f98d53182709d9f4feeeecda3b1535077
2022-02-14 07:29:22 -08:00
David Drysdale
70bcce2dc0 Merge "Implement a back-level KeyMint compatibility wrapper" 2022-02-10 09:42:15 +00:00
Treehugger Robot
33c654fea1 Merge "Keystore 2.0: Rename legacy_migrator to importer." 2022-02-10 01:45:24 +00:00
Treehugger Robot
409283bba7 Merge "Keystore2: Fix some log messages." 2022-02-10 01:33:00 +00:00
David Drysdale
c97eb9e053 Implement a back-level KeyMint compatibility wrapper
- Implement a general back-level KeyMint wrapper, which forwards
   requests to either a back-level real device, or an up-level
   software device. Keyblobs from the latter are given a marker
   prefix and an authentication suffix.
 - Add an FFI wrapper function to allow calculation of HMAC-SHA256,
   so this can be used to give an authenticated suffix to wrapped
   keyblobs.
 - Abstract out the decision process for whether emulation is required
   to a EmulationDetector trait, and provide implementations for
   KeyMint V1 and for a km_compat-wrapped Keymaster.
 - Impose the KeyMint V1 wrapper whenever the real device is detected to
   be a V1 implementation.
 - Add support to the IKeystoreCompatService for returning a device for
   SecurityLevel::SOFTWARE. This device will always be the most recent
   KeyMint version.
 - Clarify what level of IKeyMint implementation gets returned from
   the IKeystoreCompatService for the other security levels.
 - Add an inner function to the km_compat code to allow unit tests
   to still work.

Co-authored-by: Janis Danisevskis <jdanis@google.com>
Bug: 194358913
Test: CtsKeystoreTestCases on oriole/bramble/cuttlefish
Change-Id: I297e8ad1cf00fd15cd5358b2760cd2ca88f53abb
2022-02-09 18:53:51 +00:00
Andrew Walbran
0551c46723 Update to improved system_properties API.
Bug: 217728265
Test: mm
Change-Id: I1ba1af10988f8f98318cff72488c4e600853938e
2022-02-07 12:25:55 +00:00
Janis Danisevskis
0ffb8a80bd Keystore 2.0: Rename legacy_migrator to importer.
This refactor serves the disambiguation between the import of legacy
blobs into the sqlite3 database and the migration of keys between
namespaces, which becomes more promient in the light of shared uid
migration.

Test: No new test required because no functionality was changed.
Change-Id: I0612d0731083548a196911712f6c0adbbc9a5e9a
2022-02-06 23:16:41 -08:00
Seth Moore
8099450d9e Merge changes from topic "ic-rkp"
* changes:
  Add support for RKP to credstore
  Refactor RKP key pool in keystore
2022-02-03 23:00:40 +00:00
Seth Moore
92648b6a81 Refactor RKP key pool in keystore
Split the IRemotelyProvisionedKeyPool binder implementation to its own
struct, as we cannot have two rust objects backing the same native
binder.

Test: keystore2_test
Test: keystore2_test --ignored
Bug: 194696876
Change-Id: I188bc2e2daf277f4a3543c7ec8320002d57f60ba
2022-02-02 16:17:05 -08:00
Treehugger Robot
1b1a79c68f Merge "Keystore 2.0: Sort watch dog records." 2022-02-03 00:00:31 +00:00
Janis Danisevskis
9bdc4301b6 Keystore 2.0: Sort watch dog records.
This patch makes it a little easier to interpret watch dog records, by
sorting them by the age of the youngest watch point in each thread.
The most likely  culprit will thus move to the top of the record.

Test: N/A
Change-Id: I17ef4801ed38313b85468bd14943269f881a8e2b
2022-02-02 23:59:51 +00:00
Janis Danisevskis
478a9a260d Keystore2: Fix some log messages.
Some multi line log messages were missing escape characters on their
line breaks.

Test: N/A
Change-Id: I3903b8a5ddd76d4e8ed379b3d42dc55942bbd98f
2022-02-02 10:05:57 -08:00
Andrew Scull
dba80c5445 Remove all noicu build rules
The noicu build rules were only used by microdroid which no longer has a
special variant of keystore2.

Bug: 215747811
Test: atest MicrodroidTests
Change-Id: Iefa4d22beb0074bc95e0ff20c7689ad8b62372f4
2022-01-28 18:46:02 +00:00
Andrew Scull
ec858162f2 Merge "Remove microdroid build of keystore2" 2022-01-28 13:12:53 +00:00
Treehugger Robot
9afc82a6dc Merge "-= src_available" 2022-01-27 23:45:24 +00:00
Treehugger Robot
684a9b3ba3 Merge "Keystore 2.0: Fix racy super key management." 2022-01-27 22:34:50 +00:00
Andrew Scull
214c660dad Remove microdroid build of keystore2
keystore2 has been removed from microdroid so the build variant is no
longer needed.

Bug: 215747811
Test: atest MicrodroidTests
Change-Id: I46395d04535a3084e995324445e6b52bef4d8154
2022-01-27 21:53:29 +00:00