Skip to content

Commit 212e190

Browse files
authored
[PM-23638] Fix URI checksums not being generated when cipherkey is not present (#347)
## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-23638 ## 📔 Objective While we only enforce decrypting correct checksums when a cipherkey is present for that cipher, we must always upgrade to url checksums for newly encrypted ciphers, regardless of whether the cipherkey is present or not. This is the case on Typescript (https://github.com/bitwarden/clients/blob/682f1f83d9c211e886d6f05fc557eddb25c4c5c2/libs/common/src/vault/services/cipher.service.ts#L1660). This allows us to enforce the presence of icon URLs after users went through the key-rotation for v2 encryption based on the account security version *instead of* being based on cipherkeys. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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
1 parent 81493f3 commit 212e190

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

crates/bitwarden-vault/src/cipher/cipher.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,7 @@ impl CompositeEncryptable<KeyIds, SymmetricKeyId, Cipher> for CipherView {
296296
let ciphers_key = Cipher::decrypt_cipher_key(ctx, key, &self.key)?;
297297

298298
let mut cipher_view = self.clone();
299-
300-
// For compatibility reasons, we only create checksums for ciphers that have a key
301-
if cipher_view.key.is_some() {
302-
cipher_view.generate_checksums();
303-
}
299+
cipher_view.generate_checksums();
304300

305301
Ok(Cipher {
306302
id: cipher_view.id,

0 commit comments

Comments
 (0)