Fix feature gates for fips-link-precompiled
This commit is contained in:
parent
abfe2f7980
commit
7fd29555b6
|
|
@ -452,8 +452,6 @@ fn ensure_patches_applied() -> io::Result<()> {
|
||||||
|
|
||||||
// NOTE: init git in the copied files, so we can apply patches
|
// NOTE: init git in the copied files, so we can apply patches
|
||||||
if !has_git {
|
if !has_git {
|
||||||
println!("cargo:warning=initing git in boringssl sources to apply patches");
|
|
||||||
|
|
||||||
run_command(Command::new("git").args(["init"]).current_dir(&src_path))?;
|
run_command(Command::new("git").args(["init"]).current_dir(&src_path))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -581,6 +579,10 @@ fn link_in_precompiled_bcm_o(bssl_dir: &str) {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("cargo:rerun-if-env-changed=BORING_BSSL_PATH");
|
println!("cargo:rerun-if-env-changed=BORING_BSSL_PATH");
|
||||||
|
println!("cargo:rerun-if-env-changed=BORING_BSSL_INCLUDE_PATH");
|
||||||
|
println!("cargo:rerun-if-env-changed=BORING_BSSL_SOURCE_PATH");
|
||||||
|
println!("cargo:rerun-if-env-changed=BORING_SSL_PRECOMPILED_BCM_O");
|
||||||
|
println!("cargo:rerun-if-env-changed=BORINGSSL_BUILD_DIR");
|
||||||
|
|
||||||
#[cfg(all(feature = "fips", feature = "rpk"))]
|
#[cfg(all(feature = "fips", feature = "rpk"))]
|
||||||
compile_error!("`fips` and `rpk` features are mutually exclusive");
|
compile_error!("`fips` and `rpk` features are mutually exclusive");
|
||||||
|
|
@ -622,10 +624,14 @@ fn main() {
|
||||||
println!("cargo:rustc-link-lib=static=crypto");
|
println!("cargo:rustc-link-lib=static=crypto");
|
||||||
println!("cargo:rustc-link-lib=static=ssl");
|
println!("cargo:rustc-link-lib=static=ssl");
|
||||||
|
|
||||||
println!("cargo:rerun-if-env-changed=BORING_BSSL_INCLUDE_PATH");
|
|
||||||
let include_path = env::var("BORING_BSSL_INCLUDE_PATH").unwrap_or_else(|_| {
|
let include_path = env::var("BORING_BSSL_INCLUDE_PATH").unwrap_or_else(|_| {
|
||||||
let src_path = get_boringssl_source_path();
|
let src_path = get_boringssl_source_path();
|
||||||
if cfg!(feature = "fips") {
|
|
||||||
|
if Path::new(&src_path)
|
||||||
|
.join("include")
|
||||||
|
.join("x509v3.h")
|
||||||
|
.exists()
|
||||||
|
{
|
||||||
format!("{}/include", &src_path)
|
format!("{}/include", &src_path)
|
||||||
} else {
|
} else {
|
||||||
format!("{}/src/include", &src_path)
|
format!("{}/src/include", &src_path)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||||
fips = ["boring-sys/fips"]
|
fips = ["boring-sys/fips"]
|
||||||
|
|
||||||
# Link with precompiled FIPS-validated `bcm.o` module.
|
# Link with precompiled FIPS-validated `bcm.o` module.
|
||||||
fips-link-precompiled = ["fips"]
|
fips-link-precompiled = ["fips", "boring-sys/fips-link-precompiled"]
|
||||||
|
|
||||||
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
|
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
|
||||||
rpk = ["boring-sys/rpk"]
|
rpk = ["boring-sys/rpk"]
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ runtime = ["hyper/runtime"]
|
||||||
fips = ["tokio-boring/fips"]
|
fips = ["tokio-boring/fips"]
|
||||||
|
|
||||||
# Link with precompiled FIPS-validated `bcm.o` module.
|
# Link with precompiled FIPS-validated `bcm.o` module.
|
||||||
fips-link-precompiled = ["fips"]
|
fips-link-precompiled = ["fips", "tokio-boring/fips-link-precompiled"]
|
||||||
|
|
||||||
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
|
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
|
||||||
rpk = ["tokio-boring/rpk"]
|
rpk = ["tokio-boring/rpk"]
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# Use a FIPS-validated version of boringssl.
|
# Use a FIPS-validated version of boringssl.
|
||||||
fips = ["boring/fips"]
|
fips = ["boring/fips", "boring-sys/fips"]
|
||||||
|
|
||||||
# Link with precompiled FIPS-validated `bcm.o` module.
|
# Link with precompiled FIPS-validated `bcm.o` module.
|
||||||
fips-link-precompiled = ["fips"]
|
fips-link-precompiled = ["fips", "boring/fips-link-precompiled", "boring-sys/fips-link-precompiled"]
|
||||||
|
|
||||||
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
|
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
|
||||||
rpk = ["boring/rpk"]
|
rpk = ["boring/rpk"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue