--- vendor/openssl-sys/build/cfgs.rs.orig 2019-04-25 01:45:36.000000000 +0300 +++ vendor/openssl-sys/build/cfgs.rs 2019-05-02 20:16:08.086795000 +0300 @@ -13,6 +13,9 @@ if libressl_version >= 0x2_07_00_00_0 { cfgs.push("libressl270"); } + if libressl_version >= 0x2_07_01_00_0 { + cfgs.push("libressl271"); + } if libressl_version >= 0x2_07_03_00_0 { cfgs.push("libressl273"); } @@ -22,6 +25,9 @@ if libressl_version >= 0x2_08_01_00_0 { cfgs.push("libressl281"); } + if libressl_version >= 0x2_09_01_00_0 { + cfgs.push("libressl291"); + } } else { let openssl_version = openssl_version.unwrap(); --- vendor/openssl-sys/build/main.rs.orig 2019-04-25 01:45:36.000000000 +0300 +++ vendor/openssl-sys/build/main.rs 2019-05-02 20:17:29.983045000 +0300 @@ -505,6 +199,7 @@ (8, 1) => ('8', '1'), (8, _) => ('8', 'x'), (9, 0) => ('9', '0'), + (9, _) => ('9', 'x'), _ => version_error(), }; @@ -545,7 +240,7 @@ " This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5 -through 2.9.0, but a different version of OpenSSL was found. The build is now aborting +through 2.9.x, but a different version of OpenSSL was found. The build is now aborting due to this version mismatch. " --- vendor/openssl-sys/src/crypto.rs.orig 2019-04-25 01:45:36.000000000 +0300 +++ vendor/openssl-sys/src/crypto.rs 2019-05-02 20:18:55.839764000 +0300 @@ -15,7 +15,13 @@ if #[cfg(ossl110)] { pub const CRYPTO_EX_INDEX_SSL: c_int = 0; pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 1; - + } else if #[cfg(libressl)] { + pub const CRYPTO_EX_INDEX_SSL: c_int = 1; + pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 2; + } +} +cfg_if! { + if #[cfg(any(ossl110, libressl271))] { extern "C" { pub fn OpenSSL_version_num() -> c_ulong; pub fn OpenSSL_version(key: c_int) -> *const c_char; @@ -64,7 +70,7 @@ argp: *mut c_void, ); extern "C" { - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl))] pub fn CRYPTO_get_ex_new_index( class_index: c_int, argl: c_long, --- vendor/openssl-sys/src/ssl.rs.orig 2019-04-25 01:45:36.000000000 +0300 +++ vendor/openssl-sys/src/ssl.rs 2019-05-02 20:20:24.648938000 +0300 @@ -1032,7 +1057,7 @@ } cfg_if! { - if #[cfg(ossl110)] { + if #[cfg(any(ossl110, libressl291))] { extern "C" { pub fn TLS_method() -> *const SSL_METHOD; --- vendor/openssl/build.rs.orig 2019-04-25 01:45:36.000000000 +0300 +++ vendor/openssl/build.rs 2019-05-02 20:22:09.179415000 +0300 @@ -46,12 +46,20 @@ println!("cargo:rustc-cfg=libressl270"); } + if version >= 0x2_07_01_00_0 { + println!("cargo:rustc-cfg=libressl271"); + } + if version >= 0x2_07_03_00_0 { println!("cargo:rustc-cfg=libressl273"); } if version >= 0x2_08_00_00_0 { println!("cargo:rustc-cfg=libressl280"); + } + + if version >= 0x2_09_01_00_0 { + println!("cargo:rustc-cfg=libressl291"); } } } --- vendor/openssl/src/ssl/mod.rs.orig 2019-04-25 01:45:36.000000000 +0300 +++ vendor/openssl/src/ssl/mod.rs 2019-05-02 20:23:48.173892000 +0300 @@ -3690,9 +3831,14 @@ } cfg_if! { - if #[cfg(ossl110)] { + if #[cfg(any(ossl110, libressl291))] { use ffi::{TLS_method, DTLS_method}; - + } else { + use ffi::{SSLv23_method as TLS_method, DTLSv1_method as DTLS_method}; + } +} +cfg_if! { + if #[cfg(ossl110)] { unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int { ffi::CRYPTO_get_ex_new_index( ffi::CRYPTO_EX_INDEX_SSL_CTX, @@ -3715,8 +3861,6 @@ ) } } else { - use ffi::{SSLv23_method as TLS_method, DTLSv1_method as DTLS_method}; - unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int { ffi::SSL_CTX_get_ex_new_index(0, ptr::null_mut(), None, None, Some(f)) } --- vendor/openssl/src/version.rs.orig 2019-04-25 01:45:36.000000000 +0300 +++ vendor/openssl/src/version.rs 2019-05-02 20:25:40.705066000 +0300 @@ -14,7 +14,7 @@ use std::ffi::CStr; cfg_if! { - if #[cfg(ossl110)] { + if #[cfg(any(ossl110, libressl271))] { use ffi::{ OPENSSL_VERSION, OPENSSL_CFLAGS, OPENSSL_BUILT_ON, OPENSSL_PLATFORM, OPENSSL_DIR, OpenSSL_version_num, OpenSSL_version,