Skip to content

Commit

Permalink
Remove unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
quexten committed Dec 16, 2024
1 parent b2b9740 commit 799bc00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bitwarden-ssh/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ fn import_pkcs8_key(
let private_key = ssh_key::private::PrivateKey::from(Ed25519Keypair::from(
&private_key.secret_key.into(),
));
let private_key_openssh = private_key
.to_openssh(LineEnding::LF)
.map_err(|_| SshKeyImportError::ParsingError)?;
Ok(SshKey {
private_key: private_key.to_openssh(LineEnding::LF).unwrap().to_string(),
private_key: private_key_openssh.to_string(),
public_key: private_key.public_key().to_string(),
key_fingerprint: private_key.fingerprint(HashAlg::Sha256).to_string(),
})
Expand Down

0 comments on commit 799bc00

Please sign in to comment.