Repository navigation
fix(tui): unlock with X25519 recipients added via add-recipient - #116
Merged
Merged
Conversation
The TUI unlock re-derived the epoch key from the operator's ISK, which only matches the vault's original symmetric identity. An identity added with `vault add-recipient --gpub` (or one left after a rotate dropped the original key) could not open the vault in the TUI. The recipient-matching unwrap now lives in geode-grotto (`recipients::unwrap_for_identity`, plus the shared X25519 identity derivation) and `Session::unlock_recipients` builds a session from it. The CLI's `load_recipients_for` and the TUI's `vault::open` both use it. Tests: core unit tests for symmetric/X25519/stranger unwrap and the session constructor; TUI integration tests for an added identity, an identity left after the original key was dropped, and a stranger key.
# Conflicts: # CHANGELOG.md
- The CLI no longer carries its own copy of the X25519 identity derivation; `.gpub` generation and rotate use geode-grotto's `x25519_identity_secret` / `x25519_identity_public`. - `load_recipients_for` checks the caller's key_id against the identity in every build (was a debug-only assertion); a mismatch is an auth failure. - recipients.rs: the identity helpers now sit below the imports. - The by-value copy of the X25519 secret used to build the static secret is zeroized after use. - The wrong-epoch unwrap test asserts an authentication failure specifically.
VirtualMachinist
marked this pull request as ready for review
October 26, 2026 21:25
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.
F-2: TUI unlock for X25519 identities
geode_tui::vault::openbuilt its session withSession::unlock, which re-derives the epoch key from the operator's ISK. That only matches the vault's original symmetric identity. These identities could not open the vault in the TUI:vault add-recipient --gpub;Fix: one shared unwrap path
recipients:X25519_IDENTITY_DOMAIN,x25519_identity_secret/x25519_identity_public(the.gpubderivation) andx25519_public_matches(constant time).unwrap_for_identity(recs, isk, vault_id, epoch): matches the symmetric entry bykey_id, or the X25519 entry by public key, and unwraps it. No matching entry isAuthFail.session:Session::unlock_recipients(isk, &recs, vault_id, epoch, idle)unwraps the epoch key through that path, then zeroizes the ISK.load_recipients_fornow callsunwrap_for_identity, which is the X25519 path from fix(vault): x25519 recipients can open their vault; rotate fails closed #114 moved into core. The CLI's X25519 domain constant is imported from core, so the two can't drift apart.vault::openreadsrecipients.jsonand unlocks withSession::unlock_recipients. Header and manifest MAC checks are unchanged.Tests
geode-grottounit tests:recipients::identity_unwrap_tests: symmetric and X25519 identities unwrap the same epoch key; a stranger key or the wrong epoch fails; the public key derivation matches.gpub.session::unlock_recipients_tests: an X25519 identity unlocks a session; the owner with no entry getsAuthFail.geode-tui/tests/x25519_unlock.rs(fixture built with the CLI, dummy keys, HOME/XDG isolated; assertions callgeode_tui::vault::open/verify(full)/previewin-process):tui_unlock_x25519_recipient: both the added key and the owner key open;key_idmatches the.gpub.tui_unlock_after_owner_dropped: afterrotate --drop-recipient <owner> --reseal, the added key opens and the owner key getsAuthFail.tui_unlock_stranger_is_auth_failCHANGELOG
Unreleasedentry added. No version bump.Refresh after #115
main(with fix(vault): refuse no-reseal rotate that would hide entries; strict restore #115) brought in by a true merge, no rebase; the CHANGELOGUnreleasedconflict kept both sides.x25519_identity_*is the only one); the debug-onlykey_idcheck incmd/mod.rsis now a realAuthFailcheck; the newrecipientshelpers sit below the imports; secret temporaries are zeroized; the wrong-epoch test assertsAuthFailspecifically.