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; } |