diff --git a/apps/desktop/desktop_native/ssh_agent/src/protocol/agent_listener.rs b/apps/desktop/desktop_native/ssh_agent/src/protocol/agent_listener.rs index e1506f46e78..9c36434ddf9 100644 --- a/apps/desktop/desktop_native/ssh_agent/src/protocol/agent_listener.rs +++ b/apps/desktop/desktop_native/ssh_agent/src/protocol/agent_listener.rs @@ -11,7 +11,7 @@ use crate::{ async_stream_wrapper::AsyncStreamWrapper, connection::ConnectionInfo, key_store::Agent, - replies::{AgentFailure, IdentitiesReply, SshSignReply}, + replies::{AgentExtensionFailure, AgentFailure, IdentitiesReply, SshSignReply}, requests::Request, }, transport::peer_info::PeerInfo, @@ -63,7 +63,9 @@ async fn handle_connection( let Ok(request) = Request::try_from(request.as_slice()) else { span.in_scope(|| error!("Failed to parse request")); - stream.write_reply(&AgentFailure::new().into()).await?; + stream + .write_reply(&AgentExtensionFailure::new().into()) + .await?; continue; }; @@ -73,7 +75,9 @@ async fn handle_connection( let Ok(true) = agent.request_can_list(connection).await else { span.in_scope(|| error!("List keys request denied by UI")); - return stream.write_reply(&AgentFailure::new().into()).await; + return stream + .write_reply(&AgentExtensionFailure::new().into()) + .await; }; IdentitiesReply::new(agent.list_keys().await?) @@ -105,7 +109,7 @@ async fn handle_connection( )? .encode() } else { - Ok(AgentFailure::new().into()) + Ok(AgentExtensionFailure::new().into()) } .map_err(|e| anyhow::anyhow!("Failed to create sign reply: {e}")) } diff --git a/apps/desktop/desktop_native/ssh_agent/src/protocol/replies.rs b/apps/desktop/desktop_native/ssh_agent/src/protocol/replies.rs index 88d862c4dde..f010dd2706b 100644 --- a/apps/desktop/desktop_native/ssh_agent/src/protocol/replies.rs +++ b/apps/desktop/desktop_native/ssh_agent/src/protocol/replies.rs @@ -115,6 +115,19 @@ impl SshSignReply { } } +pub(crate) struct AgentExtensionFailure; +impl AgentExtensionFailure { + pub fn new() -> Self { + Self {} + } +} + +impl From for ReplyFrame { + fn from(_value: AgentExtensionFailure) -> Self { + ReplyFrame::new(ReplyType::SSH_AGENT_EXTENSION_FAILURE, Vec::new()) + } +} + pub(crate) struct AgentFailure; impl AgentFailure { pub fn new() -> Self { @@ -124,6 +137,6 @@ impl AgentFailure { impl From for ReplyFrame { fn from(_value: AgentFailure) -> Self { - ReplyFrame::new(ReplyType::SSH_AGENT_EXTENSION_FAILURE, Vec::new()) + ReplyFrame::new(ReplyType::SSH_AGENT_FAILURE, Vec::new()) } }