Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rust-version = "1.83.0"
[dependencies]
clap-serde-derive = "0.2.1"
flexi_logger = "0.31.7"
ssh-agent-lib = "0.5.1"
ssh-agent-lib = "0.6.0"
toml = "0.9.8"

[dependencies.shellexpand]
Expand Down
16 changes: 13 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ impl Session for MuxAgent {
}

async fn sign(&mut self, request: SignRequest) -> Result<Signature, AgentError> {
let fingerprint = request.pubkey.fingerprint(Default::default());
let fingerprint = request
.credential
.key_data()
.fingerprint(Default::default());
log::trace!("incoming: sign({})", &fingerprint);

if let Some(agent_sock_path) = self.get_agent_sock_for_pubkey(&request.pubkey).await? {
if let Some(agent_sock_path) = self
.get_agent_sock_for_pubkey(request.credential.key_data())
.await?
{
log::info!(
"Requesting signature with key {} from upstream agent <{}>",
&fingerprint,
Expand Down Expand Up @@ -215,7 +221,11 @@ impl MuxAgent {
};
{
for id in &agent_identities {
known_keys.insert(id.pubkey.clone(), sock_path.clone());
// Key the map by the underlying public key. For an OpenSSH
// certificate this is the cert's public key, which also matches
// the plain-key sign request that ssh issues, so both resolve to
// the same upstream agent.
known_keys.insert(id.credential.key_data().clone(), sock_path.clone());
}
}
log::trace!(
Expand Down
Loading