Skip to content

fix(ssh): unlock passphrase-protected identity files - #103

Open
sisodiahs wants to merge 1 commit into
timhartmann7:mainfrom
sisodiahs:fix/passphrase-protected-keys
Open

sisodiahs wants to merge 1 commit into
timhartmann7:mainfrom
sisodiahs:fix/passphrase-protected-keys

Conversation

@sisodiahs

Copy link
Copy Markdown

Summary

  • Prompt once when an identity file is encrypted, cache the passphrase in process memory, and retry SSH without waiting out reconnect backoff.
  • Works in the TUI and desktop GUI; the host Password field stays the login password.

Fixes #97

Test plan

  • Encrypted Ed25519 key, empty agent → prompt → connect succeeds; no second prompt
  • Wrong passphrase → error, prompt stays
  • hosts.toml never stores the passphrase
  • ssh-add then connect with no prompt

@timhartmann7

Copy link
Copy Markdown
Owner

Thanks for this - and sorry for the slow reply

The feature itself looks well built. The typed AuthOutcome::PassphraseRequired instead of prompting from inside authenticate(), the non-blocking CoreEvent::KeyPassphraseRequired so the metrics poller never pops a dialog, the in-memory-only passphrase store, and the spawn_blocking around load_secret_key are all the right calls. Tests and CHANGELOG/README entries are there too.

The problem is that the diff is unreviewable as pushed: 220 files, +37k/-36k. Almost all of it is mechanical noise from two git settings on your side:

git diff --shortstat main...pr-103 -> 220 files, +37347 / -36507
git diff --shortstat -w main...pr-103 -> 220 files, +912 / -72

  • 196 files were rewritten LF → CRLF
  • 215 files flipped mode 100644 → 100755 (this is why 17 icon files with
    identical content show up as changed)

Could you re-push with:

git config core.fileMode false
git config core.autocrlf input

and a branch rebuilt on top of current main? That should land as roughly +912/-72 across ~35 files, which I can review properly

@sisodiahs
sisodiahs force-pushed the fix/passphrase-protected-keys branch from 357d03a to fc94e3d Compare September 17, 2026 07:00
@sisodiahs

Copy link
Copy Markdown
Author

Rebuilt the branch on current main and re-pushed. The noise should be gone now.

Diff is 35 files, +923/−83. Sorry about the review mess — should be readable now.

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.

## Bug: Authentication fails for any passphrase-protected private key

2 participants