From 2bf6e66ffe9f617ec56a4cc4561c533a81d80cdf Mon Sep 17 00:00:00 2001 From: Fabiano FidĂȘncio Date: Thu, 2 Jul 2015 15:29:06 +0200 Subject: client: handle agent forward open requests with callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabiano FidĂȘncio Reviewed-by: Aris Adamantiadis --- include/libssh/callbacks.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/libssh/callbacks.h') diff --git a/include/libssh/callbacks.h b/include/libssh/callbacks.h index 6bd8c573..20c540e5 100644 --- a/include/libssh/callbacks.h +++ b/include/libssh/callbacks.h @@ -124,6 +124,18 @@ typedef void (*ssh_global_request_callback) (ssh_session session, typedef ssh_channel (*ssh_channel_open_request_x11_callback) (ssh_session session, const char * originator_address, int originator_port, void *userdata); +/** + * @brief Handles an SSH new channel open "auth-agent" request. This happens when the server + * sends back an "auth-agent" connection attempt. This is a client-side API + * @param session current session handler + * @param userdata Userdata to be passed to the callback function. + * @returns a valid ssh_channel handle if the request is to be allowed + * @returns NULL if the request should not be allowed + * @warning The channel pointer returned by this callback must be closed by the application. + */ +typedef ssh_channel (*ssh_channel_open_request_auth_agent_callback) (ssh_session session, + void *userdata); + /** * The structure to replace libssh functions with appropriate callbacks. */ @@ -154,6 +166,9 @@ struct ssh_callbacks_struct { /** This function will be called when an incoming X11 request is received. */ ssh_channel_open_request_x11_callback channel_open_request_x11_function; + /** This function will be called when an incoming "auth-agent" request is received. + */ + ssh_channel_open_request_auth_agent_callback channel_open_request_auth_agent_function; }; typedef struct ssh_callbacks_struct *ssh_callbacks; -- cgit