Skip to content
Merged
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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,22 @@ jobs:

- name: Build desktop
run: cargo build -p desktop

# Linux CI never type-checks `#[cfg(windows)]`. The release matrix does, so
# SSH-agent Windows APIs have to be checked here or they only fail on Release.
windows:
name: rust (windows check)
runs-on: windows-latest
steps:
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cargo cache
uses: Swatinem/rust-cache@v2
with:
workspaces: . -> target

- name: Check desktop
run: cargo check -p desktop
19 changes: 12 additions & 7 deletions crates/based-ssh/src/tunnel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,21 @@ async fn authenticate_with_agent(
{
// `connect_env` is Unix-only (SSH_AUTH_SOCK). Prefer OpenSSH's agent
// named pipe, then Pageant.
//
// russh 0.54: `connect_named_pipe` returns Result, but `connect_pageant`
// returns `AgentClient` (not Result) — do not call `with_context` on it.
match AgentClient::connect_named_pipe(r"\\.\pipe\openssh-ssh-agent").await {
Ok(mut agent) => try_agent_identities(session, user, &mut agent).await,
Err(openssh_err) => {
let mut agent = AgentClient::connect_pageant().await.with_context(|| {
format!(
"SSH tunnel: could not connect to OpenSSH agent \
(\\\\.\\pipe\\openssh-ssh-agent: {openssh_err}) or Pageant"
)
})?;
try_agent_identities(session, user, &mut agent).await
let mut agent = AgentClient::connect_pageant().await;
try_agent_identities(session, user, &mut agent)
.await
.with_context(|| {
format!(
"SSH tunnel: OpenSSH agent unavailable ({openssh_err}); \
Pageant authentication failed"
)
})
}
}
}
Expand Down
Loading