Separate keymaster0 and keymaster1 HALs.
Change-Id: Ida47d6fae1ed7e85e7c223900f6b7a2e655fee47
(cherry picked from commit f02e17e73036be67a9c8d6ecc7b82cbc5684131d)
diff --git a/libkeymaster/keymaster_mobicore.cpp b/libkeymaster/keymaster_mobicore.cpp
index 7d11a18..9fa10aa 100644
--- a/libkeymaster/keymaster_mobicore.cpp
+++ b/libkeymaster/keymaster_mobicore.cpp
@@ -20,7 +20,7 @@
#include <stdint.h>
#include <hardware/hardware.h>
-#include <hardware/keymaster.h>
+#include <hardware/keymaster0.h>
#include <openssl/evp.h>
#include <openssl/bio.h>
@@ -66,7 +66,7 @@
};
typedef UniquePtr<RSA, RSA_Delete> Unique_RSA;
-typedef UniquePtr<keymaster_device_t> Unique_keymaster_device_t;
+typedef UniquePtr<keymaster0_device_t> Unique_keymaster_device_t;
/**
* Many OpenSSL APIs take ownership of an argument on success but don't free the argument
@@ -92,7 +92,7 @@
ERR_remove_state(0);
}
-static int exynos_km_generate_keypair(const keymaster_device_t* dev,
+static int exynos_km_generate_keypair(const keymaster0_device_t* dev,
const keymaster_keypair_t key_type, const void* key_params,
uint8_t** keyBlob, size_t* keyBlobLength) {
teeResult_t ret = TEE_ERR_NONE;
@@ -133,7 +133,7 @@
return 0;
}
-static int exynos_km_import_keypair(const keymaster_device_t* dev,
+static int exynos_km_import_keypair(const keymaster0_device_t* dev,
const uint8_t* key, const size_t key_length,
uint8_t** key_blob, size_t* key_blob_length) {
uint8_t kbuf[RSA_KEY_BUFFER_SIZE];
@@ -229,7 +229,7 @@
return 0;
}
-static int exynos_km_get_keypair_public(const struct keymaster_device* dev,
+static int exynos_km_get_keypair_public(const keymaster0_device_t* dev,
const uint8_t* key_blob, const size_t key_blob_length,
uint8_t** x509_data, size_t* x509_data_length) {
uint32_t bin_mod_len;
@@ -328,7 +328,7 @@
return 0;
}
-static int exynos_km_sign_data(const keymaster_device_t* dev,
+static int exynos_km_sign_data(const keymaster0_device_t* dev,
const void* params,
const uint8_t* keyBlob, const size_t keyBlobLength,
const uint8_t* data, const size_t dataLength,
@@ -376,7 +376,7 @@
return 0;
}
-static int exynos_km_verify_data(const keymaster_device_t* dev,
+static int exynos_km_verify_data(const keymaster0_device_t* dev,
const void* params,
const uint8_t* keyBlob, const size_t keyBlobLength,
const uint8_t* signedData, const size_t signedDataLength,
@@ -431,7 +431,7 @@
if (strcmp(name, KEYSTORE_KEYMASTER) != 0)
return -EINVAL;
- Unique_keymaster_device_t dev(new keymaster_device_t);
+ Unique_keymaster_device_t dev(new keymaster0_device_t);
if (dev.get() == NULL)
return -ENOMEM;