server: implement server-side of agent forwarding
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
81e769ec6a
Коммит
7e306a9ec6
@ -362,6 +362,7 @@ LIBSSH_API int ssh_channel_is_closed(ssh_channel channel);
|
|||||||
LIBSSH_API int ssh_channel_is_eof(ssh_channel channel);
|
LIBSSH_API int ssh_channel_is_eof(ssh_channel channel);
|
||||||
LIBSSH_API int ssh_channel_is_open(ssh_channel channel);
|
LIBSSH_API int ssh_channel_is_open(ssh_channel channel);
|
||||||
LIBSSH_API ssh_channel ssh_channel_new(ssh_session session);
|
LIBSSH_API ssh_channel ssh_channel_new(ssh_session session);
|
||||||
|
LIBSSH_API int ssh_channel_open_auth_agent(ssh_channel channel);
|
||||||
LIBSSH_API int ssh_channel_open_forward(ssh_channel channel, const char *remotehost,
|
LIBSSH_API int ssh_channel_open_forward(ssh_channel channel, const char *remotehost,
|
||||||
int remoteport, const char *sourcehost, int localport);
|
int remoteport, const char *sourcehost, int localport);
|
||||||
LIBSSH_API int ssh_channel_open_session(ssh_channel channel);
|
LIBSSH_API int ssh_channel_open_session(ssh_channel channel);
|
||||||
|
@ -948,6 +948,40 @@ int ssh_channel_open_session(ssh_channel channel) {
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Open an agent authentication forwarding channel. This type of channel
|
||||||
|
* can be opened by a server towards a client in order to provide SSH-Agent services
|
||||||
|
* to the server-side process. This channel can only be opened if the client
|
||||||
|
* claimed support by sending a channel request beforehand.
|
||||||
|
*
|
||||||
|
* @param[in] channel An allocated channel.
|
||||||
|
*
|
||||||
|
* @return SSH_OK on success,
|
||||||
|
* SSH_ERROR if an error occurred,
|
||||||
|
* SSH_AGAIN if in nonblocking mode and call has
|
||||||
|
* to be done again.
|
||||||
|
*
|
||||||
|
* @see channel_open_forward()
|
||||||
|
*/
|
||||||
|
int ssh_channel_open_auth_agent(ssh_channel channel){
|
||||||
|
if(channel == NULL) {
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_SSH1
|
||||||
|
if (channel->session->version == 1) {
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return channel_open(channel,
|
||||||
|
"auth-agent",
|
||||||
|
CHANNEL_INITIAL_WINDOW,
|
||||||
|
CHANNEL_MAX_PACKET,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Open a TCP/IP forwarding channel.
|
* @brief Open a TCP/IP forwarding channel.
|
||||||
*
|
*
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user