lanzatool: remove Path -> String conversions in signature module

This commit is contained in:
Julian Stecklina 2022-12-28 23:49:45 +01:00
parent 74afcb1eea
commit b762de9fec
1 changed files with 9 additions and 10 deletions

View File

@ -1,10 +1,9 @@
use std::ffi::OsString;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;
use anyhow::Result; use anyhow::Result;
use crate::utils;
pub struct KeyPair { pub struct KeyPair {
pub private_key: PathBuf, pub private_key: PathBuf,
pub public_key: PathBuf, pub public_key: PathBuf,
@ -19,14 +18,14 @@ impl KeyPair {
} }
pub fn sign_and_copy(&self, from: &Path, to: &Path) -> Result<()> { pub fn sign_and_copy(&self, from: &Path, to: &Path) -> Result<()> {
let args = vec![ let args: Vec<OsString> = vec![
String::from("--key"), OsString::from("--key"),
utils::path_to_string(&self.private_key), self.private_key.clone().into(),
String::from("--cert"), OsString::from("--cert"),
utils::path_to_string(&self.public_key), self.public_key.clone().into(),
utils::path_to_string(from), from.as_os_str().to_owned(),
String::from("--output"), OsString::from("--output"),
utils::path_to_string(to), to.as_os_str().to_owned(),
]; ];
let output = Command::new("sbsign").args(&args).output()?; let output = Command::new("sbsign").args(&args).output()?;