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

Closed
opened 2026-05-12 00:12:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2633
Author: @jlf0dev
Created: 7/20/2023
Status: Closed

Base: masterHead: auth/pm-2713/drop-master-key-dependency


📝 Commits (10+)

  • b5cf9fd [PM-2731] add user key and master key types
  • 15d3da6 [PM-2713] add new state for new keys and obsolete old ones
  • 079e02e [PM-271] add UserKey and MasterKey support to crypto service
  • c161953 [PM-2713] rename key hash to password hash & begin add methods to crypto service
  • 69d38d4 [PM-2713] continue organizing crypto service
  • bf28d37 [PM-2713] more updates to crypto service
  • 515decb [PM-2713] add new pin methods to state service
  • 1e30524 [PM-2713] fix signature of GetUserKeyPin
  • 5ba3fac [PM-2713] add make user key method to crypto service
  • d58f0b2 [PM-2713] refresh pin key when setting user key

📊 Changes

46 files changed (+1437 additions, -973 deletions)

View changed files

📝 src/Android/MainApplication.cs (+1 -1)
📝 src/Android/Services/BiometricService.cs (+6 -7)
📝 src/App/Pages/Accounts/LockPage.xaml (+2 -2)
📝 src/App/Pages/Accounts/LockPage.xaml.cs (+4 -4)
📝 src/App/Pages/Accounts/LockPageViewModel.cs (+81 -61)
📝 src/App/Pages/Accounts/RegisterPageViewModel.cs (+7 -7)
📝 src/App/Pages/Accounts/RemoveMasterPasswordPageViewModel.cs (+2 -2)
📝 src/App/Pages/Accounts/SetPasswordPageViewModel.cs (+16 -24)
📝 src/App/Pages/Accounts/UpdateTempPasswordPageViewModel.cs (+8 -8)
📝 src/App/Pages/Settings/ExportVaultPageViewModel.cs (+2 -2)
📝 src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs (+14 -13)
📝 src/App/Pages/TabsPage.cs (+1 -1)
📝 src/App/Pages/Vault/AttachmentsPageViewModel.cs (+1 -1)
📝 src/App/Pages/Vault/CipherAddEditPage.xaml.cs (+1 -1)
src/App/Services/BaseBiometricService.cs (+25 -0)
📝 src/App/Services/MobilePasswordRepromptService.cs (+1 -1)
📝 src/App/Utilities/AccountManagement/AccountsManager.cs (+1 -0)
📝 src/App/Utilities/VerificationActionsFlowHelper.cs (+2 -2)
📝 src/Core/Abstractions/IApiService.cs (+1 -1)
📝 src/Core/Abstractions/IBiometricService.cs (+1 -0)

...and 26 more files

📄 Description

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

🔄 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/2633 **Author:** [@jlf0dev](https://github.com/jlf0dev) **Created:** 7/20/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `auth/pm-2713/drop-master-key-dependency` --- ### 📝 Commits (10+) - [`b5cf9fd`](https://github.com/bitwarden/android/commit/b5cf9fd79d9d2dceb958f89a0304e9b5646cc819) [PM-2731] add user key and master key types - [`15d3da6`](https://github.com/bitwarden/android/commit/15d3da607bb6196741e9e8adb21e6bd5538ce91a) [PM-2713] add new state for new keys and obsolete old ones - [`079e02e`](https://github.com/bitwarden/android/commit/079e02e4e5cfc19dbb6abd23511264f4250e7691) [PM-271] add UserKey and MasterKey support to crypto service - [`c161953`](https://github.com/bitwarden/android/commit/c1619536aa6d9e434266c0af38ff1387344c3412) [PM-2713] rename key hash to password hash & begin add methods to crypto service - [`69d38d4`](https://github.com/bitwarden/android/commit/69d38d4d758cef16dc9660f8629c71fcfb2ce735) [PM-2713] continue organizing crypto service - [`bf28d37`](https://github.com/bitwarden/android/commit/bf28d373e95d5938eb7909fe8e90733a4791e16d) [PM-2713] more updates to crypto service - [`515decb`](https://github.com/bitwarden/android/commit/515decb4c9a2ea961a1da24d59d77ce2d35e502f) [PM-2713] add new pin methods to state service - [`1e30524`](https://github.com/bitwarden/android/commit/1e3052498573c599a806273a43d32c5a20ac84be) [PM-2713] fix signature of GetUserKeyPin - [`5ba3fac`](https://github.com/bitwarden/android/commit/5ba3fac0c0fb7d9563288fc690bc4bc517cd4d59) [PM-2713] add make user key method to crypto service - [`d58f0b2`](https://github.com/bitwarden/android/commit/d58f0b281b7b22533011129b8a2b26f1155ac485) [PM-2713] refresh pin key when setting user key ### 📊 Changes **46 files changed** (+1437 additions, -973 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/MainApplication.cs` (+1 -1) 📝 `src/Android/Services/BiometricService.cs` (+6 -7) 📝 `src/App/Pages/Accounts/LockPage.xaml` (+2 -2) 📝 `src/App/Pages/Accounts/LockPage.xaml.cs` (+4 -4) 📝 `src/App/Pages/Accounts/LockPageViewModel.cs` (+81 -61) 📝 `src/App/Pages/Accounts/RegisterPageViewModel.cs` (+7 -7) 📝 `src/App/Pages/Accounts/RemoveMasterPasswordPageViewModel.cs` (+2 -2) 📝 `src/App/Pages/Accounts/SetPasswordPageViewModel.cs` (+16 -24) 📝 `src/App/Pages/Accounts/UpdateTempPasswordPageViewModel.cs` (+8 -8) 📝 `src/App/Pages/Settings/ExportVaultPageViewModel.cs` (+2 -2) 📝 `src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs` (+14 -13) 📝 `src/App/Pages/TabsPage.cs` (+1 -1) 📝 `src/App/Pages/Vault/AttachmentsPageViewModel.cs` (+1 -1) 📝 `src/App/Pages/Vault/CipherAddEditPage.xaml.cs` (+1 -1) ➕ `src/App/Services/BaseBiometricService.cs` (+25 -0) 📝 `src/App/Services/MobilePasswordRepromptService.cs` (+1 -1) 📝 `src/App/Utilities/AccountManagement/AccountsManager.cs` (+1 -0) 📝 `src/App/Utilities/VerificationActionsFlowHelper.cs` (+2 -2) 📝 `src/Core/Abstractions/IApiService.cs` (+1 -1) 📝 `src/Core/Abstractions/IBiometricService.cs` (+1 -0) _...and 26 more files_ </details> ### 📄 Description ## 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 --- <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-05-12 00:12:32 -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#60963