From 43c951f743e68fac5f45119eda7c994882a1d489 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 30 Sep 2016 00:43:05 -0700 Subject: Add support for OpenSSL 1.1.0 This commit is relatively major refactoring of the `openssl-sys` crate as well as the `openssl` crate itself. The end goal here was to support OpenSSL 1.1.0, and lots of other various tweaks happened along the way. The major new features are: * OpenSSL 1.1.0 is supported * OpenSSL 0.9.8 is no longer supported (aka all OSX users by default) * All FFI bindings are verified with the `ctest` crate (same way as the `libc` crate) * CI matrixes are vastly expanded to include 32/64 of all platforms, more OpenSSL version coverage, as well as ARM coverage on Linux * The `c_helpers` module is completely removed along with the `gcc` dependency. * The `openssl-sys` build script was completely rewritten * Now uses `OPENSSL_DIR` to find the installation, not include/lib env vars. * Better error messages for mismatched versions. * Better error messages for failing to find OpenSSL on a platform (more can be done here) * Probing of OpenSSL build-time configuration to inform the API of the `*-sys` crate. * Many Cargo features have been removed as they're now enabled by default. As this is a breaking change to both the `openssl` and `openssl-sys` crates this will necessitate a major version bump of both. There's still a few more API questions remaining but let's hash that out on a PR! Closes #452 --- openssl/Cargo.toml | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'openssl/Cargo.toml') diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index 3fd46c4b..d9691403 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -12,28 +12,23 @@ build = "build.rs" exclude = ["test/*"] [features] -tlsv1_2 = ["openssl-sys/tlsv1_2"] -tlsv1_1 = ["openssl-sys/tlsv1_1"] -dtlsv1 = ["openssl-sys/dtlsv1"] -dtlsv1_2 = ["openssl-sys/dtlsv1_2"] -sslv2 = ["openssl-sys/sslv2"] -sslv3 = ["openssl-sys/sslv3"] -aes_xts = ["openssl-sys/aes_xts"] -aes_ctr = ["openssl-sys/aes_ctr"] -npn = ["openssl-sys/npn"] -alpn = ["openssl-sys/alpn"] -rfc5114 = ["openssl-sys/rfc5114"] -ecdh_auto = ["openssl-sys/ecdh_auto"] -pkcs5_pbkdf2_hmac = ["openssl-sys/pkcs5_pbkdf2_hmac"] -hmac_clone = ["openssl-sys/hmac_clone"] +aes_xts = [] +aes_ctr = [] -c_helpers = ["gcc"] -x509_clone = ["c_helpers"] -x509_generator_request = ["c_helpers"] -x509_expiry = ["c_helpers"] -ssl_context_clone = ["c_helpers"] -hmac = ["c_helpers"] -dh_from_params = ["c_helpers"] +# Added in OpenSSL 1.0.2 +rfc5114 = [] + +# TODO: what to do about these features? +# tlsv1_2 = [] +# tlsv1_1 = [] +# dtlsv1 = [] +# dtlsv1_2 = [] +# sslv2 = [] +# sslv3 = [] + +npn = [] +alpn = [] +ecdh_auto = [] [dependencies] bitflags = "0.7" @@ -41,11 +36,9 @@ lazy_static = "0.2" libc = "0.2" openssl-sys = { version = "0.7.17", path = "../openssl-sys" } -[build-dependencies] -gcc = { version = "0.3", optional = true } - [dev-dependencies] -rustc-serialize = "0.3" net2 = "0.2.16" +rustc-serialize = "0.3" +tempdir = "0.3" winapi = "0.2" ws2_32-sys = "0.2" -- cgit v1.2.3 From ce4d233d38db0e855397e7c6defd194ea8d5c686 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 12 Oct 2016 22:53:03 -0700 Subject: Tweak some comments in Cargo.toml --- openssl/Cargo.toml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'openssl/Cargo.toml') diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index d9691403..ada3fe36 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -12,19 +12,10 @@ build = "build.rs" exclude = ["test/*"] [features] -aes_xts = [] -aes_ctr = [] - # Added in OpenSSL 1.0.2 rfc5114 = [] - -# TODO: what to do about these features? -# tlsv1_2 = [] -# tlsv1_1 = [] -# dtlsv1 = [] -# dtlsv1_2 = [] -# sslv2 = [] -# sslv3 = [] +aes_xts = [] +aes_ctr = [] npn = [] alpn = [] -- cgit v1.2.3 From b610e01793f31836bb5e56b655a3bbae498649d6 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 13 Oct 2016 19:06:53 -0700 Subject: Flag off dtls and mask ssl_ops Also un-feature gate npn as it ships with 1.0.1 --- openssl/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openssl/Cargo.toml') diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index ada3fe36..868aef60 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -16,9 +16,9 @@ exclude = ["test/*"] rfc5114 = [] aes_xts = [] aes_ctr = [] - -npn = [] alpn = [] +openssl-102 = [] + ecdh_auto = [] [dependencies] -- cgit v1.2.3 From 1883590c61e912a627e3c02542d9a2d0b4019d24 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 13 Oct 2016 19:21:12 -0700 Subject: Correct feature selection in tests --- openssl/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openssl/Cargo.toml') diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index 868aef60..2ed0df12 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -17,9 +17,10 @@ rfc5114 = [] aes_xts = [] aes_ctr = [] alpn = [] +ecdh_auto = [] openssl-102 = [] -ecdh_auto = [] +openssl-110 = ["openssl-102"] [dependencies] bitflags = "0.7" -- cgit v1.2.3 From edfc50f37db8d230eb17480f124b9fd70166a940 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 13 Oct 2016 19:46:13 -0700 Subject: Clean up features --- openssl/Cargo.toml | 7 ------- 1 file changed, 7 deletions(-) (limited to 'openssl/Cargo.toml') diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index 2ed0df12..3845c51d 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -12,14 +12,7 @@ build = "build.rs" exclude = ["test/*"] [features] -# Added in OpenSSL 1.0.2 -rfc5114 = [] -aes_xts = [] -aes_ctr = [] -alpn = [] -ecdh_auto = [] openssl-102 = [] - openssl-110 = ["openssl-102"] [dependencies] -- cgit v1.2.3 From 194298a057bad2b79e45ef346a0e6f37f8bc0716 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 17 Oct 2016 21:21:09 -0700 Subject: Implement new feature setup The basic idea here is that there is a feature for each supported OpenSSL version. Enabling multiple features represents support for multiple OpenSSL versions, but it's then up to you to check which version you link against (probably by depending on openssl-sys and making a build script similar to what openssl does). --- openssl/Cargo.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'openssl/Cargo.toml') diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index 3845c51d..4891d79b 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -12,8 +12,9 @@ build = "build.rs" exclude = ["test/*"] [features] -openssl-102 = [] -openssl-110 = ["openssl-102"] +v101 = [] +v102 = [] +v110 = [] [dependencies] bitflags = "0.7" -- cgit v1.2.3 From 71a114707f9ed23bc43c9a5d41c8e42c9a4472ff Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 5 Nov 2016 10:38:12 -0700 Subject: Remove unused dependency --- openssl/Cargo.toml | 1 - 1 file changed, 1 deletion(-) (limited to 'openssl/Cargo.toml') diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index 4891d79b..44a5bad1 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -23,7 +23,6 @@ libc = "0.2" openssl-sys = { version = "0.7.17", path = "../openssl-sys" } [dev-dependencies] -net2 = "0.2.16" rustc-serialize = "0.3" tempdir = "0.3" winapi = "0.2" -- cgit v1.2.3 From 72ac2a01054392f4fde77d48b84865123a9a61f7 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 5 Nov 2016 20:05:50 -0700 Subject: Release v0.9.0 --- openssl/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openssl/Cargo.toml') diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index 44a5bad1..1417bea7 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "openssl" -version = "0.8.3" +version = "0.9.0" authors = ["Steven Fackler "] license = "Apache-2.0" description = "OpenSSL bindings" repository = "https://github.com/sfackler/rust-openssl" -documentation = "https://sfackler.github.io/rust-openssl/doc/v0.8.3/openssl" +documentation = "https://sfackler.github.io/rust-openssl/doc/v0.9.0/openssl" readme = "../README.md" keywords = ["crypto", "tls", "ssl", "dtls"] build = "build.rs" @@ -20,7 +20,7 @@ v110 = [] bitflags = "0.7" lazy_static = "0.2" libc = "0.2" -openssl-sys = { version = "0.7.17", path = "../openssl-sys" } +openssl-sys = { version = "0.9", path = "../openssl-sys" } [dev-dependencies] rustc-serialize = "0.3" -- cgit v1.2.3