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

Unified Diff: net/ssl/openssl_client_key_store.cc

Issue 1129083007: Replace EVP_PKEY_dup calls with EVP_PKEY_up_ref. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « net/base/openssl_private_key_store_memory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 de65cd9d677ddea26e9913e0655e8700c6aa67a5..0bc97beb48e55670ac1d5901b7933d0f35f0574c 100644
--- a/net/ssl/openssl_client_key_store.cc
+++ b/net/ssl/openssl_client_key_store.cc
@@ -37,18 +37,17 @@ OpenSSLClientKeyStore::OpenSSLClientKeyStore() {
OpenSSLClientKeyStore::~OpenSSLClientKeyStore() {
}
-OpenSSLClientKeyStore::KeyPair::KeyPair(EVP_PKEY* pub_key,
- EVP_PKEY* priv_key)
- : public_key(EVP_PKEY_dup(pub_key)),
- private_key(EVP_PKEY_dup(priv_key)) {
+OpenSSLClientKeyStore::KeyPair::KeyPair(EVP_PKEY* pub_key, EVP_PKEY* priv_key)
+ : public_key(EVP_PKEY_up_ref(pub_key)),
+ private_key(EVP_PKEY_up_ref(priv_key)) {
}
OpenSSLClientKeyStore::KeyPair::~KeyPair() {
}
OpenSSLClientKeyStore::KeyPair::KeyPair(const KeyPair& other)
- : public_key(EVP_PKEY_dup(other.public_key.get())),
- private_key(EVP_PKEY_dup(other.private_key.get())) {
+ : public_key(EVP_PKEY_up_ref(other.public_key.get())),
+ private_key(EVP_PKEY_up_ref(other.private_key.get())) {
}
void OpenSSLClientKeyStore::KeyPair::operator=(KeyPair other) {
@@ -109,7 +108,8 @@ crypto::ScopedEVP_PKEY OpenSSLClientKeyStore::FetchClientCertPrivateKey(
if (index < 0)
return crypto::ScopedEVP_PKEY();
- return crypto::ScopedEVP_PKEY(EVP_PKEY_dup(pairs_[index].private_key.get()));
+ return crypto::ScopedEVP_PKEY(
+ EVP_PKEY_up_ref(pairs_[index].private_key.get()));
}
void OpenSSLClientKeyStore::Flush() {
« no previous file with comments | « net/base/openssl_private_key_store_memory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698