Add support for LibreSSL 2.7.x. This patch was assembled from the following commits in rust-openssl's repository: * f0614f4acd6d24fbb100b8365bc54662d4f62df2 * 23ca9d2832ff54bc2067f99473802a3fbead0f3f * 03c6bcc159c5b987779da4f01c6f76bd77a13ce3 * 01855a4f6470db6d71bccece1db33bc4b89b4c9b --- a/src/vendor/openssl-sys/build.rs +++ b/src/vendor/openssl-sys/build.rs @@ -323,8 +323,10 @@ fn validate_headers(include_dirs: &[PathBuf]) -> Version { #include #include -#if LIBRESSL_VERSION_NUMBER >= 0x20700000 +#if LIBRESSL_VERSION_NUMBER >= 0x20800000 RUST_LIBRESSL_NEW +#elif LIBRESSL_VERSION_NUMBER >= 0x20700000 +RUST_LIBRESSL_27X #elif LIBRESSL_VERSION_NUMBER >= 0x20603000 RUST_LIBRESSL_26X #elif LIBRESSL_VERSION_NUMBER >= 0x20602000 @@ -473,6 +475,13 @@ See rust-openssl README for more information: println!("cargo:libressl_version=26x"); println!("cargo:version=101"); Version::Libressl + } else if expanded.contains("RUST_LIBRESSL_27X") { + println!("cargo:rustc-cfg=libressl"); + println!("cargo:rustc-cfg=libressl27"); + println!("cargo:libressl=true"); + println!("cargo:libressl_version=27x"); + println!("cargo:version=101"); + Version::Libressl } else if expanded.contains("RUST_OPENSSL_111") { println!("cargo:rustc-cfg=ossl111"); println!("cargo:rustc-cfg=ossl110"); @@ -501,7 +510,7 @@ See rust-openssl README for more information: " This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5 -and 2.6, but a different version of OpenSSL was found. The build is now aborting +through 2.7, but a different version of OpenSSL was found. The build is now aborting due to this version mismatch. " --- a/src/vendor/openssl-sys/src/lib.rs +++ b/src/vendor/openssl-sys/src/lib.rs @@ -1249,14 +1249,14 @@ 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(any(libressl261, libressl262, libressl26x, ossl101)))] +#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27, ossl101)))] pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x00000010; -#[cfg(any(libressl261, libressl262, libressl26x))] +#[cfg(any(libressl261, libressl262, libressl26x, libressl27))] pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x0; pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: c_ulong = 0x00000800; -#[cfg(not(any(libressl261, libressl262, libressl26x)))] +#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27)))] pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x80000000; -#[cfg(any(libressl261, libressl262, libressl26x))] +#[cfg(any(libressl261, libressl262, libressl26x, libressl27))] pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x0; pub const SSL_OP_LEGACY_SERVER_CONNECT: c_ulong = 0x00000004; #[cfg(not(libressl))] --- a/src/vendor/openssl-sys/src/libressl/mod.rs +++ b/src/vendor/openssl-sys/src/libressl/mod.rs @@ -331,9 +331,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(any(libressl261, libressl262, libressl26x))] +#[cfg(any(libressl261, libressl262, libressl26x, libressl27))] pub const SSL_OP_ALL: c_ulong = 0x4; -#[cfg(not(any(libressl261, libressl262, libressl26x)))] +#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27)))] 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; @@ -346,9 +346,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(any(libressl261, libressl262, libressl26x))] +#[cfg(any(libressl261, libressl262, libressl26x, libressl27))] pub const SSL_OP_SINGLE_ECDH_USE: c_ulong = 0x0; -#[cfg(not(any(libressl261, libressl262, libressl26x)))] +#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27)))] 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; --- a/src/vendor/openssl-sys/.cargo-checksum.json +++ b/src/vendor/openssl-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"84ca02d51869a94d631415447762ab0c12592d9a18934cdbdbe8974fdf77ffd5","Cargo.toml.orig":"0c05fcc731ca9be285c38a16086339cca2b7a57642ea969e43a1813fb032ae78","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"d95a3aa19289431dd60885a27f8b57860fd5906cf001780e14e93b18c9136a47","build.rs":"59dbe79ac18a2cd1aa01d4847d8dc8f3dcb2496dfd2a467308167498d58d2cf3","src/lib.rs":"9c53b3ba767f0924513009e52715bcc2b6b3bc9ded878dfe54fa16d080aff48c","src/libressl/mod.rs":"192fbed74cedac430dda84449409f9cd93f20da01db669912bcddfe4d5d1a51e","src/libressl/v250.rs":"8e64255d67e9e684b6d76184f96cfb8dca34c7f241fdbc08a982a221644257ea","src/libressl/v25x.rs":"08a71c8fac38851f9b9e58ae5f1ca39185a8057f93accc142da822c6bf3488f4","src/ossl10x.rs":"5df1084914e88eb9d73d57a4b78a2ea7fde9aeb58c5322a5a99b3ab19720cb8d","src/ossl110.rs":"54bda26bdf5488da9a904854b7171a4005e99d930605ed8279644104f16b3a85","src/ossl111.rs":"cb65c7ef481e50e1901c0b1f533703e4609858c8642b4569a66f037f23d515ee"},"package":"d6fdc5c4a02e69ce65046f1763a0181107038e02176233acb0b3351d7cc588f9"} +{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"84ca02d51869a94d631415447762ab0c12592d9a18934cdbdbe8974fdf77ffd5","Cargo.toml.orig":"0c05fcc731ca9be285c38a16086339cca2b7a57642ea969e43a1813fb032ae78","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"d95a3aa19289431dd60885a27f8b57860fd5906cf001780e14e93b18c9136a47","build.rs":"0f3e7e9a56d842afb30e5aecaaac3a2b82ccc48be785dcf1514380bc03a2bf24","src/lib.rs":"99135b825f8481f7f7f1861fd8447daad79add9576bd449ad52636014c5e4c0c","src/libressl/mod.rs":"803488d553de18dfefb6d5e8def39630ec45144ee1a8dd936a4e0e5e7fe50c38","src/libressl/v250.rs":"8e64255d67e9e684b6d76184f96cfb8dca34c7f241fdbc08a982a221644257ea","src/libressl/v25x.rs":"08a71c8fac38851f9b9e58ae5f1ca39185a8057f93accc142da822c6bf3488f4","src/ossl10x.rs":"5df1084914e88eb9d73d57a4b78a2ea7fde9aeb58c5322a5a99b3ab19720cb8d","src/ossl110.rs":"54bda26bdf5488da9a904854b7171a4005e99d930605ed8279644104f16b3a85","src/ossl111.rs":"cb65c7ef481e50e1901c0b1f533703e4609858c8642b4569a66f037f23d515ee"},"package":"d6fdc5c4a02e69ce65046f1763a0181107038e02176233acb0b3351d7cc588f9"}