Skip to content

feat: wrap the store's data key in credential slots - #65

Merged
kassandraoftroy merged 3 commits into
masterfrom
feat/keystore-key-slots
Sep 10, 2026
Merged

kassandraoftroy merged 3 commits into
masterfrom
feat/keystore-key-slots

Conversation

@fbwoolf

@fbwoolf fbwoolf commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #56.

This conflicts with #58

Follow-up to #49, where @Robert-MacWha pointed out that holding the password directly blocks hardware unlock in the future. The fix is easier now than later.

Records no longer hang off the password. The store generates a random data key and holds it in the header wrapped by a list of credential slots, each able to recover it alone. argon2id-password is the only kind implemented, so nothing but a password unlocks anything today. A slot's parameters are opaque under its kind tag, so a build that does not recognize a slot still unlocks through one it does, which makes a hardware slot additive rather than a format break.

create, unlock and open_or_create are unchanged. change_password is new and rewraps one slot in a single header write without touching a record. slot_kinds lists what is enrolled. KeySource, DataKey and StoredSlot are pub(crate), since a slot implementation handles the data key in the clear; can be changed to be public now.

The encryption integration tests are back, at core/tests/database/. #48 deleted them along with the wallet crate and did not replace them, so master currently has no coverage of scope isolation, key blinding, store permissions, or the header-parameter validation added in #51. This branch had to touch that file anyway, so restoring it here was cheaper than losing the tests and re-adding them later.

@kassandraoftroy kassandraoftroy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

SGTM, i like it. Let's see what @Robert-MacWha thinks. I can rebase #58 after we merge this.

@kassandraoftroy kassandraoftroy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@kassandraoftroy
kassandraoftroy merged commit de94190 into master Sep 10, 2026
4 checks passed
@fbwoolf
fbwoolf deleted the feat/keystore-key-slots branch September 14, 2026 21:06
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.

EDW-024 - Pluggable credentials for the encrypted store

3 participants