aboutsummaryrefslogtreecommitdiff
path: root/src/messages.c
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2011-03-11 13:39:29 +0100
committermilo <milo@r0ot.me>2011-04-14 13:32:16 +0200
commita3cddd5fad88499255399fb469fee52f1a3e48fc (patch)
tree94ee1d003931dedf5b8a9572bf6bff7e3f9913f2 /src/messages.c
parent89a3385b98ff4def869b88e6b28559a7df51a2a0 (diff)
downloadlibssh-a3cddd5fad88499255399fb469fee52f1a3e48fc.tar.gz
libssh-a3cddd5fad88499255399fb469fee52f1a3e48fc.tar.xz
libssh-a3cddd5fad88499255399fb469fee52f1a3e48fc.zip
Implemented X11 server side
Diffstat (limited to 'src/messages.c')
-rw-r--r--src/messages.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/messages.c b/src/messages.c
index 5953338..dc4aabf 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);