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

Unified Diff: crypto/symmetric_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/signature_verifier_openssl.cc ('k') | crypto/symmetric_key_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/symmetric_key_openssl.cc
diff --git a/crypto/symmetric_key_openssl.cc b/crypto/symmetric_key_openssl.cc
index 2c5358f6274ac3a30128768fd35aa812ebab6e6f..5aef1d4ffc11f2da50fa1a89e68141643bd18fbf 100644
--- a/crypto/symmetric_key_openssl.cc
+++ b/crypto/symmetric_key_openssl.cc
@@ -10,9 +10,9 @@
#include <stdint.h>
#include <algorithm>
+#include <memory>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_util.h"
#include "crypto/openssl_util.h"
@@ -40,7 +40,7 @@ SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm,
return NULL;
OpenSSLErrStackTracer err_tracer(FROM_HERE);
- scoped_ptr<SymmetricKey> key(new SymmetricKey);
+ std::unique_ptr<SymmetricKey> key(new SymmetricKey);
uint8_t* key_data = reinterpret_cast<uint8_t*>(
base::WriteInto(&key->key_, key_size_in_bytes + 1));
@@ -71,7 +71,7 @@ SymmetricKey* SymmetricKey::DeriveKeyFromPassword(Algorithm algorithm,
return NULL;
OpenSSLErrStackTracer err_tracer(FROM_HERE);
- scoped_ptr<SymmetricKey> key(new SymmetricKey);
+ std::unique_ptr<SymmetricKey> key(new SymmetricKey);
uint8_t* key_data = reinterpret_cast<uint8_t*>(
base::WriteInto(&key->key_, key_size_in_bytes + 1));
int rv = PKCS5_PBKDF2_HMAC_SHA1(
@@ -92,7 +92,7 @@ SymmetricKey* SymmetricKey::Import(Algorithm algorithm,
return NULL;
}
- scoped_ptr<SymmetricKey> key(new SymmetricKey);
+ std::unique_ptr<SymmetricKey> key(new SymmetricKey);
key->key_ = raw_key;
return key.release();
}
« no previous file with comments | « crypto/signature_verifier_openssl.cc ('k') | crypto/symmetric_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698