Update Keystore to use keymaster2 HAL.
This CL doesn't wire in any of the new keymaster2 features, it just uses
the keymaster2 HAL rather than the keymaster1 HAL. This means that if
keymaster1 hardware is found, it is unconditionally wrapped in
SoftKeymasterDevice, so keymaster2 functionality can (eventually) be
provided.
Change-Id: Ica2cb0751e4e0a82c56c36b03f94da54ef62d9a3
diff --git a/keystore/operation.h b/keystore/operation.h
index d8d1b18..eb16257 100644
--- a/keystore/operation.h
+++ b/keystore/operation.h
@@ -18,7 +18,7 @@
#define KEYSTORE_OPERATION_H_
#include <hardware/hw_auth_token.h>
-#include <hardware/keymaster1.h>
+#include <hardware/keymaster2.h>
#include <binder/Binder.h>
#include <binder/IBinder.h>
#include <utils/LruCache.h>
@@ -39,7 +39,7 @@
/**
* OperationMap handles the translation of keymaster_operation_handle_t's and
- * keymaster1_device_t's to opaque binder tokens that can be used to reference
+ * keymaster2_device_t's to opaque binder tokens that can be used to reference
* that operation at a later time by applications. It also does LRU tracking
* for operation pruning and keeps a mapping of clients to operations to allow
* for graceful handling of application death.
@@ -48,12 +48,12 @@
public:
OperationMap(IBinder::DeathRecipient* deathRecipient);
sp<IBinder> addOperation(keymaster_operation_handle_t handle, uint64_t keyid,
- keymaster_purpose_t purpose, const keymaster1_device_t* dev,
+ keymaster_purpose_t purpose, const keymaster2_device_t* dev,
sp<IBinder> appToken, keymaster_key_characteristics_t* characteristics,
bool pruneable);
bool getOperation(sp<IBinder> token, keymaster_operation_handle_t* outHandle,
uint64_t* outKeyid, keymaster_purpose_t* outPurpose,
- const keymaster1_device_t** outDev,
+ const keymaster2_device_t** outDev,
const keymaster_key_characteristics_t** outCharacteristics);
bool removeOperation(sp<IBinder> token);
bool hasPruneableOperation() const;
@@ -70,12 +70,12 @@
struct Operation {
Operation();
Operation(keymaster_operation_handle_t handle, uint64_t keyid, keymaster_purpose_t purpose,
- const keymaster1_device_t* device,
+ const keymaster2_device_t* device,
keymaster_key_characteristics_t* characteristics, sp<IBinder> appToken);
keymaster_operation_handle_t handle;
uint64_t keyid;
keymaster_purpose_t purpose;
- const keymaster1_device_t* device;
+ const keymaster2_device_t* device;
Unique_keymaster_key_characteristics characteristics;
sp<IBinder> appToken;
std::unique_ptr<hw_auth_token_t> authToken;