Rename keymaster_device_t to keymaster0_device_t.
This is to accomodate the new keymaster1_device_t, which has an entirely
different interface.
Soon I'll provide a libkeymaster which provides a unified (and nicer)
interface for dealing with both v0 and v1 keymaster implementations
using a v1 keymaster API. For now this change is just so that vold will
build and run.
Change-Id: I5c54282c12d1c4b8b22ed4929b6e6c724a94ede4
diff --git a/cryptfs.c b/cryptfs.c
index 46e6be7..5786210 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -58,7 +58,7 @@
#include "CheckBattery.h"
#include "Process.h"
-#include <hardware/keymaster.h>
+#include <hardware/keymaster0.h>
#define UNUSED __attribute__((unused))
@@ -98,7 +98,7 @@
static int master_key_saved = 0;
static struct crypt_persist_data *persist_data = NULL;
-static int keymaster_init(keymaster_device_t **keymaster_dev)
+static int keymaster_init(keymaster0_device_t **keymaster_dev)
{
int rc;
@@ -109,7 +109,7 @@
goto out;
}
- rc = keymaster_open(mod, keymaster_dev);
+ rc = keymaster0_open(mod, keymaster_dev);
if (rc) {
ALOGE("could not open keymaster device in %s (%s)",
KEYSTORE_HARDWARE_MODULE_ID, strerror(-rc));
@@ -126,7 +126,7 @@
/* Should we use keymaster? */
static int keymaster_check_compatibility()
{
- keymaster_device_t *keymaster_dev = 0;
+ keymaster0_device_t *keymaster_dev = 0;
int rc = 0;
if (keymaster_init(&keymaster_dev)) {
@@ -149,7 +149,7 @@
}
out:
- keymaster_close(keymaster_dev);
+ keymaster0_close(keymaster_dev);
return rc;
}
@@ -157,7 +157,7 @@
static int keymaster_create_key(struct crypt_mnt_ftr *ftr)
{
uint8_t* key = 0;
- keymaster_device_t *keymaster_dev = 0;
+ keymaster0_device_t *keymaster_dev = 0;
if (keymaster_init(&keymaster_dev)) {
SLOGE("Failed to init keymaster");
@@ -189,7 +189,7 @@
ftr->keymaster_blob_size = key_size;
out:
- keymaster_close(keymaster_dev);
+ keymaster0_close(keymaster_dev);
free(key);
return rc;
}
@@ -202,7 +202,7 @@
size_t *signature_size)
{
int rc = 0;
- keymaster_device_t *keymaster_dev = 0;
+ keymaster0_device_t *keymaster_dev = 0;
if (keymaster_init(&keymaster_dev)) {
SLOGE("Failed to init keymaster");
return -1;
@@ -262,7 +262,7 @@
signature,
signature_size);
- keymaster_close(keymaster_dev);
+ keymaster0_close(keymaster_dev);
return rc;
}