From e0efd1d438fbf426a7e1006e4983b0f352c630f6 Mon Sep 17 00:00:00 2001 From: Christopher Vittal Date: Tue, 3 Oct 2017 23:53:50 -0400 Subject: [PATCH] Add support for LibreSSL 2.6.2 --- openssl-sys/build.rs | 11 ++++++++++- openssl/src/ssl/tests/mod.rs | 2 +- systest/build.rs | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/openssl-sys/build.rs b/openssl-sys/build.rs index 4848f236..34b74f82 100644 --- a/openssl-sys/build.rs +++ b/openssl-sys/build.rs @@ -316,8 +316,10 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version { #include #include -#if LIBRESSL_VERSION_NUMBER >= 0x20602000 +#if LIBRESSL_VERSION_NUMBER >= 0x20603000 RUST_LIBRESSL_NEW +#elif LIBRESSL_VERSION_NUMBER >= 0x20602000 +RUST_LIBRESSL_262 #elif LIBRESSL_VERSION_NUMBER >= 0x20601000 RUST_LIBRESSL_261 #elif LIBRESSL_VERSION_NUMBER >= 0x20600000 @@ -466,6 +468,13 @@ See rust-openssl README for more information: println!("cargo:libressl_version=261"); println!("cargo:version=101"); Version::Libressl + } else if expanded.contains("RUST_LIBRESSL_262") { + println!("cargo:rustc-cfg=libressl"); + println!("cargo:rustc-cfg=libressl262"); + println!("cargo:libressl=true"); + println!("cargo:libressl_version=262"); + println!("cargo:version=101"); + Version::Libressl } else if expanded.contains("RUST_OPENSSL_110F") { println!("cargo:rustc-cfg=ossl110"); println!("cargo:rustc-cfg=ossl110f"); diff --git a/openssl/src/ssl/tests/mod.rs b/openssl/src/ssl/tests/mod.rs index a3ac6832..38c553e7 100644 --- a/openssl/src/ssl/tests/mod.rs +++ b/openssl/src/ssl/tests/mod.rs @@ -616,7 +616,7 @@ fn test_connect_with_npn_successful_single_match() { /// Tests that when the `SslStream` is created as a server stream, the protocols /// are correctly advertised to the client. #[test] -#[cfg(not(libressl261))] +#[cfg(all(not(libressl261),not(libressl262)))] fn test_npn_server_advertise_multiple() { let listener = TcpListener::bind("127.0.0.1:0").unwrap(); let localhost = listener.local_addr().unwrap(); diff --git a/systest/build.rs b/systest/build.rs index 45e335c0..7418cca0 100644 --- a/systest/build.rs +++ b/systest/build.rs @@ -42,7 +42,7 @@ fn main() { } let has_cms_h = if let Ok(version) = env::var("DEP_OPENSSL_LIBRESSL_VERSION") { - version != "261" + version != "261" && version != "262" } else { true };