Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-5348] Encrypt/decrypt attachment files #490

Merged
merged 12 commits into from
Jan 18, 2024

Conversation

dani-garcia
Copy link
Member

Type of change

- [ ] Bug fix
- [x] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Add encryption/decryption support for attachment files

Copy link

codecov bot commented Jan 9, 2024

Codecov Report

Attention: 159 lines in your changes are missing coverage. Please review.

Comparison is base (c1badb7) 50.47% compared to head (7d61bc6) 50.01%.
Report is 3 commits behind head on main.

Files Patch % Lines
crates/bitwarden-uniffi/src/vault/attachments.rs 0.00% 78 Missing ⚠️
...s/bitwarden/src/mobile/vault/client_attachments.rs 0.00% 60 Missing ⚠️
crates/bitwarden/src/vault/cipher/attachment.rs 78.31% 18 Missing ⚠️
crates/bitwarden-uniffi/src/vault/mod.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #490      +/-   ##
==========================================
- Coverage   50.47%   50.01%   -0.47%     
==========================================
  Files         157      159       +2     
  Lines        7564     7788     +224     
==========================================
+ Hits         3818     3895      +77     
- Misses       3746     3893     +147     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dani-garcia dani-garcia changed the title Encrypt/decrypt attachment files [PM-5348] Encrypt/decrypt attachment files Jan 10, 2024
@dani-garcia dani-garcia marked this pull request as ready for review January 10, 2024 15:22
@dani-garcia dani-garcia requested a review from Hinton January 10, 2024 15:24
Copy link
Member

@Hinton Hinton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can better encapsulate the attachment key.

crates/bitwarden/src/vault/cipher/cipher.rs Outdated Show resolved Hide resolved
crates/bitwarden/src/vault/cipher/attachment.rs Outdated Show resolved Hide resolved
Copy link
Member

@Hinton Hinton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're missing the use case of creating an attachment. Which also involves creating the key.

I think what we want is a way to create a new attachment which also creates a key. And a way to decrypt existing attachments. There should be no need to use an existing key to encrypt again.

crates/bitwarden/src/vault/cipher/attachment.rs Outdated Show resolved Hide resolved
@dani-garcia dani-garcia requested a review from Hinton January 18, 2024 10:40
Hinton
Hinton previously approved these changes Jan 18, 2024
crates/bitwarden/src/mobile/vault/client_attachments.rs Outdated Show resolved Hide resolved
@dani-garcia dani-garcia merged commit d70deac into main Jan 18, 2024
44 of 45 checks passed
@dani-garcia dani-garcia deleted the ps/attachment-encrypt-decrypt branch January 18, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants