feat: wrap the store's data key in credential slots - #65
Merged
Merged
Conversation
kassandraoftroy
left a comment
Collaborator
There was a problem hiding this comment.
SGTM, i like it. Let's see what @Robert-MacWha thinks. I can rebase #58 after we merge this.
Robert-MacWha
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-passwordis 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,unlockandopen_or_createare unchanged.change_passwordis new and rewraps one slot in a single header write without touching a record.slot_kindslists what is enrolled.KeySource,DataKeyandStoredSlotarepub(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.