version 1.76, 2000/12/19 22:43:44 |
version 1.77, 2000/12/19 23:17:56 |
|
|
|
|
/* Saved X11 authentication data. This is the real data. */ |
/* Saved X11 authentication data. This is the real data. */ |
char *x11_saved_data = NULL; |
char *x11_saved_data = NULL; |
unsigned int x11_saved_data_len = 0; |
u_int x11_saved_data_len = 0; |
|
|
/* |
/* |
* Fake X11 authentication data. This is what the server will be sending us; |
* Fake X11 authentication data. This is what the server will be sending us; |
* we should replace any occurrences of this by the real data. |
* we should replace any occurrences of this by the real data. |
*/ |
*/ |
char *x11_fake_data = NULL; |
char *x11_fake_data = NULL; |
unsigned int x11_fake_data_len; |
u_int x11_fake_data_len; |
|
|
/* |
/* |
* Data structure for storing which hosts are permitted for forward requests. |
* Data structure for storing which hosts are permitted for forward requests. |
|
|
int |
int |
x11_open_helper(Channel *c) |
x11_open_helper(Channel *c) |
{ |
{ |
unsigned char *ucp; |
u_char *ucp; |
unsigned int proto_len, data_len; |
u_int proto_len, data_len; |
|
|
/* Check if the fixed size part of the packet is in buffer. */ |
/* Check if the fixed size part of the packet is in buffer. */ |
if (buffer_len(&c->output) < 12) |
if (buffer_len(&c->output) < 12) |
return 0; |
return 0; |
|
|
/* Parse the lengths of variable-length fields. */ |
/* Parse the lengths of variable-length fields. */ |
ucp = (unsigned char *) buffer_ptr(&c->output); |
ucp = (u_char *) buffer_ptr(&c->output); |
if (ucp[0] == 0x42) { /* Byte order MSB first. */ |
if (ucp[0] == 0x42) { /* Byte order MSB first. */ |
proto_len = 256 * ucp[6] + ucp[7]; |
proto_len = 256 * ucp[6] + ucp[7]; |
data_len = 256 * ucp[8] + ucp[9]; |
data_len = 256 * ucp[8] + ucp[9]; |
|
|
{ |
{ |
int id; |
int id; |
char *data; |
char *data; |
unsigned int data_len; |
u_int data_len; |
Channel *c; |
Channel *c; |
|
|
/* Get the channel number and verify it. */ |
/* Get the channel number and verify it. */ |
|
|
int id; |
int id; |
int tcode; |
int tcode; |
char *data; |
char *data; |
unsigned int data_len; |
u_int data_len; |
Channel *c; |
Channel *c; |
|
|
/* Get the channel number and verify it. */ |
/* Get the channel number and verify it. */ |
|
|
int |
int |
channel_not_very_much_buffered_data() |
channel_not_very_much_buffered_data() |
{ |
{ |
unsigned int i; |
u_int i; |
Channel *c; |
Channel *c; |
|
|
for (i = 0; i < channels_alloc; i++) { |
for (i = 0; i < channels_alloc; i++) { |
|
|
int |
int |
channel_still_open() |
channel_still_open() |
{ |
{ |
unsigned int i; |
u_int i; |
for (i = 0; i < channels_alloc; i++) |
for (i = 0; i < channels_alloc; i++) |
switch (channels[i].type) { |
switch (channels[i].type) { |
case SSH_CHANNEL_FREE: |
case SSH_CHANNEL_FREE: |
|
|
u_short host_port; |
u_short host_port; |
char *host, *originator_string; |
char *host, *originator_string; |
int remote_channel, sock = -1, newch, i, denied; |
int remote_channel, sock = -1, newch, i, denied; |
unsigned int host_len, originator_len; |
u_int host_len, originator_len; |
|
|
/* Get remote channel number. */ |
/* Get remote channel number. */ |
remote_channel = packet_get_int(); |
remote_channel = packet_get_int(); |
|
|
|
|
static |
static |
int |
int |
connect_local_xsocket(unsigned int dnr) |
connect_local_xsocket(u_int dnr) |
{ |
{ |
static const char *const x_sockets[] = { |
static const char *const x_sockets[] = { |
X_UNIX_PATH "%u", |
X_UNIX_PATH "%u", |
|
|
{ |
{ |
int remote_channel, sock = 0, newch; |
int remote_channel, sock = 0, newch; |
char *remote_host; |
char *remote_host; |
unsigned int remote_len; |
u_int remote_len; |
|
|
/* Get remote channel number. */ |
/* Get remote channel number. */ |
remote_channel = packet_get_int(); |
remote_channel = packet_get_int(); |
|
|
x11_request_forwarding_with_spoofing(int client_session_id, |
x11_request_forwarding_with_spoofing(int client_session_id, |
const char *proto, const char *data) |
const char *proto, const char *data) |
{ |
{ |
unsigned int data_len = (unsigned int) strlen(data) / 2; |
u_int data_len = (u_int) strlen(data) / 2; |
unsigned int i, value; |
u_int i, value; |
char *new_data; |
char *new_data; |
int screen_number; |
int screen_number; |
const char *cp; |
const char *cp; |
|
|
/* Convert the fake data into hex. */ |
/* Convert the fake data into hex. */ |
new_data = xmalloc(2 * data_len + 1); |
new_data = xmalloc(2 * data_len + 1); |
for (i = 0; i < data_len; i++) |
for (i = 0; i < data_len; i++) |
sprintf(new_data + 2 * i, "%02x", (unsigned char) x11_fake_data[i]); |
sprintf(new_data + 2 * i, "%02x", (u_char) x11_fake_data[i]); |
|
|
/* Send the request packet. */ |
/* Send the request packet. */ |
if (compat20) { |
if (compat20) { |