[PR #2633] Auth/pm 2713/drop master key dependency #3695

Closed
opened 2025-11-26 23:36:13 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/2633

State: closed
Merged: No


Type of change

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

Objective

See bitwarden/clients#5498 for motivation and background.
TDLR: We need to drop our dependency on always having a MasterKey present in our application in order to support various other authentication/decryption combinations.

This version is slightly less complex than the Clients PR due to the lack of a BiometricKey and AutoKey. The only key that needed migration from an encrypted state was the Pin key, both the MP on Reset enabled version and the disabled version.

Due to the change of how we handle the UserKey, I've also changed the logic to always set the encrypted version in storage. Previously this was only set when Vault Timeout was set to 'never' or we had biometrics set up. We will always need the encrypted version in storage so that when we unlock, we will have something to decrypt with the Master Password.

Various other changes mirror the clients repo:

  • full refactor of CryptoService
  • new classes for different keys (I think we're going to consider changing this to an enum later)
  • more descriptive names for methods and keys

Code changes

  • file.ext: Description of what was changed and why

Screenshots

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
**Original Pull Request:** https://github.com/bitwarden/android/pull/2633 **State:** closed **Merged:** No --- ## Type of change - [ ] Bug fix - [x] 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--> See bitwarden/clients#5498 for motivation and background. TDLR: We need to drop our dependency on always having a `MasterKey` present in our application in order to support various other authentication/decryption combinations. This version is slightly less complex than the Clients PR due to the lack of a `BiometricKey` and `AutoKey`. The only key that needed migration from an encrypted state was the Pin key, both the MP on Reset enabled version and the disabled version. Due to the change of how we handle the `UserKey`, I've also changed the logic to always set the encrypted version in storage. Previously this was only set when Vault Timeout was set to 'never' or we had biometrics set up. We will always need the encrypted version in storage so that when we unlock, we will have something to decrypt with the Master Password. Various other changes mirror the clients repo: - full refactor of CryptoService - new classes for different keys (I think we're going to consider changing this to an enum later) - more descriptive names for methods and keys ## 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--> * **file.ext:** Description of what was changed and why ## Screenshots <!--Required for any UI changes. Delete if not applicable--> ## 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
GiteaMirror added the pull-request label 2025-11-26 23:36:13 -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#3695