Index: webrtc/base/opensslidentity.cc |
diff --git a/webrtc/base/opensslidentity.cc b/webrtc/base/opensslidentity.cc |
index 269bfced1706f612a8f82ab566eea28ce4b4bb53..3c421db07ce44cbcef69adf279a4fb460bd36f83 100644 |
--- a/webrtc/base/opensslidentity.cc |
+++ b/webrtc/base/opensslidentity.cc |
@@ -174,7 +174,11 @@ |
} |
void OpenSSLKeyPair::AddReference() { |
+#if defined(OPENSSL_IS_BORINGSSL) |
EVP_PKEY_up_ref(pkey_); |
+#else |
+ CRYPTO_add(&pkey_->references, 1, CRYPTO_LOCK_EVP_PKEY); |
+#endif |
} |
#if !defined(NDEBUG) |
@@ -357,7 +361,11 @@ |
void OpenSSLCertificate::AddReference() const { |
ASSERT(x509_ != NULL); |
+#if defined(OPENSSL_IS_BORINGSSL) |
X509_up_ref(x509_); |
+#else |
+ CRYPTO_add(&x509_->references, 1, CRYPTO_LOCK_X509); |
+#endif |
} |
// Documented in sslidentity.h. |