Merge "Delete KM1"

This commit is contained in:
Shawn Willden
2021-10-09 00:46:52 +00:00
committed by Gerrit Code Review
4 changed files with 9 additions and 25 deletions

View File

@@ -12,7 +12,7 @@ LOCAL_SRC_FILES := \
LOCAL_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \
liblog \ liblog \
libsoftkeymasterdevice \ libpuresoftkeymasterdevice \
libcrypto \ libcrypto \
libkeymaster_portable \ libkeymaster_portable \
libpuresoftkeymasterdevice \ libpuresoftkeymasterdevice \

View File

@@ -22,7 +22,6 @@
#include <log/log.h> #include <log/log.h>
#include <AndroidKeymaster3Device.h> #include <AndroidKeymaster3Device.h>
#include <hardware/keymaster1.h>
#include <hardware/keymaster2.h> #include <hardware/keymaster2.h>
#include <hardware/keymaster_defs.h> #include <hardware/keymaster_defs.h>
@@ -32,18 +31,6 @@ namespace keymaster {
namespace V3_0 { namespace V3_0 {
namespace implementation { namespace implementation {
static int get_keymaster1_dev(keymaster1_device_t** dev, const hw_module_t* mod) {
int rc = keymaster1_open(mod, dev);
if (rc) {
ALOGE("Error %d opening keystore keymaster1 device", rc);
if (*dev) {
(*dev)->common.close(&(*dev)->common);
*dev = nullptr;
}
}
return rc;
}
static int get_keymaster2_dev(keymaster2_device_t** dev, const hw_module_t* mod) { static int get_keymaster2_dev(keymaster2_device_t** dev, const hw_module_t* mod) {
int rc = keymaster2_open(mod, dev); int rc = keymaster2_open(mod, dev);
if (rc) { if (rc) {
@@ -63,14 +50,8 @@ static IKeymasterDevice* createKeymaster3Device() {
return ::keymaster::ng::CreateKeymasterDevice(); return ::keymaster::ng::CreateKeymasterDevice();
} }
if (mod->module_api_version < KEYMASTER_MODULE_API_VERSION_1_0) { if (mod->module_api_version < KEYMASTER_MODULE_API_VERSION_2_0) {
return nullptr; return nullptr;
} else if (mod->module_api_version == KEYMASTER_MODULE_API_VERSION_1_0) {
keymaster1_device_t* dev = nullptr;
if (get_keymaster1_dev(&dev, mod)) {
return nullptr;
}
return ::keymaster::ng::CreateKeymasterDevice(dev);
} else { } else {
keymaster2_device_t* dev = nullptr; keymaster2_device_t* dev = nullptr;
if (get_keymaster2_dev(&dev, mod)) { if (get_keymaster2_dev(&dev, mod)) {

View File

@@ -36,7 +36,10 @@ cc_test {
static_libs: [ static_libs: [
"android.hardware.keymaster@3.0", "android.hardware.keymaster@3.0",
"libcrypto_static", "libcrypto_static",
"libsoftkeymasterdevice", "libpuresoftkeymasterdevice",
],
test_suites: [
"general-tests",
"vts",
], ],
test_suites: ["general-tests", "vts"],
} }

View File

@@ -32,7 +32,7 @@ cc_benchmark {
static_libs: [ static_libs: [
"android.hardware.keymaster@4.0", "android.hardware.keymaster@4.0",
"libkeymaster4support", "libkeymaster4support",
"libsoftkeymasterdevice", "libpuresoftkeymasterdevice",
"libchrome" "libchrome",
], ],
} }