platform_system_security/keystore
Janis Danisevskis 6a0d998380 Fix grants get lost on key upgrade
The upgrade routine used to call KeyStore->del which purges the given
key blob from the keystore including all existing grants.
With this patch, upgrade only calls Keymaster::delete on the keyblobs
without purging it from the keystore. Also it only calls
Keymaster::delete once the upgrade key was successfully written to disk.

This patch also calls fsync on the directory containing keyblobs to
narrow the window in which keyblob may be lost due to power loss.

Bug: 110450771
Test: Upgrade path tested by manually creating a key, bumping the
      patchlevel, using the key subsequently and inspecting the logs.
Change-Id: I89241b5d4033b270733ff61838ab9244fce28c60
2019-05-03 16:19:06 -07:00
..
binder/android/security Changed uid output parameter from an int array to a list of strings. 2018-12-20 19:00:05 +00:00
include/keystore Clearly indicate vendor errors from keymaster in logcat 2019-05-03 16:18:45 -07:00
tests KeyStore: Fix key name decoding 2018-12-04 12:35:27 +00:00
Android.bp Grant VTS tests all permissions in keystore on userdebug/eng 2019-01-29 11:16:53 -08:00
auth_token_table.cpp Multithreaded Keystore 2018-10-31 14:31:26 -07:00
auth_token_table.h Multithreaded Keystore 2018-10-31 14:31:26 -07:00
blob.cpp Fix grants get lost on key upgrade 2019-05-03 16:19:06 -07:00
blob.h Merge "Fix/suppress system/security google-explicit-constructor warnings" 2019-01-11 18:03:38 +00:00
confirmation_manager.cpp Multithreaded Keystore 2018-10-31 14:31:26 -07:00
confirmation_manager.h Implement rate limiting on a per app basis for confirmationui 2018-03-14 13:36:56 -07:00
confirmationui_rate_limiting.h Implement rate limiting on a per app basis for confirmationui 2018-03-14 13:36:56 -07:00
defaults.h Port to binderized keymaster HAL 2017-01-23 08:30:49 -07:00
grant_store.cpp Multithreaded Keystore 2018-10-31 14:31:26 -07:00
grant_store.h Fix/suppress system/security google-explicit-constructor warnings 2019-01-04 13:34:55 -08:00
key_config.proto Adding DropBox logging support for keystore functionality 2018-04-25 21:46:08 +00:00
key_proto_handler.cpp Manage DropBoxManager using sp<> 2018-10-10 14:28:10 -07:00
key_proto_handler.h Adding DropBox logging support for keystore functionality 2018-04-25 21:46:08 +00:00
key_store_service.cpp Clearly indicate vendor errors from keymaster in logcat 2019-05-03 16:18:45 -07:00
key_store_service.h Fix keystore wifi concurrency issue. 2019-03-25 13:02:40 -07:00
KeyAttestationApplicationId.cpp KeyStore: Limit the Attestation Application ID 2018-08-16 18:53:15 +01:00
KeyAttestationPackageInfo.cpp Fix version code handling in attestation records 2017-12-28 22:14:52 +00:00
keyblob_utils.cpp Modernize codebase by replacing NULL with nullptr 2018-07-30 01:40:01 -07:00
keymaster_enforcement.cpp Multithreaded Keystore 2018-10-31 14:31:26 -07:00
keymaster_enforcement.h Multithreaded Keystore 2018-10-31 14:31:26 -07:00
keymaster_worker.cpp Fix grants get lost on key upgrade 2019-05-03 16:19:06 -07:00
keymaster_worker.h Fix grants get lost on key upgrade 2019-05-03 16:19:06 -07:00
KeymasterArguments.cpp Multithreaded Keystore 2018-10-31 14:31:26 -07:00
KeyStore.cpp Clearly indicate vendor errors from keymaster in logcat 2019-05-03 16:18:45 -07:00
KeyStore.h Fix class/struct mismatch. 2019-01-15 21:41:30 +00:00
keystore.rc Log key import, destruction and generation failure for audit. 2018-01-29 20:11:06 +00:00
keystore_aidl_hidl_marshalling_utils.cpp Replace cast operator with getValue() for key store return codes 2018-11-21 13:46:43 -08:00
keystore_aidl_hidl_marshalling_utils.h Multi-threaded keystore 2018-11-14 14:01:45 -08:00
keystore_attestation_id.cpp Deprecate <cutils/log.h> and <utils/Log.h> 2018-09-19 13:38:34 +08:00
keystore_attestation_id.h Fix/suppress system/security google-explicit-constructor warnings 2019-01-04 13:34:55 -08:00
keystore_cli.cpp Multi-threaded keystore 2018-11-14 14:01:45 -08:00
keystore_cli_v2.cpp Changed uid output parameter from an int array to a list of strings. 2018-12-20 19:00:05 +00:00
keystore_client.proto Add encryption convenience methods to KeystoreClient. 2015-11-02 09:12:59 -08:00
keystore_client_impl.cpp Merge changes from topic "keystore-rc" 2018-12-05 18:19:29 +00:00
keystore_get.cpp Multi-threaded keystore 2018-11-14 14:01:45 -08:00
keystore_get_wifi_hidl.cpp Modernize codebase by replacing NULL with nullptr 2018-07-30 01:40:01 -07:00
keystore_keymaster_enforcement.h Modernize codebase by replacing NULL with nullptr 2018-07-30 01:40:01 -07:00
keystore_main.cpp Replace Entropy with RAND_bytes 2018-12-28 10:19:15 -08:00
keystore_utils.cpp Fix grants get lost on key upgrade 2019-05-03 16:19:06 -07:00
keystore_utils.h Fix grants get lost on key upgrade 2019-05-03 16:19:06 -07:00
KeystoreResponse.cpp Multi-threaded keystore 2018-11-14 14:01:45 -08:00
legacy_keymaster_device_wrapper.cpp Fix/suppress system/security google-explicit-constructor warnings 2019-01-04 13:34:55 -08:00
legacy_keymaster_device_wrapper.h Fix/suppress system/security google-explicit-constructor warnings 2019-01-04 13:34:55 -08:00
operation.cpp Reducing amount of files created in dropbox for keystore 2019-01-15 18:47:42 +00:00
operation.h Reducing amount of files created in dropbox for keystore 2019-01-15 18:47:42 +00:00
operation_config.proto Reducing amount of files created in dropbox for keystore 2019-01-15 18:47:42 +00:00
operation_proto_handler.cpp Adding thread safety to proto uploader 2019-03-25 17:00:29 -07:00
operation_proto_handler.h Adding thread safety to proto uploader 2019-03-25 17:00:29 -07:00
operation_struct.h Multithreaded Keystore 2018-10-31 14:31:26 -07:00
OperationResult.cpp Replace cast operator with getValue() for key store return codes 2018-11-21 13:46:43 -08:00
permissions.cpp Give some permissions to bluetooth 2019-02-22 09:19:29 -08:00
permissions.h Fix multiple issues with the keystore grant mechanism 2017-10-02 09:58:04 -07:00
Signature.cpp KeyStore: Limit the Attestation Application ID 2018-08-16 18:53:15 +01:00
test-keystore Revive test script for keystore 2015-09-24 21:10:20 +03:00
user_state.cpp Increase the master key size to 256 bits 2019-01-10 17:01:14 -08:00
user_state.h Increase the master key size to 256 bits 2019-01-10 17:01:14 -08:00