|
|
@ -64,7 +64,7 @@ lib_recv(struct vnc* v, char* data, int len)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC lib_recv return 1");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC lib_recv return 1");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -202,14 +202,14 @@ lib_process_channel_data(struct vnc* v, int chanid, int flags, int size,
|
|
|
|
free_stream(out_s);
|
|
|
|
free_stream(out_s);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:{
|
|
|
|
default:{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC clip information unhandled");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC clip information unhandled");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"lib_process_channel_data: unknown chanid:",
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "lib_process_channel_data: unknown chanid:",
|
|
|
|
"%d :(v->clip_chanid) %d",chanid,v->clip_chanid);
|
|
|
|
"%d :(v->clip_chanid) %d",chanid,v->clip_chanid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -387,7 +387,7 @@ get_pixel_safe(char* data, int x, int y, int width, int height, int bpp)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_ERROR,"error in get_pixel_safe bpp %d", bpp);
|
|
|
|
log_message(LOG_LEVEL_ERROR, "error in get_pixel_safe bpp %d", bpp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -442,7 +442,7 @@ set_pixel_safe(char* data, int x, int y, int width, int height, int bpp,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_ERROR,"error in set_pixel_safe bpp %d", bpp);
|
|
|
|
log_message(LOG_LEVEL_ERROR, "error in set_pixel_safe bpp %d", bpp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -479,7 +479,7 @@ split_color(int pixel, int* r, int* g, int* b, int bpp, int* palette)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_ERROR,"error in split_color bpp %d", bpp);
|
|
|
|
log_message(LOG_LEVEL_ERROR, "error in split_color bpp %d", bpp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -494,7 +494,7 @@ make_color(int r, int g, int b, int bpp)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_ERROR,"error in make_color bpp %d", bpp);
|
|
|
|
log_message(LOG_LEVEL_ERROR, "error in make_color bpp %d", bpp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -796,7 +796,7 @@ lib_mod_signal(struct vnc* v)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (type == 3) /* clipboard */
|
|
|
|
else if (type == 3) /* clipboard */
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC got clip data");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC got clip data");
|
|
|
|
error = lib_clip_data(v);
|
|
|
|
error = lib_clip_data(v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -859,8 +859,8 @@ lib_mod_connect(struct vnc* v)
|
|
|
|
if ((v->server_bpp != 8) && (v->server_bpp != 15) &&
|
|
|
|
if ((v->server_bpp != 8) && (v->server_bpp != 15) &&
|
|
|
|
(v->server_bpp != 16) && (v->server_bpp != 24))
|
|
|
|
(v->server_bpp != 16) && (v->server_bpp != 24))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
v->server_msg(v, "VNC error - only supporting 8, 15, 16 and 24 bpp rdp \
|
|
|
|
v->server_msg(v, "VNC error - only supporting 8, 15, 16 and 24 bpp rdp "
|
|
|
|
connections", 0);
|
|
|
|
"connections", 0);
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (g_strcmp(v->ip, "") == 0)
|
|
|
|
if (g_strcmp(v->ip, "") == 0)
|
|
|
@ -912,24 +912,24 @@ connections", 0);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rfbEncryptBytes(s->data, v->password);
|
|
|
|
rfbEncryptBytes(s->data, v->password);
|
|
|
|
error = lib_send(v, s->data, 16);
|
|
|
|
error = lib_send(v, s->data, 16);
|
|
|
|
check_sec_result = 1 ; // not needed
|
|
|
|
check_sec_result = 1; // not needed
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(i==0)
|
|
|
|
else if (i == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC Server will disconnect");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC Server will disconnect");
|
|
|
|
error = 1;
|
|
|
|
error = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC unsupported security level");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC unsupported security level");
|
|
|
|
error = 1;
|
|
|
|
error = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (error!=0)
|
|
|
|
if (error!=0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC Error after security negotiation");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC Error after security negotiation");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (error == 0 && check_sec_result)
|
|
|
|
if (error == 0 && check_sec_result)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -959,7 +959,7 @@ connections", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC error before sending share flag");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC error before sending share flag");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (error == 0)
|
|
|
|
if (error == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -968,7 +968,7 @@ connections", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC error before receiving server init");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC error before receiving server init");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (error == 0)
|
|
|
|
if (error == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -980,7 +980,7 @@ connections", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC error before receiving pixel format");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC error before receiving pixel format");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (error == 0)
|
|
|
|
if (error == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -991,7 +991,7 @@ connections", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC error before receiving name length");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC error before receiving name length");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (error == 0)
|
|
|
|
if (error == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1009,7 +1009,7 @@ connections", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC error before receiving name");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC error before receiving name");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* should be connected */
|
|
|
|
/* should be connected */
|
|
|
|
if (error == 0)
|
|
|
|
if (error == 0)
|
|
|
@ -1268,7 +1268,7 @@ mod_init(void)
|
|
|
|
int EXPORT_CC
|
|
|
|
int EXPORT_CC
|
|
|
|
mod_exit(struct vnc* v)
|
|
|
|
mod_exit(struct vnc* v)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"VNC mod_exit");
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "VNC mod_exit");
|
|
|
|
if (v == 0)
|
|
|
|
if (v == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|