Skip to content

Commit

Permalink
fix(cli): Downgrade minisign to 0.7.3 once again (#8838)
Browse files Browse the repository at this point in the history
* fix(cli): Downgrade minisign to 0.7.3 once again

* add tests

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
  • Loading branch information
FabianLars and lucasfernog authored Feb 16, 2024
1 parent e52d5e5 commit 052e8b4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/downgrade-minisign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-cli": patch:bug
"@tauri-apps/cli": patch:bug
---

Downgrade minisign dependency fixing updater signing key bug and prevent it from happening in the future.
4 changes: 2 additions & 2 deletions tooling/cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tooling/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ toml = "0.8"
jsonschema = "0.17"
handlebars = "5.0"
include_dir = "0.7"
minisign = "=0.7.5"
minisign = "=0.7.3"
base64 = "0.21.5"
ureq = { version = "2.8", default-features = false, features = [ "gzip" ] }
os_info = "3"
Expand Down
16 changes: 16 additions & 0 deletions tooling/cli/src/helpers/updater_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,19 @@ where
.map_err(|e| minisign::PError::new(minisign::ErrorKind::Io, e))?;
Ok(BufReader::new(file))
}

#[cfg(test)]
mod tests {
const PRIVATE_KEY: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5dkpDN09RZm5GeVAzc2RuYlNzWVVJelJRQnNIV2JUcGVXZUplWXZXYXpqUUFBQkFBQUFBQUFBQUFBQUlBQUFBQTZrN2RnWGh5dURxSzZiL1ZQSDdNcktiaHRxczQwMXdQelRHbjRNcGVlY1BLMTBxR2dpa3I3dDE1UTVDRDE4MXR4WlQwa1BQaXdxKy9UU2J2QmVSNXhOQWFDeG1GSVllbUNpTGJQRkhhTnROR3I5RmdUZi90OGtvaGhJS1ZTcjdZU0NyYzhQWlQ5cGM9Cg==";

// we use minisign=0.7.3 to prevent a breaking change
#[test]
fn empty_password_is_valid() {
let path = std::env::temp_dir().join("minisign-password-text.txt");
std::fs::write(&path, b"TAURI").expect("failed to write test file");

let secret_key =
super::secret_key(PRIVATE_KEY, Some("".into())).expect("failed to resolve secret key");
super::sign_file(&secret_key, &path).expect("failed to sign file");
}
}

0 comments on commit 052e8b4

Please sign in to comment.