Skip to content

fix(cli): harden updater key generation and signing - #16118

Merged
lucasfernog merged 3 commits into
devfrom
fix/cli-updater-key-file-permissions
Sep 25, 2026
Merged

lucasfernog merged 3 commits into
devfrom
fix/cli-updater-key-file-permissions

Conversation

@lucasfernog

Copy link
Copy Markdown
Member

No description provided.

@lucasfernog
lucasfernog requested a review from a team as a code owner September 23, 2026 17:13
Comment thread crates/tauri-cli/src/signer/sign.rs Outdated
Comment on lines +104 to +110
if std::io::stdin().is_terminal() {
println!("Decrypting private key, expect a prompt for password.");
} else {
// the password prompt needs a terminal, so assume the key has no password
println!("Signing without password.");
options.password.replace(String::new());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe we can move this to inside the secret_key function just before

  let sk = sk_box
    .into_secret_key(password)
    .context("incorrect updater private key password")?;

(for both here and the other calls)


// write both keys to temporary files first and then rename them over the destination,
// so a failure never leaves the existing key pair deleted or half written
let sk_file = write_temp_file(dir, key)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly can't see much value added here with writing to temp files first

@lucasfernog
lucasfernog merged commit ff7cd8d into dev Sep 25, 2026
21 checks passed
@lucasfernog
lucasfernog deleted the fix/cli-updater-key-file-permissions branch September 25, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants