-
Notifications
You must be signed in to change notification settings - Fork 75
[PM-23289] Migrate PIN unlock keys on biometrics/MP unlock #2026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2026 +/- ##
=======================================
Coverage 81.33% 81.34%
=======================================
Files 831 831
Lines 52439 52456 +17
=======================================
+ Hits 42651 42668 +17
Misses 9788 9788 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
enrollPinResponse: enrollPinResponse, | ||
requirePasswordAfterRestart: pinUnlockRequiresPasswordAfterRestart, | ||
) | ||
await flightRecorder.log("[Auth] Migrated from legacy PIN to PIN-protected user key envelope") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 It seems to me we might want to expand the Flight Recorder to work something like OSLog, where you can have several different subsystem logs, and so we could flight record just some subsystems, etc. and it would let us prepend the [Auth]
ourselves. Something to consider long-term, I suppose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh that's a good idea, I can drop a ticket into the backlog.
try await stateService.setPinKeys( | ||
enrollPinResponse: enrollPinResponse, | ||
requirePasswordAfterRestart: pinUnlockRequiresPasswordAfterRestart, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Do we also need to delete the pinProtectedUserKey
out of state service as part of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do, yeah. This is handled in StateService:
ios/BitwardenShared/Core/Platform/Services/StateService.swift
Lines 2092 to 2093 in 6a5266c
// Remove any legacy pin protected user keys. | |
appSettingsStore.setPinProtectedUserKey(key: nil, userId: userId) |
🎟️ Tracking
PM-23289
📔 Objective
#1876 added logic to migrate to a PIN-protected user key envelope when the vault is unlocked with a PIN. However, this wouldn't migrate an existing PIN key if the vault was unlocked with MP or biometrics. This adds a migration that occurs when unlocking with MP or biometrics.
⏰ Reminders before review
🦮 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