The methods get_hal_names and get_hal_names_and_versions were not used.
Remove them.
Bug: 249096262
Test: m keystore2
Change-Id: I9967286cfad86071a914d959385519890d1adb30
keystore entry using `updateSubcomponent` API.
1. Try to update only the certificate-chain of the non existing
asymmetric key, test should succeed in creating a new keystore
entry with the given certificate-chain only.
2. Try to update only the public key of the non existing asymmetric
key, test should fail to update non-existing key certificate with
error response `KEY_NOT_FOUND`.
Bug: 267183713
Test: atest keystore2_client_tests
Change-Id: Iaf5c9b0e29eb59873493b330c0f1d36ec8337f88
long aliases.
Create 100 keystore entries with aliases of length 6000 chars and
list the aliases using `listEntries` API. Test should be able to
list all the Keystore entries aliases and match them with aliases
of the entries created by test. Test should successfully verify all
the aliases of Keystore entries it created.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I16d35dc1f053f8b60745e62185009397b987dfe7
In earlier revisions of the code, RKPD client would wait indefinitely.
This model had an invariant guaranteeing that receiver end of the
oneshot channel is always present when sender is invoked.
With introduction of timeouts, this invariant no longer holds. The
receiver can time out and be cleaned up. This patch makes SafeSender
tolerate this scenario.
Also, attempt to cancelGetKey() if corresponding request for a key times
out.
Bug: 269460851
Test: keystore2_test
Change-Id: I33d80af52b5ab15c2113a140a8bd2beedfe2ff4f
This catches bugs that could happen after main test thread completes.
Bug: 269460851
Test: keystore2_test
Change-Id: I0d723b04a95e83da8aaceb0748f5af0a9eab90e2
Test: Run and tested using `atest keystore2_test` for Rust test and CTS test with `atest CtsKeystoreTestCases`
Change-Id: Id53c870260e9757227f6cb5d57787796f60fe9d5
1. Verify that key agreement works with curves `P_224, P_256, P_384 and
P_521`. Test should generate KeyMint EC key with purpose `AGREE_KEY`
and OpenSSL EC key with same curve as KeyMint key. Perform local ECDH
between these two keys and verify that derived secrets are the same.
2. Verify that key agreement works with CURVE_25519 curve.
Test should generate KeyMint EC-CURVE_25519 key with purpose
`AGREE_KEY` and OpenSSL EC key with same curve as KeyMint key.
Perform local ECDH between these two keys and verify that derived
secrets are the same.
3. Verify that key agreement doesn't work when EC keys are using
different curves. Generate a KeyMine EC key using P_256 curve and
OpenSSL EC key using CURVE_25519. Try to perform a local ECDH between
these keys and operation should fail with `INVALID_ARGUMENT` error
code.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I3da7af09908d6828ad617c833469bbd786b09e8f
Now we'll get error codes bubbled up from rkpd (via the remote
provisioning system service). Convert those errors into meaningful
keystore errors so clients can act on them.
Test: keystore2_tests
Test: RkpdAppIntegrationTests
Test: CtsKeystoreTestCases:android.keystore.cts.KeyStoreExceptionTest
Bug: 264888027
Change-Id: Ib574fe4da0443f32f95f8579c4a308d36fe4b46f
- updateSubcomponent
- getSecurityLevel
1. Generate asymmetric key and update its public certificate and
certificate chain. Test should load the updated key and verify
whether its certificate and cert-chain are updated successfully.
2. Try to update non-existing key's public cert and cert-chain. Test
should fail to update with error response code `KEY_NOT_FOUND`.
3. Try to update the certificate in a grantee context which doesn't
possess UPDATE access permission for the specified key. Test should
fail to update with error response code `PERMISSION_DENIED`. Test
should also verify that the gratee context which possess the `UPDATE`
access permission should be able to update the certificate
successfully.
4. Try to get `TRUSTED_ENVIRONMENT` security level instance. Test should
successfully get the instance.
5. Try to get `SOFTWARE` security level instance. Test should fail with
error response code `HARDWARE_TYPE_UNAVAILABLE`.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I92635c6c1fafde4e1cd4f5654f0164e45c145961
- Grant a key to the user with DELETE access. Vefify that grantee can
delete the granted key successfully.
- Grant a key to the user. In grantee context try to grant this key to
another user. Test should fail with `PERMISSION_DENIED` error
response to grant a key to another user from grantee context for
designated key.
- Try to grant a key to the user with `GRANT` access. Test should fail with
`PERMISSION_DENIED` error response code. Keystore2 system must
not allow `GRANT` permission to be granted.
- Try to grant a non-existing key to the user. Test should fail to grant
a key with `KEY_NOT_FOUND` error response.
- Grant a key to the user and ungrant it before the grantee can use the
granted key. In grantee context while trying to use the granted key
`KEY_NOT_FOUND` error response is expected.
- Try to ungrant a non-existing key. Test should fail with
`KEY_NOT_FOUND` error response.
- Grant a key to multiple users. All grantees should be able to access
the key and use it for crypto operation.
- Grante a key to two users with GET_INFO|DELETE permissions. In one of
the grantee contexts delete the key. In another grantee context when
it tries to access the granted key, it should fail with
`KEY_NOT_FOUND` error response.
Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I0bd6faeeaff2fa436413604dfbad67ea65dc8597
Also replace libfutures with libtokio, as the former doesn't have
support for timeouts.
Bug: 264921138
Test: keystore2_test
Change-Id: I97c9749e93b2d001afe5d17bda8c665f884b0e05
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
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
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
`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
- 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
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
- 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
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
Update keystore2 to pass a callback for receiving success/failure from
the storeUpgradedKeyAsync API.
Test: keystore2_test
Bug: 262748535
Change-Id: Ifbae48b697267d05baa83d7d1e42569c7db694b5
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
- 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
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
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
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
Test: Run and tested using `atest keystore2_test` for Rust test and CTS test with `atest CtsKeystoreTestCases`
Change-Id: Ic8e62f1c5d19c6203945fefeb18b066bf8a32ed7
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
- 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
`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
- 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
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
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
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
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
Runs the formatting command and adds a directory formatter
to the keystore2 for standardized directory formatting.
Test: Formatting change
Change-Id: I56230f57dcfd3e48c7c9e39e1362bb67ebc7862e
Runs rustfmt on keystore2 to standardize formatting changes.
Test: Formatting change so no test needed
Change-Id: I24208f8fe91e6b15108eef0ff5264a3f086497e4
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
- 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
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
- 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
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
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
- 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
- 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
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
- 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
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
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
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
- 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