Skip to content

feat(netrocks): add SSH private key passphrase prompt#3399

Open
michaellukashov wants to merge 2 commits into
elfmz:masterfrom
michaellukashov:netrock-ask-key-passphrase
Open

feat(netrocks): add SSH private key passphrase prompt#3399
michaellukashov wants to merge 2 commits into
elfmz:masterfrom
michaellukashov:netrock-ask-key-passphrase

Conversation

@michaellukashov

Copy link
Copy Markdown
Contributor

SSH connections using encrypted private keys now prompt the user for a passphrase instead of failing immediately with a generic auth failure.

Changes

New exception type (Erroring.h, Erroring.cpp)

  • ProtocolKeyPassphraseNeededError — thrown when libssh reports SSH_ERROR while reading an encrypted key file, distinguishing it from actual credential
    failures.

New IPC message (IPC.h)

  • IPC_PI_KEY_PASSPHRASE_NEEDED — communicated from the background broker thread to the main UI thread.

Broker forwarding (HostRemoteBroker.cpp)

  • Catches ProtocolKeyPassphraseNeededError and sends the new IPC message, keeping the same pattern as existing auth failure and identity mismatch cases.

Passphrase dialog (InteractiveLogin.cpp, InteractiveLogin.h)

  • InteractivePassphraseDialog — password-edit dialog with the same visual style and retry-numbering as the existing auth retry dialog.
  • InteractivePassphrase() — public API that shows the dialog and updates the in-memory password on success.

Retry loop (HostRemote.cpp::ReInitialize())

  • On IPC_PI_KEY_PASSPHRASE_NEEDED, prompts the user up to 3 attempts.
  • On successful entry, retries the connection with the provided passphrase.
  • On exhaustion, falls through to OnBroken() with a generic ProtocolError.
  • Also gates _login_mode on !_password.empty() so the cached passphrase can be reused on subsequent reinitializations.

Localization (eng.lng, rus.lng, bel.lng)

  • 5 new strings: title, retry title, label text, retry label text, and the passphrase prompt.

- Add ProtocolKeyPassphraseNeededError exception type
- Add IPC_PI_KEY_PASSPHRASE_NEEDED IPC message
- Add InteractivePassphraseDialog with passphrase input
- Wire passphrase prompt in HostRemote::ReInitialize() with retry logic (3 attempts)
- Add language strings for English, Russian, and Belarusian
- Pass passphrase exception through HostRemoteBroker
@michaellukashov michaellukashov changed the title feat(netrock): add SSH private key passphrase prompt feat(netrocks): add SSH private key passphrase prompt May 18, 2026
- Change button label from "Connect" to "OK" for consistency
- Auto-select pre-filled passphrase text on retry for faster re-entry
- Restructure layout with labels and fields on separate lines
- Widen dialog to accommodate longer site names and passphrases
- Fix separator rendering glitch by matching InteractiveLoginDialog proportions
- Add inline InteractivePassphrase() handler in HostRemote::ReInitialize()
  (from prior implementation work, see .ai-factory/PLAN.md)
@michaellukashov michaellukashov force-pushed the netrock-ask-key-passphrase branch from d05a6e5 to 98cf6ae Compare May 18, 2026 11:22
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.

1 participant