aboutsummaryrefslogtreecommitdiff
path: root/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'openssl')
-rw-r--r--openssl/Cargo.toml8
-rw-r--r--openssl/src/crypto/pkey.rs1
-rw-r--r--openssl/src/lib.rs2
-rw-r--r--openssl/src/ssl/mod.rs12
4 files changed, 17 insertions, 6 deletions
diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml
index 7cc29a1f..7b616f18 100644
--- a/openssl/Cargo.toml
+++ b/openssl/Cargo.toml
@@ -1,11 +1,11 @@
[package]
name = "openssl"
-version = "0.7.0"
+version = "0.7.1"
authors = ["Steven Fackler <[email protected]>"]
license = "Apache-2.0"
description = "OpenSSL bindings"
repository = "https://github.com/sfackler/rust-openssl"
-documentation = "https://sfackler.github.io/rust-openssl/doc/v0.7.0/openssl"
+documentation = "https://sfackler.github.io/rust-openssl/doc/v0.7.1/openssl"
readme = "../README.md"
keywords = ["crypto", "tls", "ssl", "dtls"]
@@ -27,8 +27,8 @@ ecdh_auto = ["openssl-sys-extras/ecdh_auto"]
bitflags = ">= 0.2, < 0.4"
lazy_static = "0.1"
libc = "0.2"
-openssl-sys = { version = "0.7", path = "../openssl-sys" }
-openssl-sys-extras = { version = "0.7", path = "../openssl-sys-extras" }
+openssl-sys = { version = "0.7.1", path = "../openssl-sys" }
+openssl-sys-extras = { version = "0.7.1", path = "../openssl-sys-extras" }
[dev-dependencies]
rustc-serialize = "0.3"
diff --git a/openssl/src/crypto/pkey.rs b/openssl/src/crypto/pkey.rs
index 6ca0aa12..741c6749 100644
--- a/openssl/src/crypto/pkey.rs
+++ b/openssl/src/crypto/pkey.rs
@@ -120,6 +120,7 @@ impl PKey {
let mut s = repeat(0u8).take(len as usize).collect::<Vec<_>>();
let r = f(rsa, &s.as_mut_ptr());
+ ffi::RSA_free(rsa);
s.truncate(r as usize);
s
diff --git a/openssl/src/lib.rs b/openssl/src/lib.rs
index 66ce1894..4691b6dd 100644
--- a/openssl/src/lib.rs
+++ b/openssl/src/lib.rs
@@ -1,4 +1,4 @@
-#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/v0.7.0")]
+#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/v0.7.1")]
#[macro_use]
extern crate bitflags;
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index 23364ef1..cca369a2 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -588,7 +588,7 @@ impl SslContext {
/// If `onoff` is set to `true`, enable ECDHE for key exchange with compatible
/// clients, and automatically select an appropriate elliptic curve.
///
- /// This method requires OpenSSL >= 1.2.0 or LibreSSL and the `ecdh_auto` feature.
+ /// This method requires OpenSSL >= 1.0.2 or LibreSSL and the `ecdh_auto` feature.
#[cfg(feature = "ecdh_auto")]
pub fn set_ecdh_auto(&mut self, onoff: bool) -> Result<(),SslError> {
wrap_ssl_result(
@@ -1416,6 +1416,16 @@ impl<S> MaybeSslStream<S> where S: Read+Write {
}
}
+impl MaybeSslStream<net::TcpStream> {
+ /// Like `TcpStream::try_clone`.
+ pub fn try_clone(&self) -> io::Result<MaybeSslStream<net::TcpStream>> {
+ match *self {
+ MaybeSslStream::Ssl(ref s) => s.try_clone().map(MaybeSslStream::Ssl),
+ MaybeSslStream::Normal(ref s) => s.try_clone().map(MaybeSslStream::Normal),
+ }
+ }
+}
+
/// An SSL stream wrapping a nonblocking socket.
#[derive(Clone)]
pub struct NonblockingSslStream<S> {