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

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: . 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..16ce2e8061ebff4fcc303f3435cfcc22858f3bf5 100644
--- a/crypto/symmetric_key_openssl.cc
+++ b/crypto/symmetric_key_openssl.cc
@@ -2,19 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "crypto/symmetric_key.h"
-
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <stddef.h>
#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"
+#include "crypto/symmetric_key.h"
Ryan Sleevi 2016/04/08 21:15:26 This shouldn't have moved
Nico 2016/04/08 21:20:23 Oh, sorry. I tried to catch all these (the script
namespace crypto {
@@ -40,7 +39,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 +70,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 +91,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