[PR #5604] [MERGED] 🍒 [PM-24205] Fix Fido2CredentialStore to save new credentials correctly #5905

Closed
opened 2025-11-27 00:16:41 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/5604
Author: @SaintPatrck
Created: 7/28/2025
Status: Merged
Merged: 7/28/2025
Merged by: @SaintPatrck

Base: release/2025.07-rc25Head: cp-passkey-fix-to-release-2025.07-rc25


📝 Commits (1)

  • 3b80673 [PM-24205] Fix Fido2CredentialStore to save new credentials correctly (#5601)

📊 Changes

2 files changed (+20 additions, -11 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/di/VaultSdkModule.kt (+5 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/Fido2CredentialStoreImpl.kt (+15 -11)

📄 Description

🎟️ Tracking

PM-24205
Cherry-picking #5601

📔 Objective

Fixes a bug that failed to create a new login cipher for passkey registration. The patch refactors how Fido2CredentialStoreImpl save credentials to utilize VaultSdkSource for decrypting the Cipher before saving it. This change ensures that new ciphers are saved correctly.

Key changes:

  • Fido2CredentialStoreImpl now depends on AuthRepository and VaultSdkSource.
  • The saveCredential method in Fido2CredentialStoreImpl now uses vaultSdkSource.decryptCipher to decrypt the EncryptionContext.cipher before updating or creating the cipher in VaultRepository.
  • NoActiveUserException is thrown if there is no active user when attempting to decrypt.
  • The VaultSdkModule has been updated to provide the new dependencies to Fido2CredentialStoreImpl.

📸 Screenshots

https://github.com/user-attachments/assets/bf7ce3bd-d33c-472e-965f-2b8cebff7e34

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

  • 👍 (:+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

🔄 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/5604 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 7/28/2025 **Status:** ✅ Merged **Merged:** 7/28/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `release/2025.07-rc25` ← **Head:** `cp-passkey-fix-to-release-2025.07-rc25` --- ### 📝 Commits (1) - [`3b80673`](https://github.com/bitwarden/android/commit/3b806736f6e6e438cbc7446e518c91a3ecb30856) [PM-24205] Fix Fido2CredentialStore to save new credentials correctly (#5601) ### 📊 Changes **2 files changed** (+20 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/di/VaultSdkModule.kt` (+5 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/Fido2CredentialStoreImpl.kt` (+15 -11) </details> ### 📄 Description ## 🎟️ Tracking PM-24205 Cherry-picking #5601 ## 📔 Objective Fixes a bug that failed to create a new login cipher for passkey registration. The patch refactors how `Fido2CredentialStoreImpl` save credentials to utilize `VaultSdkSource` for decrypting the `Cipher` before saving it. This change ensures that new ciphers are saved correctly. Key changes: - `Fido2CredentialStoreImpl` now depends on `AuthRepository` and `VaultSdkSource`. - The `saveCredential` method in `Fido2CredentialStoreImpl` now uses `vaultSdkSource.decryptCipher` to decrypt the `EncryptionContext.cipher` before updating or creating the cipher in `VaultRepository`. - `NoActiveUserException` is thrown if there is no active user when attempting to decrypt. - The `VaultSdkModule` has been updated to provide the new dependencies to `Fido2CredentialStoreImpl`. ## 📸 Screenshots https://github.com/user-attachments/assets/bf7ce3bd-d33c-472e-965f-2b8cebff7e34 ## ⏰ 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 --- <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 2025-11-27 00:16:41 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5905