Skip to content

Commit

Permalink
Revert 12d00aa
Browse files Browse the repository at this point in the history
This reverts commit 12d00aa.

We do not use this flag, so revert this commit to get back closer to upstream.
  • Loading branch information
andrew-signal committed Dec 4, 2024
1 parent f7b6f5d commit 1af143f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 33 deletions.
3 changes: 0 additions & 3 deletions boring-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down
3 changes: 0 additions & 3 deletions boring-sys/build/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -111,15 +110,13 @@ 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,
fips_link_precompiled,
pq_experimental,
rpk,
underscore_wildcards,
ssl,
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions boring-sys/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
}
Expand Down Expand Up @@ -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 {
Expand Down
25 changes: 11 additions & 14 deletions boring-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
});
}
3 changes: 0 additions & 3 deletions boring/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion boring/src/dh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ impl Dh<Params> {

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;
Expand Down
5 changes: 4 additions & 1 deletion boring/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions boring/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Index<X509StoreContext, SslRef>, ErrorStack> {
unsafe { cvt_n(ffi::SSL_get_ex_data_X509_STORE_CTX_idx()).map(|idx| Index::from_raw(idx)) }
Expand Down

0 comments on commit 1af143f

Please sign in to comment.