Browse Source

Allow Ed25519 and Ed448 only if supported

pull/53/head
Rodolphe Bréard 4 years ago
parent
commit
56dc42dc2f
  1. 9
      acme_common/build.rs

9
acme_common/build.rs

@ -6,15 +6,18 @@ macro_rules! set_rustc_env_var {
}}; }};
} }
#[allow(clippy::unusual_byte_groupings)]
fn main() { fn main() {
if env::var("DEP_OPENSSL_VERSION_NUMBER").is_ok() {
if let Ok(v) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
let version = u64::from_str_radix(&v, 16).unwrap();
// OpenSSL 1.1.1
if version >= 0x1_01_01_00_0 {
println!("cargo:rustc-cfg=ed25519"); println!("cargo:rustc-cfg=ed25519");
println!("cargo:rustc-cfg=ed448"); println!("cargo:rustc-cfg=ed448");
}
set_rustc_env_var!("ACMED_TLS_LIB_NAME", "OpenSSL"); set_rustc_env_var!("ACMED_TLS_LIB_NAME", "OpenSSL");
} }
if env::var("DEP_OPENSSL_LIBRESSL_VERSION_NUMBER").is_ok() { if env::var("DEP_OPENSSL_LIBRESSL_VERSION_NUMBER").is_ok() {
println!("cargo:rustc-cfg=ed25519");
println!("cargo:rustc-cfg=ed448");
set_rustc_env_var!("ACMED_TLS_LIB_NAME", "LibreSSL"); set_rustc_env_var!("ACMED_TLS_LIB_NAME", "LibreSSL");
} }
} }
Loading…
Cancel
Save