mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
client: handle agent forward open requests with callbacks
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Aris Adamantiadis <aris@badcode.be>
This commit is contained in:
committed by
Aris Adamantiadis
parent
728c2fbd01
commit
2bf6e66ffe
@@ -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;
|
||||
|
||||
|
||||
@@ -188,7 +188,8 @@ enum ssh_channel_type_e {
|
||||
SSH_CHANNEL_SESSION,
|
||||
SSH_CHANNEL_DIRECT_TCPIP,
|
||||
SSH_CHANNEL_FORWARDED_TCPIP,
|
||||
SSH_CHANNEL_X11
|
||||
SSH_CHANNEL_X11,
|
||||
SSH_CHANNEL_AUTH_AGENT
|
||||
};
|
||||
|
||||
enum ssh_channel_requests_e {
|
||||
@@ -401,6 +402,7 @@ LIBSSH_API int ssh_channel_request_sftp(ssh_channel channel);
|
||||
LIBSSH_API int ssh_channel_request_subsystem(ssh_channel channel, const char *subsystem);
|
||||
LIBSSH_API int ssh_channel_request_x11(ssh_channel channel, int single_connection, const char *protocol,
|
||||
const char *cookie, int screen_number);
|
||||
LIBSSH_API int ssh_channel_request_auth_agent(ssh_channel channel);
|
||||
LIBSSH_API int ssh_channel_send_eof(ssh_channel channel);
|
||||
LIBSSH_API int ssh_channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct
|
||||
timeval * timeout);
|
||||
|
||||
Reference in New Issue
Block a user