[PR #6024] [MERGED] [PM-23290] Migrate PIN unlock keys to PinProtectedUserKeyEnvelope #36747

Closed
opened 2026-04-21 03:53:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6024
Author: @andrebispo5
Created: 10/14/2025
Status: Merged
Merged: 10/20/2025
Merged by: @andrebispo5

Base: mainHead: pm-23290/migrate-pinprotecteduserkey


📝 Commits (10+)

  • b2e1dd1 [PM-23290] Add pinProtectedUserKeyEnvelope to AuthDiskSource.
  • 1d56f8b [PM-23290] Replace derive pin sdk calls to new enroll pin
  • fc0be54 [PM-23290] Use new PinEnvelope to unlock if available and maintain legacy support.
  • d51913d [PM-23290] Replace derivePin with enrollPin when setting up pin.
  • b26e13b [PM-23290] Change references of pinProtectedUserKey to pinProtectedUserKeyEnvelope
  • aea176a [PM-23290] Migrate user Pin on vault unlock.
  • 14f0546 Merge branch 'main' into pm-23290/migrate-pinprotecteduserkey
  • 6db2a1c [PM-23290] Update tests
  • 32260cb [PM-23290] Add PR suggestions.
  • 5a4538f [PM-23290] Fix storePinProtectedUserKey inMemoryOnly assignment.

📊 Changes

19 files changed (+645 additions, -137 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSource.kt (+34 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceImpl.kt (+47 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/UserLogoutManagerImpl.kt (+4 -3)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/UserStateManagerImpl.kt (+1 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt (+3 -3)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryImpl.kt (+22 -7)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSource.kt (+10 -14)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceImpl.kt (+7 -7)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt (+34 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt (+45 -16)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceTest.kt (+58 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/util/FakeAuthDiskSource.kt (+55 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/UserLogoutManagerTest.kt (+18 -12)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/UserStateManagerTest.kt (+8 -8)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt (+6 -6)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryTest.kt (+29 -29)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceTest.kt (+11 -11)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt (+129 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryTest.kt (+124 -20)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-23290

📔 Objective

Migrates any existing pin keys to a pin protected user key envelope. Existing pins will be migrated when the vault is unlocked. And any new pins will use a pin protected user key envelope on creation.

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/6024 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 10/14/2025 **Status:** ✅ Merged **Merged:** 10/20/2025 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `main` ← **Head:** `pm-23290/migrate-pinprotecteduserkey` --- ### 📝 Commits (10+) - [`b2e1dd1`](https://github.com/bitwarden/android/commit/b2e1dd126145c93c263a902cb87bbba44b963883) [PM-23290] Add pinProtectedUserKeyEnvelope to AuthDiskSource. - [`1d56f8b`](https://github.com/bitwarden/android/commit/1d56f8b0d83bce9cd641c9fa37bf330814d35ca4) [PM-23290] Replace derive pin sdk calls to new enroll pin - [`fc0be54`](https://github.com/bitwarden/android/commit/fc0be54a241072d08fab20589233bd11fff675c4) [PM-23290] Use new PinEnvelope to unlock if available and maintain legacy support. - [`d51913d`](https://github.com/bitwarden/android/commit/d51913d617c094838ac38499480b5f6b54639ad2) [PM-23290] Replace derivePin with enrollPin when setting up pin. - [`b26e13b`](https://github.com/bitwarden/android/commit/b26e13befa8472bf3a8c5488fead01a432d416db) [PM-23290] Change references of pinProtectedUserKey to pinProtectedUserKeyEnvelope - [`aea176a`](https://github.com/bitwarden/android/commit/aea176a819bd40ffefceec59a30f80cf67ba543d) [PM-23290] Migrate user Pin on vault unlock. - [`14f0546`](https://github.com/bitwarden/android/commit/14f05468c6dc187442da6bc95708a2a099103093) Merge branch 'main' into pm-23290/migrate-pinprotecteduserkey - [`6db2a1c`](https://github.com/bitwarden/android/commit/6db2a1cd5cb175ce5db48962dc0b5be777614f95) [PM-23290] Update tests - [`32260cb`](https://github.com/bitwarden/android/commit/32260cbeac9cb28591ca539a7d6d69def1d93c12) [PM-23290] Add PR suggestions. - [`5a4538f`](https://github.com/bitwarden/android/commit/5a4538f5e55c76f52f3a8f36dd549b8e0ccf3671) [PM-23290] Fix storePinProtectedUserKey inMemoryOnly assignment. ### 📊 Changes **19 files changed** (+645 additions, -137 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSource.kt` (+34 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceImpl.kt` (+47 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/UserLogoutManagerImpl.kt` (+4 -3) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/UserStateManagerImpl.kt` (+1 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt` (+3 -3) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryImpl.kt` (+22 -7) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSource.kt` (+10 -14) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceImpl.kt` (+7 -7) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt` (+34 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt` (+45 -16) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceTest.kt` (+58 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/datasource/disk/util/FakeAuthDiskSource.kt` (+55 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/UserLogoutManagerTest.kt` (+18 -12) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/UserStateManagerTest.kt` (+8 -8) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt` (+6 -6) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryTest.kt` (+29 -29) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/VaultSdkSourceTest.kt` (+11 -11) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt` (+129 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryTest.kt` (+124 -20) </details> ### 📄 Description ## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/PM-23290 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> Migrates any existing pin keys to a pin protected user key envelope. Existing pins will be migrated when the vault is unlocked. And any new pins will use a pin protected user key envelope on creation. ## ⏰ 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 2026-04-21 03:53:39 -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#36747