Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
quexten committed Oct 28, 2024
1 parent 67eadb1 commit 78684b4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions crates/bitwarden-vault/src/cipher/ssh_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@ impl KeyEncryptable<SymmetricCryptoKey, SshKey> for SshKeyView {
impl KeyDecryptable<SymmetricCryptoKey, SshKeyView> for SshKey {
fn decrypt_with_key(&self, key: &SymmetricCryptoKey) -> Result<SshKeyView, CryptoError> {
Ok(SshKeyView {
private_key: Some(self.private_key.clone()).decrypt_with_key(key).ok().flatten().ok_or(CryptoError::MissingField("private_key"))?,
public_key: Some(self.public_key.clone()).decrypt_with_key(key).ok().flatten().ok_or(CryptoError::MissingField("public_key"))?,
fingerprint: Some(self.fingerprint.clone()).decrypt_with_key(key).ok().flatten().ok_or(CryptoError::MissingField("fingerprint"))?,
private_key: Some(self.private_key.clone())
.decrypt_with_key(key)
.ok()
.flatten()
.ok_or(CryptoError::MissingField("private_key"))?,
public_key: Some(self.public_key.clone())
.decrypt_with_key(key)
.ok()
.flatten()
.ok_or(CryptoError::MissingField("public_key"))?,
fingerprint: Some(self.fingerprint.clone())
.decrypt_with_key(key)
.ok()
.flatten()
.ok_or(CryptoError::MissingField("fingerprint"))?,
})
}
}

0 comments on commit 78684b4

Please sign in to comment.