From 35206570e98b58c036f8ca1b51e4e4d0563c37f1 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 31 Oct 2021 15:59:07 -0400 Subject: [PATCH] Deprecate tmp_ecdh_callback methods The current implementations leak memory (they should return a `&EcKeyRef`), and the underlying APIs haven't existed in OpenSSL for a long time anyway. Closes #1529 --- openssl/src/ssl/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 2e734ec7a..38bf02f6a 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -872,6 +872,7 @@ impl SslContextBuilder { /// /// This corresponds to `SSL_CTX_set_tmp_ecdh_callback`. #[cfg(all(ossl101, not(ossl110)))] + #[deprecated(note = "this function leaks memory and does not exist on newer OpenSSL versions")] pub fn set_tmp_ecdh_callback(&mut self, callback: F) where F: Fn(&mut SslRef, bool, u32) -> Result, ErrorStack> + 'static + Sync + Send, @@ -2581,6 +2582,7 @@ impl SslRef { /// /// [`SslContextBuilder::set_tmp_ecdh_callback`]: struct.SslContextBuilder.html#method.set_tmp_ecdh_callback #[cfg(any(all(ossl101, not(ossl110))))] + #[deprecated(note = "this function leaks memory and does not exist on newer OpenSSL versions")] pub fn set_tmp_ecdh_callback(&mut self, callback: F) where F: Fn(&mut SslRef, bool, u32) -> Result, ErrorStack> + 'static + Sync + Send, -- GitLab