-
Notifications
You must be signed in to change notification settings - Fork 865
[PM-21782] Pass encryptedFor
to cipher functions
#5297
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Great job, no security vulnerabilities found in this Pull Request |
c3ba66a
to
1e4e784
Compare
1e4e784
to
ce5501d
Compare
app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt
Show resolved
Hide resolved
david-livefront
previously approved these changes
Jun 2, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5297 +/- ##
=======================================
Coverage 82.80% 82.81%
=======================================
Files 678 678
Lines 50889 50905 +16
Branches 6924 6924
=======================================
+ Hits 42141 42157 +16
Misses 6433 6433
Partials 2315 2315 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ce5501d
to
eefd795
Compare
This commit updates several functions to accept an `encryptedFor` parameter, which specifies the user ID for whom the cipher is encrypted. This property is used by the server to verify the cipher is encrypted by the correct user. If verification fails the server responds with an appropriate error message. This change affects the following: - `toEncryptedNetworkCipher` and `toEncryptedNetworkCipherResponse` extension functions for `Cipher` now require an `encryptedFor` parameter. - `CipherJsonRequest` and `SyncResponseJson.Cipher` now include an `encryptedFor` field. - SDK functions like `encryptCipher` and `decryptFile` have been updated to align with these changes. Additionally, this update includes the following SDK related changes: - Adding the `encryptedFor` related logic (bitwarden/sdk-internal#278) - Update in protocol and objects naming to have ``{foo}Client[Protocol]`` instead of `Client{foo}[Protocol]` (bitwarden/sdk-internal#224) - Update attachments decryption to use `AttachmentView` instead of `Attachment` (bitwarden/sdk-internal#255)
eefd795
to
bf0307b
Compare
david-livefront
approved these changes
Jun 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
PM-21782
Relates to bitwarden/ios#1604
Relates to bitwarden/server#5838
📔 Objective
This commit updates several functions to accept an
encryptedFor
parameter, which specifies the user ID for whom the cipher is encrypted. This property is used by the server to verify the cipher is encrypted by the correct user. If verification fails the server responds with an appropriate error message.This change affects the following:
toEncryptedNetworkCipher
andtoEncryptedNetworkCipherResponse
extension functions forCipher
now require anencryptedFor
parameter.CipherJsonRequest
andSyncResponseJson.Cipher
now include anencryptedFor
field.encryptCipher
anddecryptFile
have been updated to align with these changes.Additionally, this update includes the following SDK related changes:
encryptedFor
related logic (Add-userid-to-encryption-methods sdk-internal#278){foo}Client[Protocol]
instead ofClient{foo}[Protocol]
(Rename all clients to follow Domain Client sdk-internal#224)AttachmentView
instead ofAttachment
(Accept AttachmentView in AttachmentFile sdk-internal#255)📸 Screenshots
Error message when server verification fails

⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes