diff options
author | Fabiano FidĂȘncio <fidencio@redhat.com> | 2015-07-02 15:29:06 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2015-07-07 13:24:55 +0200 |
commit | 2bf6e66ffe9f617ec56a4cc4561c533a81d80cdf (patch) | |
tree | 9aa7fcb7629fb4abe859c8d9735b6b520a9e1987 /src/messages.c | |
parent | 728c2fbd017451a868ed9471c9d001f6d4ffff96 (diff) | |
download | libssh-2bf6e66ffe9f617ec56a4cc4561c533a81d80cdf.tar.gz libssh-2bf6e66ffe9f617ec56a4cc4561c533a81d80cdf.tar.xz libssh-2bf6e66ffe9f617ec56a4cc4561c533a81d80cdf.zip |
client: handle agent forward open requests with callbacks
Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
Reviewed-by: Aris Adamantiadis <aris@badcode.be>
Diffstat (limited to 'src/messages.c')
-rw-r--r-- | src/messages.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/messages.c b/src/messages.c index d906e696..ec538771 100644 --- a/src/messages.c +++ b/src/messages.c @@ -294,6 +294,21 @@ static int ssh_execute_client_request(ssh_session session, ssh_message msg) } return SSH_OK; + } else if (msg->type == SSH_REQUEST_CHANNEL_OPEN + && msg->channel_request_open.type == SSH_CHANNEL_AUTH_AGENT + && ssh_callbacks_exists(session->common.callbacks, channel_open_request_auth_agent_function)) { + channel = session->common.callbacks->channel_open_request_auth_agent_function (session, + session->common.callbacks->userdata); + + if (channel != NULL) { + rc = ssh_message_channel_request_open_reply_accept_channel(msg, channel); + + return rc; + } else { + ssh_message_reply_default(msg); + } + + return SSH_OK; } return rc; @@ -1070,6 +1085,11 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open){ goto end; } + if (strcmp(type_c,"auth-agent@openssh.com") == 0) { + msg->channel_request_open.type = SSH_CHANNEL_AUTH_AGENT; + goto end; + } + msg->channel_request_open.type = SSH_CHANNEL_UNKNOWN; goto end; |