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

Unified Diff: net/ssl/openssl_client_key_store.cc

Issue 2113143004: Switch to OpenSSL's |EVP_PKEY_up_ref| signature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/socket/ssl_server_socket_unittest.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 9b1b8767cf776d176e986ad623a3d0d8acc5f10d..fb1b172a71ad67d231856717ac7f932e2830cc6f 100644
--- a/net/ssl/openssl_client_key_store.cc
+++ b/net/ssl/openssl_client_key_store.cc
@@ -39,16 +39,18 @@ OpenSSLClientKeyStore::~OpenSSLClientKeyStore() {
}
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)) {
+ : public_key(pub_key), private_key(priv_key) {
+ EVP_PKEY_up_ref(pub_key);
+ EVP_PKEY_up_ref(priv_key);
}
OpenSSLClientKeyStore::KeyPair::~KeyPair() {
}
OpenSSLClientKeyStore::KeyPair::KeyPair(const KeyPair& other)
- : public_key(EVP_PKEY_up_ref(other.public_key.get())),
- private_key(EVP_PKEY_up_ref(other.private_key.get())) {
+ : public_key(other.public_key.get()), private_key(other.private_key.get()) {
+ EVP_PKEY_up_ref(public_key.get());
+ EVP_PKEY_up_ref(private_key.get());
}
void OpenSSLClientKeyStore::KeyPair::operator=(KeyPair other) {
@@ -109,8 +111,8 @@ crypto::ScopedEVP_PKEY OpenSSLClientKeyStore::FetchClientCertPrivateKey(
if (index < 0)
return crypto::ScopedEVP_PKEY();
- return crypto::ScopedEVP_PKEY(
- EVP_PKEY_up_ref(pairs_[index].private_key.get()));
+ EVP_PKEY_up_ref(pairs_[index].private_key.get());
+ return crypto::ScopedEVP_PKEY(pairs_[index].private_key.get());
}
void OpenSSLClientKeyStore::Flush() {
« no previous file with comments | « net/socket/ssl_server_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698