Skip to content

Commit

Permalink
Update crates/bitwarden-vault/src/cipher/ssh_key.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
  • Loading branch information
quexten and dani-garcia authored Oct 29, 2024
1 parent 6fceec3 commit 9e7b0c6
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions crates/bitwarden-vault/src/cipher/ssh_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,9 @@ 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: self.private_key.decrypt_with_key(key)?,
public_key: self.public_key.decrypt_with_key(key)?,
fingerprint: self.fingerprint.decrypt_with_key(key)?,

Check warning on line 46 in crates/bitwarden-vault/src/cipher/ssh_key.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-vault/src/cipher/ssh_key.rs#L44-L46

Added lines #L44 - L46 were not covered by tests
})
}
}

0 comments on commit 9e7b0c6

Please sign in to comment.