aboutsummaryrefslogtreecommitdiff
path: root/openssl-sys
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2017-09-17 13:57:18 -0700
committerGitHub <[email protected]>2017-09-17 13:57:18 -0700
commitf0db1dbc958d57d61c6bd33811a289a3ed705c13 (patch)
tree39eed5e4cd860663df49ff784260941059790d26 /openssl-sys
parentUpdate default client cipher list (diff)
parentopenssl: ecdh_tmp_callback doesn't work with libressl 2.6.1 (diff)
downloadrust-openssl-f0db1dbc958d57d61c6bd33811a289a3ed705c13.tar.xz
rust-openssl-f0db1dbc958d57d61c6bd33811a289a3ed705c13.zip
Merge pull request #695 from Keruspe/master
openssl-sys: support libressl 2.6.1
Diffstat (limited to 'openssl-sys')
-rw-r--r--openssl-sys/build.rs18
-rw-r--r--openssl-sys/src/lib.rs7
-rw-r--r--openssl-sys/src/libressl/mod.rs6
3 files changed, 29 insertions, 2 deletions
diff --git a/openssl-sys/build.rs b/openssl-sys/build.rs
index eb6979b0..4e0dbe80 100644
--- a/openssl-sys/build.rs
+++ b/openssl-sys/build.rs
@@ -316,8 +316,10 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version {
#include <openssl/opensslv.h>
#include <openssl/opensslconf.h>
-#if LIBRESSL_VERSION_NUMBER >= 0x20601000
+#if LIBRESSL_VERSION_NUMBER >= 0x20602000
RUST_LIBRESSL_NEW
+#elif LIBRESSL_VERSION_NUMBER >= 0x20601000
+RUST_LIBRESSL_261
#elif LIBRESSL_VERSION_NUMBER >= 0x20600000
RUST_LIBRESSL_260
#elif LIBRESSL_VERSION_NUMBER >= 0x20506000
@@ -412,42 +414,56 @@ See rust-openssl README for more information:
println!("cargo:rustc-cfg=libressl");
println!("cargo:rustc-cfg=libressl250");
println!("cargo:libressl=true");
+ println!("cargo:libressl_version=250");
println!("cargo:version=101");
Version::Libressl
} else if expanded.contains("RUST_LIBRESSL_251") {
println!("cargo:rustc-cfg=libressl");
println!("cargo:rustc-cfg=libressl251");
println!("cargo:libressl=true");
+ println!("cargo:libressl_version=251");
println!("cargo:version=101");
Version::Libressl
} else if expanded.contains("RUST_LIBRESSL_252") {
println!("cargo:rustc-cfg=libressl");
println!("cargo:rustc-cfg=libressl252");
println!("cargo:libressl=true");
+ println!("cargo:libressl_version=252");
println!("cargo:version=101");
Version::Libressl
} else if expanded.contains("RUST_LIBRESSL_253") {
println!("cargo:rustc-cfg=libressl");
println!("cargo:rustc-cfg=libressl253");
println!("cargo:libressl=true");
+ println!("cargo:libressl_version=253");
println!("cargo:version=101");
Version::Libressl
} else if expanded.contains("RUST_LIBRESSL_254") {
println!("cargo:rustc-cfg=libressl");
println!("cargo:rustc-cfg=libressl254");
println!("cargo:libressl=true");
+ println!("cargo:libressl_version=254");
println!("cargo:version=101");
Version::Libressl
} else if expanded.contains("RUST_LIBRESSL_255") {
println!("cargo:rustc-cfg=libressl");
println!("cargo:rustc-cfg=libressl255");
println!("cargo:libressl=true");
+ println!("cargo:libressl_version=255");
println!("cargo:version=101");
Version::Libressl
} else if expanded.contains("RUST_LIBRESSL_260") {
println!("cargo:rustc-cfg=libressl");
println!("cargo:rustc-cfg=libressl260");
println!("cargo:libressl=true");
+ println!("cargo:libressl_version=250");
+ println!("cargo:version=101");
+ Version::Libressl
+ } else if expanded.contains("RUST_LIBRESSL_261") {
+ println!("cargo:rustc-cfg=libressl");
+ println!("cargo:rustc-cfg=libressl261");
+ println!("cargo:libressl=true");
+ println!("cargo:libressl_version=261");
println!("cargo:version=101");
Version::Libressl
} else if expanded.contains("RUST_OPENSSL_110F") {
diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs
index 48d07b4a..81145432 100644
--- a/openssl-sys/src/lib.rs
+++ b/openssl-sys/src/lib.rs
@@ -1250,10 +1250,15 @@ pub const SSL_VERIFY_NONE: c_int = 0;
pub const SSL_VERIFY_PEER: c_int = 1;
pub const SSL_VERIFY_FAIL_IF_NO_PEER_CERT: c_int = 2;
-#[cfg(not(ossl101))]
+#[cfg(not(any(libressl261, ossl101)))]
pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x00000010;
+#[cfg(libressl261)]
+pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x0;
pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: c_ulong = 0x00000800;
+#[cfg(not(libressl261))]
pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x80000000;
+#[cfg(libressl261)]
+pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x0;
pub const SSL_OP_LEGACY_SERVER_CONNECT: c_ulong = 0x00000004;
#[cfg(not(libressl))]
pub const SSL_OP_SAFARI_ECDHE_ECDSA_BUG: c_ulong = 0x00000040;
diff --git a/openssl-sys/src/libressl/mod.rs b/openssl-sys/src/libressl/mod.rs
index f69198e2..f4806e8a 100644
--- a/openssl-sys/src/libressl/mod.rs
+++ b/openssl-sys/src/libressl/mod.rs
@@ -345,6 +345,9 @@ pub const SSL_CTRL_OPTIONS: c_int = 32;
pub const SSL_CTRL_CLEAR_OPTIONS: c_int = 77;
pub const SSL_CTRL_SET_ECDH_AUTO: c_int = 94;
+#[cfg(libressl261)]
+pub const SSL_OP_ALL: c_ulong = 0x4;
+#[cfg(not(libressl261))]
pub const SSL_OP_ALL: c_ulong = 0x80000014;
pub const SSL_OP_CISCO_ANYCONNECT: c_ulong = 0x0;
pub const SSL_OP_NO_COMPRESSION: c_ulong = 0x0;
@@ -357,6 +360,9 @@ pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: c_ulong = 0x0;
pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: c_ulong = 0x0;
pub const SSL_OP_TLS_D5_BUG: c_ulong = 0x0;
pub const SSL_OP_TLS_BLOCK_PADDING_BUG: c_ulong = 0x0;
+#[cfg(libressl261)]
+pub const SSL_OP_SINGLE_ECDH_USE: c_ulong = 0x0;
+#[cfg(not(libressl261))]
pub const SSL_OP_SINGLE_ECDH_USE: c_ulong = 0x00080000;
pub const SSL_OP_SINGLE_DH_USE: c_ulong = 0x00100000;
pub const SSL_OP_NO_SSLv2: c_ulong = 0x0;