Fix file-based OpenSSH key signing without ssh-agent - #31
Open
jrhunger wants to merge 2 commits into
Open
Conversation
When triton-cli falls back to ~/.ssh keys (no ssh-agent), OpenSSH-format keys failed with "namespace invalid" because signing used ssh-key's SSHSIG API. Sign raw key material with RustCrypto instead, matching the SSH agent wire format CloudAPI expects. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
triton-cliauthentication when keys are loaded from~/.sshwithout a running ssh-agentssh_key::PrivateKey::sign("", …)(SSHSIG /namespace invalid) with raw signing via RustCrypto for OpenSSH-formatkeys
sign_with_keythrough the same corrected pathProblem
KeySource::autotries ssh-agent first, then scans~/.ssh. When the agent is unavailable, signing an OpenSSH-format key (e.g.id_ed25519) failed with:triton: error: Signing error: SSH signing failed: namespace invalid
ssh-agent worked because it signs the raw HTTP signing string; the file path incorrectly used ssh-key's SSHSIG API.
Test plan
cargo test -p triton-auth(includes 5 new OpenSSH signing regression tests)cargo clippy -p triton-auth --all-targets -- -D warningsSSH_AUTH_SOCK, runtritonwith default~/.ssh/id_ed25519profile — command should authenticatesuccessfully
AI usage
Closes #29