diff --git a/boring-sys/Cargo.toml b/boring-sys/Cargo.toml index 18efb17c..36327950 100644 --- a/boring-sys/Cargo.toml +++ b/boring-sys/Cargo.toml @@ -55,9 +55,6 @@ features = ["rpk", "pq-experimental", "underscore-wildcards"] rustdoc-args = ["--cfg", "docsrs"] [features] -default = ["ssl"] -ssl = [] - # Use a FIPS-validated version of boringssl. fips = [] diff --git a/boring-sys/build/config.rs b/boring-sys/build/config.rs index 33867a68..7af00f4b 100644 --- a/boring-sys/build/config.rs +++ b/boring-sys/build/config.rs @@ -20,7 +20,6 @@ pub(crate) struct Features { pub(crate) pq_experimental: bool, pub(crate) rpk: bool, pub(crate) underscore_wildcards: bool, - pub(crate) ssl: bool, } pub(crate) struct Env { @@ -111,7 +110,6 @@ impl Features { let pq_experimental = env::var_os("CARGO_FEATURE_PQ_EXPERIMENTAL").is_some(); let rpk = env::var_os("CARGO_FEATURE_RPK").is_some(); let underscore_wildcards = env::var_os("CARGO_FEATURE_UNDERSCORE_WILDCARDS").is_some(); - let ssl = env::var_os("CARGO_FEATURE_SSL").is_some(); Self { fips, @@ -119,7 +117,6 @@ impl Features { pq_experimental, rpk, underscore_wildcards, - ssl, } } } diff --git a/boring-sys/build/main.rs b/boring-sys/build/main.rs index 8c16ec2e..3ff818b3 100644 --- a/boring-sys/build/main.rs +++ b/boring-sys/build/main.rs @@ -587,9 +587,7 @@ fn built_boring_source_path(config: &Config) -> &PathBuf { cfg.define("FIPS", "1"); } - if config.features.ssl { - cfg.build_target("ssl").build(); - } + cfg.build_target("ssl").build(); cfg.build_target("crypto").build() }) } @@ -676,9 +674,7 @@ fn main() { } println!("cargo:rustc-link-lib=static=crypto"); - if config.features.ssl { - println!("cargo:rustc-link-lib=static=ssl"); - } + println!("cargo:rustc-link-lib=static=ssl"); let include_path = config.env.include_path.clone().unwrap_or_else(|| { if let Some(bssl_path) = &config.env.path { diff --git a/boring-sys/src/lib.rs b/boring-sys/src/lib.rs index 221e843c..b707ec0e 100644 --- a/boring-sys/src/lib.rs +++ b/boring-sys/src/lib.rs @@ -46,21 +46,18 @@ pub const fn ERR_GET_REASON(l: c_uint) -> c_int { } pub fn init() { - #[cfg(feature = "ssl")] - { - use std::ptr; - use std::sync::Once; + use std::ptr; + use std::sync::Once; - // explicitly initialize to work around https://github.com/openssl/openssl/issues/3505 - static INIT: Once = Once::new(); + // explicitly initialize to work around https://github.com/openssl/openssl/issues/3505 + static INIT: Once = Once::new(); - let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS; + let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS; - INIT.call_once(|| { - assert_eq!( - unsafe { OPENSSL_init_ssl(init_options.try_into().unwrap(), ptr::null_mut()) }, - 1 - ) - }); - } + INIT.call_once(|| { + assert_eq!( + unsafe { OPENSSL_init_ssl(init_options.try_into().unwrap(), ptr::null_mut()) }, + 1 + ) + }); } diff --git a/boring/Cargo.toml b/boring/Cargo.toml index 4fb7e3c8..96bfbc92 100644 --- a/boring/Cargo.toml +++ b/boring/Cargo.toml @@ -17,9 +17,6 @@ features = ["rpk", "pq-experimental", "underscore-wildcards"] rustdoc-args = ["--cfg", "docsrs"] [features] -default = ["ssl"] -ssl = ["boring-sys/ssl"] - # Controlling the build # Use a FIPS-validated version of boringssl. diff --git a/boring/src/dh.rs b/boring/src/dh.rs index 74f49b8b..96a8c63d 100644 --- a/boring/src/dh.rs +++ b/boring/src/dh.rs @@ -82,7 +82,6 @@ impl Dh { use crate::ffi::DH_set0_pqg; -#[cfg(feature = "ssl")] // Many of these tests use SslContext to verify the result. #[cfg(test)] mod tests { use crate::bn::BigNum; diff --git a/boring/src/lib.rs b/boring/src/lib.rs index 5c7d288b..6779586a 100644 --- a/boring/src/lib.rs +++ b/boring/src/lib.rs @@ -96,6 +96,10 @@ extern crate bitflags; #[macro_use] extern crate foreign_types; extern crate boring_sys as ffi; +extern crate libc; + +#[cfg(test)] +extern crate hex; #[doc(inline)] pub use crate::ffi::init; @@ -134,7 +138,6 @@ pub mod rsa; pub mod sha; pub mod sign; pub mod srtp; -#[cfg(feature = "ssl")] pub mod ssl; pub mod stack; pub mod string; diff --git a/boring/src/x509/mod.rs b/boring/src/x509/mod.rs index 91cb34c2..6e6b966c 100644 --- a/boring/src/x509/mod.rs +++ b/boring/src/x509/mod.rs @@ -34,7 +34,6 @@ use crate::ffi; use crate::hash::{DigestBytes, MessageDigest}; use crate::nid::Nid; use crate::pkey::{HasPrivate, HasPublic, PKey, PKeyRef, Public}; -#[cfg(feature = "ssl")] use crate::ssl::SslRef; use crate::stack::{Stack, StackRef, Stackable}; use crate::string::OpensslString; @@ -62,7 +61,6 @@ foreign_type_and_impl_send_sync! { impl X509StoreContext { /// Returns the index which can be used to obtain a reference to the `Ssl` associated with a /// context. - #[cfg(feature = "ssl")] #[corresponds(SSL_get_ex_data_X509_STORE_CTX_idx)] pub fn ssl_idx() -> Result, ErrorStack> { unsafe { cvt_n(ffi::SSL_get_ex_data_X509_STORE_CTX_idx()).map(|idx| Index::from_raw(idx)) }