Remove use of UniquePtr from keystore
Remove UniquePtr from keystore in favour of std::unique_ptr
Change-Id: I8e02adab4326028e26dbf59ac836679abe2a40de
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index 248fa00..5f05e01 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -52,7 +52,7 @@
struct BIGNUM_Delete {
void operator()(BIGNUM* p) const { BN_free(p); }
};
-typedef UniquePtr<BIGNUM, BIGNUM_Delete> Unique_BIGNUM;
+typedef std::unique_ptr<BIGNUM, BIGNUM_Delete> Unique_BIGNUM;
bool containsTag(const hidl_vec<KeyParameter>& params, Tag tag) {
return params.end() != std::find_if(params.begin(), params.end(),
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index bc2e0dc..130a30e 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -647,7 +647,7 @@
struct BIO_Delete {
void operator()(BIO* p) const { BIO_free(p); }
};
-typedef UniquePtr<BIO, BIO_Delete> Unique_BIO;
+typedef std::unique_ptr<BIO, BIO_Delete> Unique_BIO;
ResponseCode KeyStore::importBlobAsKey(Blob* blob, const char* filename, uid_t uid) {
// We won't even write to the blob directly with this BIO, so const_cast is okay.
@@ -670,7 +670,7 @@
return ResponseCode::SYSTEM_ERROR;
}
- UniquePtr<unsigned char[]> pkcs8key(new unsigned char[len]);
+ std::unique_ptr<unsigned char[]> pkcs8key(new unsigned char[len]);
uint8_t* tmp = pkcs8key.get();
if (i2d_PKCS8_PRIV_KEY_INFO(pkcs8.get(), &tmp) != len) {
ALOGE("Couldn't convert to PKCS#8");
diff --git a/keystore/keystore_utils.h b/keystore/keystore_utils.h
index 0f7922a..f970559 100644
--- a/keystore/keystore_utils.h
+++ b/keystore/keystore_utils.h
@@ -26,7 +26,7 @@
#include <hardware/keymaster_defs.h>
-#include <UniquePtr.h>
+#include <memory>
#include <keystore/authorization_set.h>
@@ -52,12 +52,12 @@
struct EVP_PKEY_Delete {
void operator()(EVP_PKEY* p) const { EVP_PKEY_free(p); }
};
-typedef UniquePtr<EVP_PKEY, EVP_PKEY_Delete> Unique_EVP_PKEY;
+typedef std::unique_ptr<EVP_PKEY, EVP_PKEY_Delete> Unique_EVP_PKEY;
struct PKCS8_PRIV_KEY_INFO_Delete {
void operator()(PKCS8_PRIV_KEY_INFO* p) const { PKCS8_PRIV_KEY_INFO_free(p); }
};
-typedef UniquePtr<PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_Delete> Unique_PKCS8_PRIV_KEY_INFO;
+typedef std::unique_ptr<PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_Delete> Unique_PKCS8_PRIV_KEY_INFO;
namespace keystore {