Skip to content

Commit

Permalink
Merge pull request #1333 from vishwin/master
Browse files Browse the repository at this point in the history
Support LibreSSL 3.3.1
  • Loading branch information
sfackler authored Dec 9, 2020
2 parents 3f724f1 + d71a757 commit faa86ae
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ workflows:
library: libressl
version: 2.5.5
- linux:
name: x86_64-libressl-3.2.0
name: x86_64-libressl-3.3.1
target: x86_64-unknown-linux-gnu
library: libressl
version: 3.2.0
version: 3.3.1
- macos:
name: macos
- macos:
Expand Down
3 changes: 3 additions & 0 deletions openssl-sys/build/cfgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
if libressl_version >= 0x2_09_01_00_0 {
cfgs.push("libressl291");
}
if libressl_version >= 0x3_02_01_00_0 {
cfgs.push("libressl321");
}
} else {
let openssl_version = openssl_version.unwrap();

Expand Down
6 changes: 5 additions & 1 deletion openssl-sys/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ See rust-openssl README for more information:
(3, 1, 0) => ('3', '1', '0'),
(3, 1, _) => ('3', '1', 'x'),
(3, 2, 0) => ('3', '2', '0'),
(3, 2, 1) => ('3', '2', '1'),
(3, 2, _) => ('3', '2', 'x'),
(3, 3, 0) => ('3', '3', '0'),
(3, 3, 1) => ('3', '3', '1'),
_ => version_error(),
};

Expand Down Expand Up @@ -262,7 +266,7 @@ fn version_error() -> ! {
"
This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5
through 3.2.0, but a different version of OpenSSL was found. The build is now aborting
through 3.3.1, but a different version of OpenSSL was found. The build is now aborting
due to this version mismatch.
"
Expand Down
4 changes: 4 additions & 0 deletions openssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,9 @@ fn main() {
if version >= 0x2_09_01_00_0 {
println!("cargo:rustc-cfg=libressl291");
}

if version >= 0x3_02_01_00_0 {
println!("cargo:rustc-cfg=libressl321");
}
}
}
6 changes: 6 additions & 0 deletions openssl/src/ssl/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ fn read_panic() {
}

#[test]
#[cfg_attr(libressl321, ignore)]
#[should_panic(expected = "blammo")]
fn flush_panic() {
struct ExplodingStream(TcpStream);
Expand Down Expand Up @@ -841,6 +842,7 @@ fn cert_store() {
}

#[test]
#[cfg_attr(libressl321, ignore)]
fn tmp_dh_callback() {
static CALLED_BACK: AtomicBool = AtomicBool::new(false);

Expand Down Expand Up @@ -887,6 +889,7 @@ fn tmp_ecdh_callback() {
}

#[test]
#[cfg_attr(libressl321, ignore)]
fn tmp_dh_callback_ssl() {
static CALLED_BACK: AtomicBool = AtomicBool::new(false);

Expand Down Expand Up @@ -944,6 +947,7 @@ fn idle_session() {
}

#[test]
#[cfg_attr(libressl321, ignore)]
fn active_session() {
let server = Server::builder().build();

Expand Down Expand Up @@ -999,6 +1003,7 @@ fn status_callbacks() {
}

#[test]
#[cfg_attr(libressl321, ignore)]
fn new_session_callback() {
static CALLED_BACK: AtomicBool = AtomicBool::new(false);

Expand All @@ -1022,6 +1027,7 @@ fn new_session_callback() {
}

#[test]
#[cfg_attr(libressl321, ignore)]
fn new_session_callback_swapped_ctx() {
static CALLED_BACK: AtomicBool = AtomicBool::new(false);

Expand Down

0 comments on commit faa86ae

Please sign in to comment.