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

Unified Diff: crypto/ec_private_key_openssl.cc

Issue 1133303003: Add support for crypto::ECPrivateKey::Copy when built with BoringSSL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EVP_PKEY_dup -> EVP_PKEY_up_ref Created 5 years, 7 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.h ('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 b6b004cfb609b4204bed4eaab0d72b68389559e7..ca03fd435c27ad6b2296c25e882676a838e09c16 100644
--- a/crypto/ec_private_key_openssl.cc
+++ b/crypto/ec_private_key_openssl.cc
@@ -85,6 +85,16 @@ ECPrivateKey::~ECPrivateKey() {
EVP_PKEY_free(key_);
}
+ECPrivateKey* ECPrivateKey::Copy() const {
+ scoped_ptr<ECPrivateKey> copy(new ECPrivateKey);
+ if (key_) {
+ copy->key_ = EVP_PKEY_up_ref(key_);
+ if (!copy->key_)
+ return NULL;
davidben 2015/05/12 21:55:06 You can drop these two lines. EVP_PKEY_up_ref can'
nharper 2015/05/12 22:07:29 Done.
+ }
+ return copy.release();
+}
+
// static
bool ECPrivateKey::IsSupported() { return true; }
« no previous file with comments | « crypto/ec_private_key.h ('k') | crypto/ec_private_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698