Skip to content

Commit

Permalink
CVPN-1554 Update WolfSSL build config w/o liboqs
Browse files Browse the repository at this point in the history
Remove liboqs and enable WolfSSL's own Kyber implementation via the flags.
See: wolfSSL/wolfssl#8183
  • Loading branch information
kp-thomas-yau committed Nov 15, 2024
1 parent f86b090 commit 94743cd
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions wolfssl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn build_wolfssl(wolfssl_src: &Path) -> PathBuf {
.enable("supportedcurves", None)
// Enable TLS/1.3
.enable("tls13", None)
// Enable liboqs, etc
// Enable kyber, etc
.enable("experimental", None)
// CFLAGS
.cflag("-g")
Expand All @@ -137,21 +137,10 @@ fn build_wolfssl(wolfssl_src: &Path) -> PathBuf {
}

if cfg!(feature = "postquantum") {
// Post Quantum support is provided by liboqs
if let Some(include) = std::env::var_os("DEP_OQS_ROOT") {
let oqs_path = Path::new(&include);
conf.cflag(format!(
"-I{}",
oqs_path.join("build/include/").to_str().unwrap()
));
conf.ldflag(format!(
"-L{}",
oqs_path.join("build/lib/").to_str().unwrap()
));
conf.with("liboqs", None);
} else {
panic!("Post Quantum requested but liboqs appears to be missing?");
}
// Enable Kyber
conf.enable("kyber", Some("all,original"))
// SHA3 is needed for using WolfSSL's implementation of Kyber/ML-KEM
.enable("sha3", None);
}

match build_target::target_arch().unwrap() {
Expand Down Expand Up @@ -291,10 +280,6 @@ fn main() -> std::io::Result<()> {
// Tell cargo to tell rustc to link in WolfSSL
println!("cargo:rustc-link-lib=static=wolfssl");

if cfg!(feature = "postquantum") {
println!("cargo:rustc-link-lib=static=oqs");
}

println!(
"cargo:rustc-link-search=native={}",
wolfssl_install_dir.join("lib").to_str().unwrap()
Expand Down

0 comments on commit 94743cd

Please sign in to comment.