Skip to content

Commit

Permalink
Add support for LibreSSL 2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvittal committed Oct 4, 2017
1 parent 7159215 commit e0efd1d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion openssl-sys/build.rs
Expand Up @@ -316,8 +316,10 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version {
#include <openssl/opensslv.h>
#include <openssl/opensslconf.h>
#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
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/ssl/tests/mod.rs
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion systest/build.rs
Expand Up @@ -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
};
Expand Down

0 comments on commit e0efd1d

Please sign in to comment.