diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe4ecb1a47a7b9c9c410c7b20dfb76b920127c5e..1ef8833b434ee1776c7c3d3e18a19066b3c017f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,7 +167,7 @@ jobs: - target: x86_64-unknown-linux-gnu library: name: libressl - version: 3.3.1 + version: 3.3.2 name: ${{ matrix.target }}-${{ matrix.library.name }}-${{ matrix.library.version }} runs-on: ubuntu-latest env: diff --git a/openssl-sys/build/cfgs.rs b/openssl-sys/build/cfgs.rs index 98a06d798f11d712436b0657c925e38bf6fede27..e556b4bb72f5b1956900eb7851402a08687297e0 100644 --- a/openssl-sys/build/cfgs.rs +++ b/openssl-sys/build/cfgs.rs @@ -31,6 +31,9 @@ pub fn get(openssl_version: Option, libressl_version: Option) -> Vec<& if libressl_version >= 0x3_02_01_00_0 { cfgs.push("libressl321"); } + if libressl_version >= 0x3_03_02_00_0 { + cfgs.push("libressl332"); + } } else { let openssl_version = openssl_version.unwrap(); diff --git a/openssl-sys/build/main.rs b/openssl-sys/build/main.rs index 105fa96a269ce78bab2f4e644b5cd6caa9866da3..493b9a5f4db7b31d3e130b98d35c7dc66608b3be 100644 --- a/openssl-sys/build/main.rs +++ b/openssl-sys/build/main.rs @@ -232,6 +232,7 @@ See rust-openssl README for more information: (3, 2, _) => ('3', '2', 'x'), (3, 3, 0) => ('3', '3', '0'), (3, 3, 1) => ('3', '3', '1'), + (3, 3, 2) => ('3', '3', '2'), _ => version_error(), }; @@ -272,7 +273,7 @@ fn version_error() -> ! { " This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5 -through 3.3.1, but a different version of OpenSSL was found. The build is now aborting +through 3.3.2, 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 bf7539fea1355224c0f7675b6a16a3552ed470fa..f60b129bc7a203e6020a69f0823e627450550b3d 100644 --- a/openssl-sys/src/ssl.rs +++ b/openssl-sys/src/ssl.rs @@ -311,10 +311,15 @@ pub const SSL_OP_NO_TLSv1_1: c_ulong = 0x10000000; pub const SSL_OP_NO_TLSv1_2: c_ulong = 0x08000000; pub const SSL_OP_NO_TLSv1: c_ulong = 0x04000000; -#[cfg(ossl102)] -pub const SSL_OP_NO_DTLSv1: c_ulong = 0x04000000; -#[cfg(ossl102)] -pub const SSL_OP_NO_DTLSv1_2: c_ulong = 0x08000000; +cfg_if! { + if #[cfg(ossl102)] { + pub const SSL_OP_NO_DTLSv1: c_ulong = 0x04000000; + pub const SSL_OP_NO_DTLSv1_2: c_ulong = 0x08000000; + } else if #[cfg(libressl332)] { + pub const SSL_OP_NO_DTLSv1: c_ulong = 0x40000000; + pub const SSL_OP_NO_DTLSv1_2: c_ulong = 0x80000000; + } +} #[cfg(ossl111)] pub const SSL_OP_NO_TLSv1_3: c_ulong = 0x20000000; diff --git a/openssl/build.rs b/openssl/build.rs index 9c8b7df078efc3bcadf8370e0591f28efd196900..03983bdb65f90eeea7dc0c4b5790285041da3eca 100644 --- a/openssl/build.rs +++ b/openssl/build.rs @@ -67,5 +67,9 @@ fn main() { if version >= 0x3_02_01_00_0 { println!("cargo:rustc-cfg=libressl321"); } + + if version >= 0x3_03_02_00_0 { + println!("cargo:rustc-cfg=libressl332"); + } } } diff --git a/openssl/src/lib.rs b/openssl/src/lib.rs index 20a137eab258c2c28738210c3cdfc964d6ad0d31..02d32e49bdbad3d25c6a80b3e9fe06006383b69b 100644 --- a/openssl/src/lib.rs +++ b/openssl/src/lib.rs @@ -1,7 +1,7 @@ //! Bindings to OpenSSL //! //! This crate provides a safe interface to the popular OpenSSL cryptography library. OpenSSL versions 1.0.1 through -//! 1.1.1 and LibreSSL versions 2.5 through 3.3.1 are supported. +//! 1.1.1 and LibreSSL versions 2.5 through 3.3.2 are supported. //! //! # Building //! diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 248d6d6533e47b83798ca9d4a17a207691089990..a0e5a97b99e4160b71f76d44be58ac661a240076 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -211,14 +211,14 @@ bitflags! { /// Disables the use of DTLSv1.0 /// - /// Requires OpenSSL 1.0.2 or newer. - #[cfg(any(ossl102, ossl110))] + /// Requires OpenSSL 1.0.2 or LibreSSL 3.3.2 or newer. + #[cfg(any(ossl102, ossl110, libressl332))] const NO_DTLSV1 = ffi::SSL_OP_NO_DTLSv1; /// Disables the use of DTLSv1.2. /// - /// Requires OpenSSL 1.0.2, or newer. - #[cfg(any(ossl102, ossl110))] + /// Requires OpenSSL 1.0.2 or LibreSSL 3.3.2 or newer. + #[cfg(any(ossl102, ossl110, libressl332))] const NO_DTLSV1_2 = ffi::SSL_OP_NO_DTLSv1_2; /// Disables the use of all (D)TLS protocol versions. diff --git a/openssl/src/ssl/test/mod.rs b/openssl/src/ssl/test/mod.rs index 8d350224133e20cd63b9d4aaf657aab403858f58..36db2b70e1726d6c36ce780fdb41eb883046d0de 100644 --- a/openssl/src/ssl/test/mod.rs +++ b/openssl/src/ssl/test/mod.rs @@ -306,7 +306,6 @@ fn state() { /// lists of supported protocols have an overlap -- with only ONE protocol /// being valid for both. #[test] -#[cfg_attr(libressl291, ignore)] fn test_connect_with_srtp_ctx() { let listener = TcpListener::bind("127.0.0.1:0").unwrap(); let addr = listener.local_addr().unwrap(); @@ -365,7 +364,6 @@ fn test_connect_with_srtp_ctx() { /// lists of supported protocols have an overlap -- with only ONE protocol /// being valid for both. #[test] -#[cfg_attr(libressl291, ignore)] fn test_connect_with_srtp_ssl() { let listener = TcpListener::bind("127.0.0.1:0").unwrap(); let addr = listener.local_addr().unwrap();