From f0b8a2e4673cb0ee5987e58d78f8de55d399ad22 Mon Sep 17 00:00:00 2001 From: Charlie Li Date: Tue, 23 Apr 2019 09:53:56 -0400 Subject: [PATCH] Support LibreSSL 2.9.1 LibreSSL 2.9.1 added generic DTLS methods. While here, bump CircleCI. --- .circleci/config.yml | 2 +- openssl-sys/build/cfgs.rs | 3 +++ openssl-sys/build/main.rs | 3 ++- openssl-sys/src/ssl.rs | 2 +- openssl/build.rs | 4 ++++ openssl/src/ssl/mod.rs | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4cc7d3f4f..d805bb9bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -286,7 +286,7 @@ workflows: name: x86_64-libressl-2.9 target: x86_64-unknown-linux-gnu library: libressl - version: 2.9.0 + version: 2.9.1 - macos: name: macos - macos: diff --git a/openssl-sys/build/cfgs.rs b/openssl-sys/build/cfgs.rs index dc7240e2a..6de8a0782 100644 --- a/openssl-sys/build/cfgs.rs +++ b/openssl-sys/build/cfgs.rs @@ -22,6 +22,9 @@ pub fn get(openssl_version: Option, libressl_version: Option) -> Vec<& 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(); diff --git a/openssl-sys/build/main.rs b/openssl-sys/build/main.rs index 02b93b90a..4fabb6edf 100644 --- a/openssl-sys/build/main.rs +++ b/openssl-sys/build/main.rs @@ -199,6 +199,7 @@ See rust-openssl README for more information: (8, 1) => ('8', '1'), (8, _) => ('8', 'x'), (9, 0) => ('9', '0'), + (9, 1) => ('9', '1'), _ => version_error(), }; @@ -239,7 +240,7 @@ fn version_error() -> ! { " 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.1, but a different version of OpenSSL was found. The build is now aborting due to this version mismatch. " diff --git a/openssl-sys/src/ssl.rs b/openssl-sys/src/ssl.rs index fcbac3006..06a6a5c42 100644 --- a/openssl-sys/src/ssl.rs +++ b/openssl-sys/src/ssl.rs @@ -1057,7 +1057,7 @@ extern "C" { } cfg_if! { - if #[cfg(ossl110)] { + if #[cfg(ossl110, libressl291)] { extern "C" { pub fn TLS_method() -> *const SSL_METHOD; diff --git a/openssl/build.rs b/openssl/build.rs index 99731c57f..3b3f09d69 100644 --- a/openssl/build.rs +++ b/openssl/build.rs @@ -53,5 +53,9 @@ fn main() { if version >= 0x2_08_00_00_0 { println!("cargo:rustc-cfg=libressl280"); } + + if version >= 0x2_09_01_00_0 { + println!("cargo:rustc-cfg=libressl291"); + } } } diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index f433f74dc..115a38519 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -3831,7 +3831,7 @@ cfg_if! { } cfg_if! { - if #[cfg(ossl110)] { + if #[cfg(ossl110, libressl291)] { use ffi::{TLS_method, DTLS_method}; unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int { -- GitLab