Skip to content

Conversation

quexten
Copy link
Contributor

@quexten quexten commented Jul 31, 2025

🎟️ Tracking

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

📔 Objective

Adds enrollment functionality for Password(PIN)Protected user key envelope. Both crypto initialization via the init request, and a function exposing the raw key material are provided. The latter is required since unlock is not yet done via the init methods on WASM/clients.

⏰ 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

@quexten quexten dismissed coroiu’s stale review August 19, 2025 13:49

The base branch was changed.

let mut ctx = key_store.context_mut();

let key_envelope =
PasswordProtectedKeyEnvelope(bitwarden_crypto::safe::PasswordProtectedKeyEnvelope::seal(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: We already import PasswordProtectedKeyEnvelope, use the short path.

Suggested change
PasswordProtectedKeyEnvelope(bitwarden_crypto::safe::PasswordProtectedKeyEnvelope::seal(
PasswordProtectedKeyEnvelope(PasswordProtectedKeyEnvelope::seal(

Copy link
Contributor Author

@quexten quexten Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my bad I should have not merged this. The imported PasswordProtectedKeyEnvelope is the non-generic wrapper. The contained envelope that uses the long path is the generic struct from crypto. So they are different structs.

Maybe they should have different naming after all..
I've undone the merge now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea that naming is unfortunate.

Hinton
Hinton previously approved these changes Aug 22, 2025
Hinton
Hinton previously approved these changes Aug 25, 2025
@quexten quexten requested review from mzieniukbw, coroiu and dani-garcia and removed request for coroiu August 25, 2025 10:16
dani-garcia
dani-garcia previously approved these changes Aug 25, 2025
@quexten quexten dismissed stale reviews from dani-garcia and Hinton via 6c7c1ec August 26, 2025 10:53
@quexten
Copy link
Contributor Author

quexten commented Aug 26, 2025

Had to resolve some conflicts from the B64 work

@quexten quexten requested review from dani-garcia and Hinton August 26, 2025 11:17
Copy link

@quexten
Copy link
Contributor Author

quexten commented Aug 26, 2025

Merging since there was no significant change since the last set of reviews, so 1 review seems enough.

@quexten quexten merged commit ae9b9f1 into main Aug 26, 2025
50 checks passed
@quexten quexten deleted the km/pin-unlock branch August 26, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants