diff --git a/keystore-engine/android_engine.cpp b/keystore-engine/android_engine.cpp
index 856194d..e3525b2 100644
--- a/keystore-engine/android_engine.cpp
+++ b/keystore-engine/android_engine.cpp
@@ -251,32 +251,11 @@
       EC_KEY_get_ex_data(ec_key, g_keystore_engine->ec_key_ex_index()));
 }
 
-struct EVP_PKEY_Delete {
-    void operator()(EVP_PKEY* p) const {
-        EVP_PKEY_free(p);
-    }
-};
-typedef std::unique_ptr<EVP_PKEY, EVP_PKEY_Delete> Unique_EVP_PKEY;
-
-struct RSA_Delete {
-    void operator()(RSA* p) const {
-        RSA_free(p);
-    }
-};
-typedef std::unique_ptr<RSA, RSA_Delete> Unique_RSA;
-
-struct EC_KEY_Delete {
-    void operator()(EC_KEY* ec) const {
-        EC_KEY_free(ec);
-    }
-};
-typedef std::unique_ptr<EC_KEY, EC_KEY_Delete> Unique_EC_KEY;
-
 /* wrap_rsa returns an |EVP_PKEY| that contains an RSA key where the public
  * part is taken from |public_rsa| and the private operations are forwarded to
  * KeyStore and operate on the key named |key_id|. */
 static EVP_PKEY *wrap_rsa(const char *key_id, const RSA *public_rsa) {
-    Unique_RSA rsa(RSA_new_method(g_keystore_engine->engine()));
+    bssl::UniquePtr<RSA> rsa(RSA_new_method(g_keystore_engine->engine()));
     if (rsa.get() == nullptr) {
         return nullptr;
     }
@@ -298,7 +277,7 @@
         return nullptr;
     }
 
