diff options
author | milo <milo@r0ot.me> | 2011-03-11 13:39:29 +0100 |
---|---|---|
committer | milo <milo@r0ot.me> | 2011-04-14 14:05:44 +0200 |
commit | 7cc4471168550021eec6b7b97dc24c79d4fb366d (patch) | |
tree | 3c54819ef232295fd62296d5a37d70e6ed6f2275 /src/messages.c | |
parent | 3046a5061433b7000964aec5169d127191b6aeed (diff) | |
download | libssh-7cc4471168550021eec6b7b97dc24c79d4fb366d.tar.gz libssh-7cc4471168550021eec6b7b97dc24c79d4fb366d.tar.xz libssh-7cc4471168550021eec6b7b97dc24c79d4fb366d.zip |
Implemented X11 server side
Diffstat (limited to 'src/messages.c')
-rw-r--r-- | src/messages.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/messages.c b/src/messages.c index 5953338a..dc4aabff 100644 --- a/src/messages.c +++ b/src/messages.c @@ -988,6 +988,41 @@ int ssh_message_handle_channel_request(ssh_session session, ssh_channel channel, goto end; } + if (strcmp(request, "x11-req") == 0) { + ssh_string auth_protocol = NULL; + ssh_string auth_cookie = NULL; + + buffer_get_u8(packet, &msg->channel_request.x11_single_connection); + + auth_protocol = buffer_get_ssh_string(packet); + if (auth_protocol == NULL) { + ssh_set_error_oom(session); + goto error; + } + auth_cookie = buffer_get_ssh_string(packet); + if (auth_cookie == NULL) { + ssh_set_error_oom(session); + ssh_string_free(auth_protocol); + goto error; + } + + msg->channel_request.type = SSH_CHANNEL_REQUEST_X11; + msg->channel_request.x11_auth_protocol = ssh_string_to_char(auth_protocol); + msg->channel_request.x11_auth_cookie = ssh_string_to_char(auth_cookie); + if (msg->channel_request.x11_auth_protocol == NULL || + msg->channel_request.x11_auth_cookie == NULL) { + ssh_string_free(auth_protocol); + ssh_string_free(auth_cookie); + goto error; + } + ssh_string_free(auth_protocol); + ssh_string_free(auth_cookie); + + buffer_get_u32(packet, &msg->channel_request.x11_screen_number); + + goto end; + } + msg->channel_request.type = SSH_CHANNEL_UNKNOWN; end: ssh_message_queue(session,msg); |