Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binding for agent forwarding #24

Merged
merged 1 commit into from
May 8, 2024
Merged

Commits on May 8, 2024

  1. Add binding for agent forwarding

    channel_open_request_auth_agent_callback is required for implementing
    ssh agent forward as unlike X11 forward, there is no other way to
    establish a forwarding channel.
    
    In libssh:
    
    1. Callback is triggered while handling protocol packets in other libssh
       call.
    2. The callback creates a new channel and prepare for bidirectional
       forwarding between it and ssh agent.
    3. The callback then returns a borrow of the newly created channel for
       libssh to make reply to the remote side.
    
    However, the callback-based flow does not really fit our Rust binding
    design: during callback we have SessionHolder locked, so it's really
    hard to do anything without introducing lock re-entrancy issues, plus
    that it demands us to return a temporary borrow of something owned by
    Rust side whose lifetime is tricky to model.
    
    Instead, we try to turn the callback-based style back to something
    resembling `ssh_channel_accept_x11` by buffering pending channels and
    let users fetch them later in a saner context.
    Riatre committed May 8, 2024
    Configuration menu
    Copy the full SHA
    19e6e9d View commit details
    Browse the repository at this point in the history