Index: net/ssl/openssl_client_key_store.cc |
diff --git a/net/ssl/openssl_client_key_store.cc b/net/ssl/openssl_client_key_store.cc |
index b0b5eb3d4753d14a8ae186ba4fabfae1b927d243..67f2de9041d29eb8f5097a4a43cb2b1af8ea262a 100644 |
--- a/net/ssl/openssl_client_key_store.cc |
+++ b/net/ssl/openssl_client_key_store.cc |
@@ -51,14 +51,8 @@ OpenSSLClientKeyStore::KeyPair::KeyPair(const KeyPair& other) |
} |
void OpenSSLClientKeyStore::KeyPair::operator=(const KeyPair& other) { |
Jeffrey Yasskin
2014/09/29 17:23:19
operator= should generally be implemented with a b
Ryan Sleevi
2014/09/29 18:57:08
Except this isn't a swap. It's a copy.
Jeffrey Yasskin
2014/09/29 19:20:52
Yeah, the copy happens because the argument is pas
|
- // Use a temporary ScopedEVP_PKEY because scoped_ptr does not allow resetting |
- // to the current value, even though it's safe here. |
- crypto::ScopedEVP_PKEY public_key_tmp(EVP_PKEY_dup(other.public_key.get())); |
- crypto::ScopedEVP_PKEY private_key_tmp(EVP_PKEY_dup(other.private_key.get())); |
- public_key.reset(); |
- public_key = public_key_tmp.Pass(); |
- private_key.reset(); |
- private_key = private_key_tmp.Pass(); |
+ public_key.reset(EVP_PKEY_dup(other.public_key.get())); |
+ private_key.reset(EVP_PKEY_dup(other.private_key.get())); |
} |
int OpenSSLClientKeyStore::FindKeyPairIndex(EVP_PKEY* public_key) { |