Support LibreSSL 2.9.1

LibreSSL 2.9.1 added generic DTLS methods.

While here, bump CircleCI.
This commit is contained in:
Charlie Li 2019-04-23 09:53:56 -04:00
parent 2024379f17
commit f0b8a2e467
6 changed files with 12 additions and 4 deletions

View File

@ -286,7 +286,7 @@ workflows:
name: x86_64-libressl-2.9 name: x86_64-libressl-2.9
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
library: libressl library: libressl
version: 2.9.0 version: 2.9.1
- macos: - macos:
name: macos name: macos
- macos: - macos:

View File

@ -22,6 +22,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
if libressl_version >= 0x2_08_01_00_0 { if libressl_version >= 0x2_08_01_00_0 {
cfgs.push("libressl281"); cfgs.push("libressl281");
} }
if libressl_version >= 0x2_09_01_00_0 {
cfgs.push("libressl291");
}
} else { } else {
let openssl_version = openssl_version.unwrap(); let openssl_version = openssl_version.unwrap();

View File

@ -199,6 +199,7 @@ See rust-openssl README for more information:
(8, 1) => ('8', '1'), (8, 1) => ('8', '1'),
(8, _) => ('8', 'x'), (8, _) => ('8', 'x'),
(9, 0) => ('9', '0'), (9, 0) => ('9', '0'),
(9, 1) => ('9', '1'),
_ => version_error(), _ => 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 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. due to this version mismatch.
" "

View File

@ -1057,7 +1057,7 @@ extern "C" {
} }
cfg_if! { cfg_if! {
if #[cfg(ossl110)] { if #[cfg(ossl110, libressl291)] {
extern "C" { extern "C" {
pub fn TLS_method() -> *const SSL_METHOD; pub fn TLS_method() -> *const SSL_METHOD;

View File

@ -53,5 +53,9 @@ fn main() {
if version >= 0x2_08_00_00_0 { if version >= 0x2_08_00_00_0 {
println!("cargo:rustc-cfg=libressl280"); println!("cargo:rustc-cfg=libressl280");
} }
if version >= 0x2_09_01_00_0 {
println!("cargo:rustc-cfg=libressl291");
}
} }
} }

View File

@ -3831,7 +3831,7 @@ cfg_if! {
} }
cfg_if! { cfg_if! {
if #[cfg(ossl110)] { if #[cfg(ossl110, libressl291)] {
use ffi::{TLS_method, DTLS_method}; use ffi::{TLS_method, DTLS_method};
unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int { unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int {