Skip to content

Commit

Permalink
cargo build updates
Browse files Browse the repository at this point in the history
Signed-off-by: Firas Ghanmi <[email protected]>
  • Loading branch information
fghanmi committed Sep 5, 2024
1 parent daf84a1 commit 8ac7468
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
8 changes: 3 additions & 5 deletions tough/src/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,9 @@ pub fn decrypt_key(
let decrypted_private_key_document =
encrypted_private_key_document.decrypt(password.as_bytes())?;
let decrypted_key_bytes: Vec<u8> = decrypted_private_key_document.as_ref().to_vec();
let decrypted_key_base64 = STANDARD.encode(&decrypted_key_bytes);
let pem_key = format!(
"-----BEGIN PRIVATE KEY-----\n{}\n-----END PRIVATE KEY-----",
decrypted_key_base64
);
let decrypted_key_base64 = STANDARD.encode(decrypted_key_bytes);
let pem_key =
format!("-----BEGIN PRIVATE KEY-----\n{decrypted_key_base64}\n-----END PRIVATE KEY-----");
let pem_key_bytes = pem_key.as_bytes().to_vec();
Ok(pem_key_bytes)
}
Expand Down
2 changes: 1 addition & 1 deletion tuftool/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ pub(crate) enum Error {
source: tokio::task::JoinError,
backtrace: Backtrace,
},

#[snafu(display("More passwords provided than key sources"))]
MorePasswords { backtrace: Backtrace },

Expand Down
5 changes: 1 addition & 4 deletions tuftool/src/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@ impl Command {
} => {
let mut keys = Vec::new();
let default_password = String::new();
let passwords = match passwords {
Some(pws) => pws,
None => vec![],
};
let passwords = passwords.unwrap_or_default();
if passwords.len() > key_sources.len() {
error::MorePasswordsSnafu.fail()?;
}
Expand Down

0 comments on commit 8ac7468

Please sign in to comment.