Skip to content

Recognize certificates held by ssh-agent - #47

Open
dkoryto wants to merge 1 commit into
alebeck:mainfrom
dkoryto:fix/agent-certificates
Open

dkoryto wants to merge 1 commit into
alebeck:mainfrom
dkoryto:fix/agent-certificates

Conversation

@dkoryto

@dkoryto dkoryto commented Sep 28, 2026

Copy link
Copy Markdown

Keys listed by the agent client come back as *agent.Key whatever their type, so the type assertion on *ssh.Certificate in loadIDs never matched. Certificate identities from the agent were treated as plain keys, and with IdentitiesOnly they were dropped because their fingerprint doesn't match the configured key. Connections to servers that require a certificate then failed with 'no key files found'.

asCert now parses the key from its wire format before checking the type. certify uses it as well, for the same reason.

Tested with a unit test for asCert, an e2e test that authenticates with a certificate only available through the agent, and manually with OpenSSH's ssh-agent against an sshd using TrustedUserCAKeys.

Keys listed by the agent client come back as *agent.Key whatever their
type, so the type assertion on *ssh.Certificate in loadIDs never matched.
Certificate identities from the agent were treated as plain keys, and
with IdentitiesOnly they were dropped because their fingerprint doesn't
match the configured key. Connections to servers that require a
certificate then failed with 'no key files found'.

asCert now parses the key from its wire format before checking the
type. certify uses it as well, for the same reason.

Tested with a unit test for asCert, an e2e test that authenticates with
a certificate only available through the agent, and manually with
OpenSSH's ssh-agent against an sshd using TrustedUserCAKeys.
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