Skip to content

[PM-37888] refactor: Read masterKeyWrappedUserKey from masterPasswordUnlock#2780

Draft
matt-livefront wants to merge 8 commits into
matt/PM-37886-key-connector-encrypted-user-keyfrom
matt/PM-37888-master-key-wrapped-user-key
Draft

[PM-37888] refactor: Read masterKeyWrappedUserKey from masterPasswordUnlock#2780
matt-livefront wants to merge 8 commits into
matt/PM-37886-key-connector-encrypted-user-keyfrom
matt/PM-37888-master-key-wrapped-user-key

Conversation

@matt-livefront

@matt-livefront matt-livefront commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

PM-37888

📔 Objective

Updates instances of AccountEncryptionKeys.encryptedUserKey to instead use UserDecryptionOptions.masterPasswordUnlock?.masterKeyEncryptedUserKey since these are all called for users with a master password. I've left AccountEncryptionKeys.encryptedUserKey for now, to be cleaned up in a separate PR.

  • Switch unlockVaultFromLoginWithDevice, validatePassword, and KeyConnectorService.migrateUser to read the master-key-encrypted user key from UserDecryptionOptions.masterPasswordUnlock?.masterKeyEncryptedUserKey instead of AccountEncryptionKeys.encryptedUserKey
  • Add setAccountMasterPasswordUnlock call in the V1 JIT and TDE paths of setMasterPassword (these paths previously never populated masterPasswordUnlock, so subsequent reads would return nil)
  • Add setAccountMasterPasswordUnlock call in updateMasterPassword so the canonical source stays current after a password change
  • Set encryptedUserKey: nil on all master-password-related setAccountEncryptionKeys calls — the value now lives exclusively in masterPasswordUnlock

@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt labels Jun 11, 2026
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.18033% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (matt/PM-37886-key-connector-encrypted-user-key@934fd0a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...Shared/Core/Auth/Repositories/AuthRepository.swift 95.83% 1 Missing ⚠️
Additional details and impacted files
@@                                Coverage Diff                                @@
##             matt/PM-37886-key-connector-encrypted-user-key    #2780   +/-   ##
=================================================================================
  Coverage                                                  ?   87.90%           
=================================================================================
  Files                                                     ?     1716           
  Lines                                                     ?   167825           
  Branches                                                  ?        0           
=================================================================================
  Hits                                                      ?   147530           
  Misses                                                    ?    20295           
  Partials                                                  ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matt-livefront matt-livefront force-pushed the matt/PM-37886-key-connector-encrypted-user-key branch from 934fd0a to f9ca3ee Compare June 18, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant