Keystore 2.0: Add keystore2 support to the keystore-engine.
Test: ???
Bug: 173546268
Bug: 171305607
Bug: 175068876
Change-Id: Ib44a8787d31a994453ab56022546cfbc5b76516e
diff --git a/keystore-engine/android_engine.cpp b/keystore-engine/android_engine.cpp
index e3525b2..5881523 100644
--- a/keystore-engine/android_engine.cpp
+++ b/keystore-engine/android_engine.cpp
@@ -23,10 +23,7 @@
#define LOG_TAG "keystore-engine"
#include <pthread.h>
-#include <sys/socket.h>
-#include <stdarg.h>
#include <string.h>
-#include <unistd.h>
#include <log/log.h>
@@ -41,6 +38,8 @@
#include <memory>
+#include "keystore2_engine.h"
+
#ifndef BACKEND_WIFI_HIDL
#include "keystore_backend_binder.h"
#else
@@ -335,6 +334,10 @@
EVP_PKEY* EVP_PKEY_from_keystore(const char* key_id) {
ALOGV("EVP_PKEY_from_keystore(\"%s\")", key_id);
+ if (auto ks2_key = EVP_PKEY_from_keystore2(key_id)) {
+ return ks2_key;
+ }
+
ensure_keystore_engine();
uint8_t *pubkey = nullptr;