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

Unified Diff: crypto/rsa_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/rsa_private_key_nss.cc ('k') | crypto/rsa_private_key_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/rsa_private_key_openssl.cc
diff --git a/crypto/rsa_private_key_openssl.cc b/crypto/rsa_private_key_openssl.cc
index 3e87a0a5ff5b6b78aebdd59c9c1812b9ba706b0a..bca4b24015cc3b3ecd0f4f1a8c14b39c8db0ca84 100644
--- a/crypto/rsa_private_key_openssl.cc
+++ b/crypto/rsa_private_key_openssl.cc
@@ -4,15 +4,16 @@
#include "crypto/rsa_private_key.h"
-#include <openssl/bytestring.h>
#include <openssl/bn.h>
+#include <openssl/bytestring.h>
#include <openssl/evp.h>
#include <openssl/mem.h>
#include <openssl/rsa.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"
@@ -31,7 +32,7 @@ RSAPrivateKey* RSAPrivateKey::Create(uint16_t num_bits) {
if (!RSA_generate_key_ex(rsa_key.get(), num_bits, bn.get(), NULL))
return NULL;
- scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey);
+ std::unique_ptr<RSAPrivateKey> result(new RSAPrivateKey);
result->key_ = EVP_PKEY_new();
if (!result->key_ || !EVP_PKEY_set1_RSA(result->key_, rsa_key.get()))
return NULL;
@@ -50,7 +51,7 @@ RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo(
if (!pkey || CBS_len(&cbs) != 0 || EVP_PKEY_id(pkey.get()) != EVP_PKEY_RSA)
return nullptr;
- scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey);
+ std::unique_ptr<RSAPrivateKey> result(new RSAPrivateKey);
result->key_ = pkey.release();
return result.release();
}
@@ -75,7 +76,7 @@ RSAPrivateKey::~RSAPrivateKey() {
}
RSAPrivateKey* RSAPrivateKey::Copy() const {
- scoped_ptr<RSAPrivateKey> copy(new RSAPrivateKey());
+ std::unique_ptr<RSAPrivateKey> copy(new RSAPrivateKey());
ScopedRSA rsa(EVP_PKEY_get1_RSA(key_));
if (!rsa)
return NULL;
« no previous file with comments | « crypto/rsa_private_key_nss.cc ('k') | crypto/rsa_private_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698