Skip to content

Commit d88b9de

Browse files
authored
feat(core): add fips_compliant wix config option, closes #4541 (#4843)
1 parent 1caf485 commit d88b9de

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

.changes/fips-compliant-env-var.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"cli.rs": patch
3+
"cli.js": patch
4+
---
5+
6+
Enable WiX FIPS compliance when the `TAURI_FIPS_COMPLIANT` environment variable is set to `true`.

.changes/fips-compliant.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": patch
3+
---
4+
5+
Add `fips_compliant` configuration option for WiX.

tooling/bundler/src/bundle/settings.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ pub struct WixSettings {
237237
238238
/// The required dimensions are 493px × 312px.
239239
pub dialog_image_path: Option<PathBuf>,
240+
/// Enables FIPS compliant algorithms.
241+
pub fips_compliant: bool,
240242
}
241243

242244
/// The Windows bundle settings.

tooling/bundler/src/bundle/windows/msi/wix.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ fn run_candle(
305305
.find(|bin| bin.main())
306306
.ok_or_else(|| anyhow::anyhow!("Failed to get main binary"))?;
307307

308-
let args = vec![
308+
let mut args = vec![
309309
"-arch".to_string(),
310310
arch.to_string(),
311311
wxs_file_path.to_string_lossy().to_string(),
@@ -315,6 +315,16 @@ fn run_candle(
315315
),
316316
];
317317

318+
if settings
319+
.windows()
320+
.wix
321+
.as_ref()
322+
.map(|w| w.fips_compliant)
323+
.unwrap_or_default()
324+
{
325+
args.push("-fips".into());
326+
}
327+
318328
let candle_exe = wix_toolset_path.join("candle.exe");
319329

320330
info!(action = "Running"; "candle for {:?}", wxs_file_path);

tooling/cli/src/helpers/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub use tauri_utils::config::*;
1111

1212
use std::{
1313
collections::HashMap,
14-
env::set_var,
14+
env::{set_var, var_os},
1515
ffi::OsStr,
1616
process::exit,
1717
sync::{Arc, Mutex},
@@ -92,6 +92,7 @@ pub fn wix_settings(config: WixConfig) -> tauri_bundler::WixSettings {
9292
enable_elevated_update_task: config.enable_elevated_update_task,
9393
banner_path: config.banner_path,
9494
dialog_image_path: config.dialog_image_path,
95+
fips_compliant: var_os("TAURI_FIPS_COMPLIANT").map_or(false, |v| v == "true"),
9596
}
9697
}
9798

0 commit comments

Comments
 (0)