Skip to content

Commit

Permalink
Undo cipher decrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Oct 20, 2023
1 parent 5a65e96 commit eb1b80d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions crates/bitwarden/src/vault/cipher/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,29 +164,28 @@ impl Encryptable<Cipher> for CipherView {

impl Decryptable<CipherView> for Cipher {
fn decrypt(&self, enc: &EncryptionSettings, _: &Option<Uuid>) -> Result<CipherView> {
debug!("{:?}", self);
let org_id = &self.organization_id;
Ok(CipherView {
id: self.id,
organization_id: self.organization_id,
folder_id: self.folder_id,
collection_ids: self.collection_ids.clone(),
name: self.name.decrypt(enc, org_id).unwrap(),
notes: self.notes.decrypt(enc, org_id).unwrap(),
name: self.name.decrypt(enc, org_id)?,
notes: self.notes.decrypt(enc, org_id)?,
r#type: self.r#type,
login: self.login.decrypt(enc, org_id).unwrap(),
identity: self.identity.decrypt(enc, org_id).unwrap(),
card: self.card.decrypt(enc, org_id).unwrap(),
secure_note: self.secure_note.decrypt(enc, org_id).unwrap(),
login: self.login.decrypt(enc, org_id)?,
identity: self.identity.decrypt(enc, org_id)?,
card: self.card.decrypt(enc, org_id)?,
secure_note: self.secure_note.decrypt(enc, org_id)?,
favorite: self.favorite,
reprompt: self.reprompt,
organization_use_totp: self.organization_use_totp,
edit: self.edit,
view_password: self.view_password,
local_data: self.local_data.decrypt(enc, org_id).unwrap(),
attachments: self.attachments.decrypt(enc, org_id).unwrap(),
fields: self.fields.decrypt(enc, org_id).unwrap(),
password_history: self.password_history.decrypt(enc, org_id).unwrap(),
local_data: self.local_data.decrypt(enc, org_id)?,
attachments: self.attachments.decrypt(enc, org_id)?,
fields: self.fields.decrypt(enc, org_id)?,
password_history: self.password_history.decrypt(enc, org_id)?,
creation_date: self.creation_date,
deleted_date: self.deleted_date,
revision_date: self.revision_date,
Expand Down

0 comments on commit eb1b80d

Please sign in to comment.