[PR #2559] [MERGED] [PM-2531] Fix new cipher encryption on adding attachments on ciphers with no item level key #103847

Closed
opened 2026-06-03 05:33:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2559
Author: @fedemkr
Created: 6/6/2023
Status: Merged
Merged: 6/6/2023
Merged by: @fedemkr

Base: feature/PM-115-encryption-update-new-modelHead: PM-2531-fix-old-acc-attachment-cipher-adding-new-attachment


📝 Commits (1)

  • 047d622 PM-2531 Fix new cipher encryption on adding attachments on ciphers with no item level key

📊 Changes

1 file changed (+8 additions, -2 deletions)

View changed files

📝 src/Core/Services/CipherService.cs (+8 -2)

📄 Description

Type of change

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

Objective

Fix on ciphers with no key, adding a new attachment breaks the attachment.

Code changes

  • CipherService: Added new flag to prevent creating a new cipher item level key. This is needed because when creating a new attachment on ciphers without key, we can't add the key to the attachment given that they are saved independently, thus it will break the attachment. So, now the attachments are encrypted using the new cipher item level key only if the cipher already has the Key set.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2559 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 6/6/2023 **Status:** ✅ Merged **Merged:** 6/6/2023 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `feature/PM-115-encryption-update-new-model` ← **Head:** `PM-2531-fix-old-acc-attachment-cipher-adding-new-attachment` --- ### 📝 Commits (1) - [`047d622`](https://github.com/bitwarden/android/commit/047d6229256f3e8d30f09ce05078ef3daf18976f) PM-2531 Fix new cipher encryption on adding attachments on ciphers with no item level key ### 📊 Changes **1 file changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/Core/Services/CipherService.cs` (+8 -2) </details> ### 📄 Description ## Type of change - [X] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Fix on ciphers with no key, adding a new attachment breaks the attachment. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **CipherService:** Added new flag to prevent creating a new cipher item level key. This is needed because when creating a new attachment on ciphers without key, we can't add the key to the attachment given that they are saved independently, thus it will break the attachment. So, now the attachments are encrypted using the new cipher item level key only if the cipher already has the Key set. ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-03 05:33:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#103847