-    Unique_EVP_PKEY result(EVP_PKEY_new());
+    bssl::UniquePtr<EVP_PKEY> result(EVP_PKEY_new());
     if (result.get() == nullptr ||
         !EVP_PKEY_assign_RSA(result.get(), rsa.get())) {
         return nullptr;
@@ -312,7 +291,7 @@
  * part is taken from |public_rsa| and the private operations are forwarded to
  * KeyStore and operate on the key named |key_id|. */
 static EVP_PKEY *wrap_ecdsa(const char *key_id, const EC_KEY *public_ecdsa) {
-    Unique_EC_KEY ec(EC_KEY_new_method(g_keystore_engine->engine()));
+    bssl::UniquePtr<EC_KEY> ec(EC_KEY_new_method(g_keystore_engine->engine()));
     if (ec.get() == nullptr) {
         return nullptr;
     }
@@ -333,7 +312,7 @@
         return nullptr;
     }
 
-    Unique_EVP_PKEY result(EVP_PKEY_new());
+    bssl::UniquePtr<EVP_PKEY> result(EVP_PKEY_new());
     if (result.get() == nullptr ||
         !EVP_PKEY_assign_EC_KEY(result.get(), ec.get())) {
         return nullptr;
@@ -370,7 +349,7 @@
     }
 
     const uint8_t *inp = pubkey;
-    Unique_EVP_PKEY pkey(d2i_PUBKEY(nullptr, &inp, pubkey_len));
+    bssl::UniquePtr<EVP_PKEY> pkey(d2i_PUBKEY(nullptr, &inp, pubkey_len));
     if (pkey.get() == nullptr) {
         ALOGW("Cannot convert pubkey");
         return nullptr;
@@ -379,12 +358,12 @@
     EVP_PKEY *result;
     switch (EVP_PKEY_type(pkey->type)) {
     case EVP_PKEY_RSA: {
-        Unique_RSA public_rsa(EVP_PKEY_get1_RSA(pkey.get()));
+        bssl::UniquePtr<RSA> public_rsa(EVP_PKEY_get1_RSA(pkey.get()));
         result = wrap_rsa(key_id, public_rsa.get());
         break;
     }
     case EVP_PKEY_EC: {
-        Unique_EC_KEY public_ecdsa(EVP_PKEY_get1_EC_KEY(pkey.get()));
+        bssl::UniquePtr<EC_KEY> public_ecdsa(EVP_PKEY_get1_EC_KEY(pkey.get()));
         result = wrap_ecdsa(key_id, public_ecdsa.get());
         break;
     }
diff --git a/keystore-engine/methods.h b/keystore-engine/methods.h
index da54ce2..853bc57 100644
--- a/keystore-engine/methods.h
+++ b/keystore-engine/methods.h
@@ -29,28 +29,6 @@
 extern int dsa_key_handle;
 extern int rsa_key_handle;
 
-struct DSA_Delete {
-    void operator()(DSA* p) const {
-        DSA_free(p);
-    }
-};
-typedef std::unique_ptr<DSA, struct DSA_Delete> Unique_DSA;
-
-struct EC_KEY_Delete {
-    void operator()(EC_KEY* p) const {
-        EC_KEY_free(p);
-    }
-};
-typedef std::unique_ptr<EC_KEY, EC_KEY_Delete> Unique_EC_KEY;
-
-struct RSA_Delete {
-    void operator()(RSA* p) const {
-        RSA_free(p);
-    }
-};
-typedef std::unique_ptr<RSA, struct RSA_Delete> Unique_RSA;
-
-
 /* Keyhandles for ENGINE metadata */
 int keyhandle_new(void*, void*, CRYPTO_EX_DATA* ad, int idx, long, void*);
 void keyhandle_free(void *, void *ptr, CRYPTO_EX_DATA*, int, long, void*);
diff --git a/keystore/KeyStore.cpp b/keystore/KeyStore.cpp
index d4219bd..7545397 100644
--- a/keystore/KeyStore.cpp
+++ b/keystore/KeyStore.cpp
@@ -402,11 +402,6 @@
     return updated;
 }
 
-struct BIO_Delete {
-    void operator()(BIO* p) const { BIO_free(p); }
-};
-typedef std::unique_ptr<BIO, BIO_Delete> Unique_BIO;
-
 void KeyStore::readMetaData() {
     int in = TEMP_FAILURE_RETRY(open(kMetaDataFile, O_RDONLY));
     if (in < 0) {
diff --git a/keystore/blob.cpp b/keystore/blob.cpp
index 0987139..cea652f 100644
--- a/keystore/blob.cpp
+++ b/keystore/blob.cpp
@@ -42,16 +42,6 @@
 
 constexpr size_t kGcmIvSizeBytes = 96 / 8;
 
-template <typename T, void (*FreeFunc)(T*)> struct OpenSslObjectDeleter {
-    void operator()(T* p) { FreeFunc(p); }
-};
-
-#define DEFINE_OPENSSL_OBJECT_POINTER(name)                                                        \
-    typedef OpenSslObjectDeleter<name, name##_free> name##_Delete;                                 \
-    typedef std::unique_ptr<name, name##_Delete> name##_Ptr;
-
-DEFINE_OPENSSL_OBJECT_POINTER(EVP_CIPHER_CTX);
-
 #if defined(__clang__)
 #define OPTNONE __attribute__((optnone))
 #elif defined(__GNUC__)
@@ -92,7 +82,7 @@
     // There can be 128-bit and 256-bit keys
     const EVP_CIPHER* cipher = getAesCipherForKey(key);
 
-    EVP_CIPHER_CTX_Ptr ctx(EVP_CIPHER_CTX_new());
+    bssl::UniquePtr<EVP_CIPHER_CTX> ctx(EVP_CIPHER_CTX_new());
 
     EVP_EncryptInit_ex(ctx.get(), cipher, nullptr /* engine */, key.data(), iv);
     EVP_CIPHER_CTX_set_padding(ctx.get(), 0 /* no padding needed with GCM */);
@@ -129,7 +119,7 @@
     // There can be 128-bit and 256-bit keys
     const EVP_CIPHER* cipher = getAesCipherForKey(key);
 
-    EVP_CIPHER_CTX_Ptr ctx(EVP_CIPHER_CTX_new());
+    bssl::UniquePtr<EVP_CIPHER_CTX> ctx(EVP_CIPHER_CTX_new());
 
     EVP_DecryptInit_ex(ctx.get(), cipher, nullptr /* engine */, key.data(), iv);
     EVP_CIPHER_CTX_set_padding(ctx.get(), 0 /* no padding needed with GCM */);
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index a9c3687..279df2d 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -72,11 +72,6 @@
 const int ID_ATTESTATION_REQUEST_GENERIC_INFO = 1 << 0;
 const int ID_ATTESTATION_REQUEST_UNIQUE_DEVICE_ID = 1 << 1;
 
-struct BIGNUM_Delete {
-    void operator()(BIGNUM* p) const { BN_free(p); }
-};
-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_utils.h b/keystore/keystore_utils.h
index 380eb4e..ce64d42 100644
--- a/keystore/keystore_utils.h
+++ b/keystore/keystore_utils.h
@@ -47,16 +47,6 @@
  */
 uid_t get_user_id(uid_t uid);
 
-struct EVP_PKEY_Delete {
-    void operator()(EVP_PKEY* p) const { EVP_PKEY_free(p); }
-};
-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 std::unique_ptr<PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_Delete> Unique_PKCS8_PRIV_KEY_INFO;
-
 class Blob;
 
 // Tags for audit logging. Be careful and don't log sensitive data.
