Merge branch 'release-v0.7.1' into release
This commit is contained in:
commit
badec803cb
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[](https://travis-ci.org/sfackler/rust-openssl)
|
[](https://travis-ci.org/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).
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
[package]
|
[package]
|
||||||
name = "openssl-sys-extras"
|
name = "openssl-sys-extras"
|
||||||
version = "0.7.0"
|
version = "0.7.1"
|
||||||
authors = ["Steven Fackler <sfackler@gmail.com>"]
|
authors = ["Steven Fackler <sfackler@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "Extra FFI bindings to OpenSSL that require a C shim"
|
description = "Extra FFI bindings to OpenSSL that require a C shim"
|
||||||
repository = "https://github.com/sfackler/rust-openssl"
|
repository = "https://github.com/sfackler/rust-openssl"
|
||||||
documentation = "https://sfackler.github.io/rust-openssl/doc/v0.7.0/openssl_sys_extras"
|
documentation = "https://sfackler.github.io/rust-openssl/doc/v0.7.1/openssl_sys_extras"
|
||||||
|
|
||||||
links = "openssl_shim"
|
links = "openssl_shim"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
@ -15,7 +15,7 @@ ecdh_auto = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
openssl-sys = { version = "0.7", path = "../openssl-sys" }
|
openssl-sys = { version = "0.7.1", path = "../openssl-sys" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
gcc = "0.3"
|
gcc = "0.3"
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
[package]
|
[package]
|
||||||
name = "openssl-sys"
|
name = "openssl-sys"
|
||||||
version = "0.7.0"
|
version = "0.7.1"
|
||||||
authors = ["Alex Crichton <alex@alexcrichton.com>",
|
authors = ["Alex Crichton <alex@alexcrichton.com>",
|
||||||
"Steven Fackler <sfackler@gmail.com>"]
|
"Steven Fackler <sfackler@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "FFI bindings to OpenSSL"
|
description = "FFI bindings to OpenSSL"
|
||||||
repository = "https://github.com/sfackler/rust-openssl"
|
repository = "https://github.com/sfackler/rust-openssl"
|
||||||
documentation = "https://sfackler.github.io/rust-openssl/doc/v0.7.0/openssl_sys"
|
documentation = "https://sfackler.github.io/rust-openssl/doc/v0.7.1/openssl_sys"
|
||||||
|
|
||||||
links = "openssl"
|
links = "openssl"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
@ -29,7 +29,6 @@ libc = "0.2"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
pkg-config = "0.3"
|
pkg-config = "0.3"
|
||||||
gcc = "0.3"
|
|
||||||
|
|
||||||
[target.le32-unknown-nacl.dependencies]
|
[target.le32-unknown-nacl.dependencies]
|
||||||
libressl-pnacl-sys = "2.1.0"
|
libressl-pnacl-sys = "2.1.0"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
extern crate pkg_config;
|
extern crate pkg_config;
|
||||||
extern crate gcc;
|
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
|
|
@ -16,8 +15,11 @@ fn main() {
|
||||||
// rustc doesn't seem to work with pkg-config's output in mingw64
|
// rustc doesn't seem to work with pkg-config's output in mingw64
|
||||||
if !target.contains("windows") {
|
if !target.contains("windows") {
|
||||||
if let Ok(info) = pkg_config::find_library("openssl") {
|
if let Ok(info) = pkg_config::find_library("openssl") {
|
||||||
|
// avoid empty include paths as they are not supported by GCC
|
||||||
|
if info.include_paths.len() > 0 {
|
||||||
let paths = env::join_paths(info.include_paths).unwrap();
|
let paths = env::join_paths(info.include_paths).unwrap();
|
||||||
println!("cargo:include={}", paths.to_str().unwrap());
|
println!("cargo:include={}", paths.to_str().unwrap());
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![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")]
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
|
|
@ -482,6 +482,7 @@ extern "C" {
|
||||||
|
|
||||||
pub fn RAND_bytes(buf: *mut u8, num: c_int) -> c_int;
|
pub fn RAND_bytes(buf: *mut u8, num: c_int) -> c_int;
|
||||||
|
|
||||||
|
pub fn RSA_free(rsa: *mut RSA);
|
||||||
pub fn RSA_generate_key(modsz: c_int, e: c_ulong, cb: *const c_void, cbarg: *const c_void) -> *mut RSA;
|
pub fn RSA_generate_key(modsz: c_int, e: c_ulong, cb: *const c_void, cbarg: *const c_void) -> *mut RSA;
|
||||||
pub fn RSA_generate_key_ex(rsa: *mut RSA, bits: c_int, e: *mut BIGNUM, cb: *const c_void) -> c_int;
|
pub fn RSA_generate_key_ex(rsa: *mut RSA, bits: c_int, e: *mut BIGNUM, cb: *const c_void) -> c_int;
|
||||||
pub fn RSA_private_decrypt(flen: c_int, from: *const u8, to: *mut u8, k: *mut RSA,
|
pub fn RSA_private_decrypt(flen: c_int, from: *const u8, to: *mut u8, k: *mut RSA,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
[package]
|
[package]
|
||||||
name = "openssl"
|
name = "openssl"
|
||||||
version = "0.7.0"
|
version = "0.7.1"
|
||||||
authors = ["Steven Fackler <sfackler@gmail.com>"]
|
authors = ["Steven Fackler <sfackler@gmail.com>"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
description = "OpenSSL bindings"
|
description = "OpenSSL bindings"
|
||||||
repository = "https://github.com/sfackler/rust-openssl"
|
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"
|
readme = "../README.md"
|
||||||
keywords = ["crypto", "tls", "ssl", "dtls"]
|
keywords = ["crypto", "tls", "ssl", "dtls"]
|
||||||
|
|
||||||
|
|
@ -27,8 +27,8 @@ ecdh_auto = ["openssl-sys-extras/ecdh_auto"]
|
||||||
bitflags = ">= 0.2, < 0.4"
|
bitflags = ">= 0.2, < 0.4"
|
||||||
lazy_static = "0.1"
|
lazy_static = "0.1"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
openssl-sys = { version = "0.7", path = "../openssl-sys" }
|
openssl-sys = { version = "0.7.1", path = "../openssl-sys" }
|
||||||
openssl-sys-extras = { version = "0.7", path = "../openssl-sys-extras" }
|
openssl-sys-extras = { version = "0.7.1", path = "../openssl-sys-extras" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ impl PKey {
|
||||||
let mut s = repeat(0u8).take(len as usize).collect::<Vec<_>>();
|
let mut s = repeat(0u8).take(len as usize).collect::<Vec<_>>();
|
||||||
|
|
||||||
let r = f(rsa, &s.as_mut_ptr());
|
let r = f(rsa, &s.as_mut_ptr());
|
||||||
|
ffi::RSA_free(rsa);
|
||||||
|
|
||||||
s.truncate(r as usize);
|
s.truncate(r as usize);
|
||||||
s
|
s
|
||||||
|
|
|
||||||
|
|
@ -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]
|
#[macro_use]
|
||||||
extern crate bitflags;
|
extern crate bitflags;
|
||||||
|
|
|
||||||
|
|
@ -588,7 +588,7 @@ impl SslContext {
|
||||||
/// If `onoff` is set to `true`, enable ECDHE for key exchange with compatible
|
/// If `onoff` is set to `true`, enable ECDHE for key exchange with compatible
|
||||||
/// clients, and automatically select an appropriate elliptic curve.
|
/// 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")]
|
#[cfg(feature = "ecdh_auto")]
|
||||||
pub fn set_ecdh_auto(&mut self, onoff: bool) -> Result<(),SslError> {
|
pub fn set_ecdh_auto(&mut self, onoff: bool) -> Result<(),SslError> {
|
||||||
wrap_ssl_result(
|
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.
|
/// An SSL stream wrapping a nonblocking socket.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct NonblockingSslStream<S> {
|
pub struct NonblockingSslStream<S> {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue