Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Unified Diff: crypto/ec_private_key_openssl.cc

Issue 1870233002: Convert crypto to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/ec_private_key_nss.cc ('k') | crypto/ec_private_key_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/ec_private_key_openssl.cc
diff --git a/crypto/ec_private_key_openssl.cc b/crypto/ec_private_key_openssl.cc
index 1b6588b674560f2e2ed15ec2c6d6063bff3497ba..5e8d0549a85f00f60fa7f699898af354bfd6df49 100644
--- a/crypto/ec_private_key_openssl.cc
+++ b/crypto/ec_private_key_openssl.cc
@@ -13,8 +13,9 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "crypto/auto_cbb.h"
#include "crypto/openssl_util.h"
#include "crypto/scoped_openssl_types.h"
@@ -65,7 +66,7 @@ ECPrivateKey::~ECPrivateKey() {
}
ECPrivateKey* ECPrivateKey::Copy() const {
- scoped_ptr<ECPrivateKey> copy(new ECPrivateKey);
+ std::unique_ptr<ECPrivateKey> copy(new ECPrivateKey);
if (key_)
copy->key_ = EVP_PKEY_up_ref(key_);
return copy.release();
@@ -79,7 +80,7 @@ ECPrivateKey* ECPrivateKey::Create() {
if (!ec_key.get() || !EC_KEY_generate_key(ec_key.get()))
return NULL;
- scoped_ptr<ECPrivateKey> result(new ECPrivateKey());
+ std::unique_ptr<ECPrivateKey> result(new ECPrivateKey());
result->key_ = EVP_PKEY_new();
if (!result->key_ || !EVP_PKEY_set1_EC_KEY(result->key_, ec_key.get()))
return NULL;
@@ -128,7 +129,7 @@ ECPrivateKey* ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
return NULL;
// Create a new EVP_PKEY for it.
- scoped_ptr<ECPrivateKey> result(new ECPrivateKey);
+ std::unique_ptr<ECPrivateKey> result(new ECPrivateKey);
result->key_ = EVP_PKCS82PKEY(p8_decrypted.get());
if (!result->key_ || EVP_PKEY_type(result->key_->type) != EVP_PKEY_EC)
return NULL;
« no previous file with comments | « crypto/ec_private_key_nss.cc ('k') | crypto/ec_private_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698