Proxy SSH certificates via ssh-agent-lib 0.6 PublicCredential (fix #56) - #95
Draft
sini wants to merge 1 commit into
Draft
Proxy SSH certificates via ssh-agent-lib 0.6 PublicCredential (fix #56)#95sini wants to merge 1 commit into
sini wants to merge 1 commit into
Conversation
sini
force-pushed
the
fix/certs-ssh-agent-lib-0.6
branch
from
August 14, 2026 02:23
223f6c2 to
e861c70
Compare
overhacked#56) ssh-agent-lib 0.5.1 typed identities as ssh_key::public::KeyData, which cannot represent an OpenSSH certificate: request_identities decoded a ...-cert-v01@openssh.com blob into a lossy opaque key and re-serialized a truncated identity, so any upstream agent holding a certificate made `ssh-add -l` fail with "incomplete message" and (with overhacked#94) silently dropped every other agent's keys. Bump to ssh-agent-lib 0.6.0, whose PublicCredential (Key | Cert) round-trips certificates losslessly in both identity listings and sign requests. Key the known-keys map by credential.key_data() so a certificate, its bare public key, and the sign request ssh issues all resolve to the same upstream agent. Note: certificates with valid_before = u64::MAX ("Valid: forever") still fail to decode under the ssh-key 0.6.7 that ssh-agent-lib 0.6.0 builds on (RustCrypto/SSH#504, fixed in ssh-key 0.7). Certificates with a real expiration -- as OpenSSH and correctly configured issuers produce -- work now.
sini
force-pushed
the
fix/certs-ssh-agent-lib-0.6
branch
from
August 14, 2026 02:37
e861c70 to
8c47a16
Compare
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
Fixes #56: an SSH certificate in any upstream agent made the mux unusable —
ssh-add -lreturnedincomplete message, and with #94 merged it instead silently dropped every other agent's keys.ssh-agent-lib0.5.1 typed identities asssh_key::public::KeyData, which cannot represent an OpenSSH certificate.request_identitiesdecoded a…-cert-v01@openssh.comblob into a lossy opaque key (only the certificate nonce survived) and re-serialized a truncated identity, so an OpenSSH client parsing it back as a certificate ran out of bytes.This bumps to
ssh-agent-lib0.6.0, whosePublicCredential(Key(KeyData) | Cert(Box<Certificate>)) round-trips certificates losslessly in both identity listings and sign requests. Theknown_keysmap is now keyed bycredential.key_data(), so a certificate, its bare public key, and the sign request OpenSSH issues all resolve to the same upstream agent.Scope / ssh-key 0.7
ssh-agent-lib0.6.0 builds on the releasedssh-key0.6.7 — no pre-release or patched dependency. Certificates with a realvalid_before(as OpenSSH and correctly configured issuers produce) round-trip fine.The one remaining gap is certificates minted with
valid_before = u64::MAX(Valid: forever):ssh-key0.6.7 rejects those withSSH key error: invalid time(RustCrypto/SSH#504, fixed inssh-key0.7). That is anssh-keylimitation, not the mux — and arguably such certs should not be minted (a certificate that carries an expiring token's authorization should expire with it; see openpubkey/opkssh#606).Testing
Verified against real certificates:
ssh-add -lthrough the mux lists both the bare key and the…cert-v01@openssh.comcertificate (previouslyincomplete message).ssh-add -Tsigns through the mux for both the key and the certificate, routing to the upstream that holds it.The certificate integration test added in #66 exercises this path.