ulab-original
jsorg71 19 years ago
parent a2b270e57a
commit 4f8e2d60ed

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,49 +1,49 @@
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
Generics backingstore operations
Copyright (C) Jay Sorg 2005-2006
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
int bs_get_pixel(int x, int y);
void bs_set_pixel(int x, int y, int pixel, int rop, int use_clip);
int bs_do_rop(int rop, int src, int dst);
void bs_init(void);
void bs_exit(void);
void bs_set_clip(int x, int y, int cx, int cy);
void bs_reset_clip(void);
void bs_set_pixel_on(char * data, int x, int y, int width, int bpp,
int pixel);
int bs_is_pixel_on(char * data, int x, int y, int width, int bpp);
void bs_copy_mem(char * d, char * s, int n);
void bs_copy_memb(char * d, char * s, int n);
int bs_warp_coords(int * x, int * y, int * cx, int * cy,
int * srcx, int * srcy);
void bs_rect(int x, int y, int cx, int cy, int colour, int rop);
void bs_screenblt(int opcode, int x, int y, int cx, int cy,
int srcx, int srcy);
void bs_memblt(int opcode, int x, int y, int cx, int cy,
void * srcdata, int srcwidth, int srcheight,
int srcx, int srcy);
void bs_copy_box(char * dst, int x, int y, int cx, int cy, int line_size);
void bs_draw_glyph(int x, int y, char * glyph_data, int glyph_width,
int glyph_height, int fgcolour);
void bs_line(int opcode, int startx, int starty, int endx, int endy,
int pen_width, int pen_style, int pen_colour);
void bs_patblt(int opcode, int x, int y, int cx, int cy,
int brush_style, char * brush_pattern,
int brush_x_org, int brush_y_org,
int bgcolour, int fgcolour);
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
Generics backingstore operations
Copyright (C) Jay Sorg 2005-2006
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
int bs_get_pixel(int x, int y);
void bs_set_pixel(int x, int y, int pixel, int rop, int use_clip);
int bs_do_rop(int rop, int src, int dst);
void bs_init(void);
void bs_exit(void);
void bs_set_clip(int x, int y, int cx, int cy);
void bs_reset_clip(void);
void bs_set_pixel_on(char * data, int x, int y, int width, int bpp,
int pixel);
int bs_is_pixel_on(char * data, int x, int y, int width, int bpp);
void bs_copy_mem(char * d, char * s, int n);
void bs_copy_memb(char * d, char * s, int n);
int bs_warp_coords(int * x, int * y, int * cx, int * cy,
int * srcx, int * srcy);
void bs_rect(int x, int y, int cx, int cy, int colour, int rop);
void bs_screenblt(int opcode, int x, int y, int cx, int cy,
int srcx, int srcy);
void bs_memblt(int opcode, int x, int y, int cx, int cy,
void * srcdata, int srcwidth, int srcheight,
int srcx, int srcy);
void bs_copy_box(char * dst, int x, int y, int cx, int cy, int line_size);
void bs_draw_glyph(int x, int y, char * glyph_data, int glyph_width,
int glyph_height, int fgcolour);
void bs_line(int opcode, int startx, int starty, int endx, int endy,
int pen_width, int pen_style, int pen_colour);
void bs_patblt(int opcode, int x, int y, int cx, int cy,
int brush_style, char * brush_pattern,
int brush_x_org, int brush_y_org,
int bgcolour, int fgcolour);

@ -192,7 +192,7 @@ enum RDP_INPUT_DEVICE
/* Raster operation masks */
#define ROP2_S(rop3) ((uint8) (rop3 & 0xf))
#define ROP2_P(rop3) ((uint8) ((rop3 & 0x3) | ((rop3 & 0x30) >> 2)))
#define ROP2_P(rop3) ((uint8) ((rop3 & 0x3) | ((rop3 & 0x30) >> 2)))
#define ROP_MINUS_1(rop) ((uint8) (rop - 1))
#define ROP2_COPY 0xc
@ -355,21 +355,21 @@ enum RDP_INPUT_DEVICE
#define CHANNEL_OPTION_COMPRESS_RDP 0x00800000
#define CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000
/* NT status codes for RDPDR */
/* NT status codes for RDPDR */
#undef STATUS_SUCCESS
#define STATUS_SUCCESS 0x00000000
#define STATUS_SUCCESS 0x00000000
#undef STATUS_NOT_IMPLEMENTED
#define STATUS_NOT_IMPLEMENTED 0x00000001
#undef STATUS_PENDING
#undef STATUS_PENDING
#define STATUS_PENDING 0x00000103
#ifndef STATUS_NO_MORE_FILES
#ifndef STATUS_NO_MORE_FILES
#define STATUS_NO_MORE_FILES 0x80000006
#define STATUS_DEVICE_PAPER_EMPTY 0x8000000e
#define STATUS_DEVICE_POWERED_OFF 0x8000000f
#define STATUS_DEVICE_OFF_LINE 0x80000010
#define STATUS_DEVICE_BUSY 0x80000011
#endif
#endif
#ifndef STATUS_INVALID_HANDLE
#define STATUS_INVALID_HANDLE 0xc0000008

@ -1,8 +1,8 @@
[main]
server=192.168.1.1
port=3389
username=user1
password=password1
bpp=16
#geometry=300x400
fullscreen
[main]
server=192.168.1.1
port=3389
username=user1
password=password1
bpp=16
#geometry=300x400
fullscreen

@ -20,19 +20,19 @@
#include "rdesktop.h"
//#include <openssl/rc4.h>
void *
ssl_rc4_info_create(void);
void
ssl_rc4_info_delete(void * rc4_info);
void
ssl_rc4_set_key(void * rc4_info, char * key, int len);
void
ssl_rc4_crypt(void * rc4_info, char * in_data, char * out_data, int len);
int
ssl_mod_exp(char* out, int out_len, char* in, int in_len,
char* mod, int mod_len, char* exp, int exp_len);
void *
ssl_rc4_info_create(void);
void
ssl_rc4_info_delete(void * rc4_info);
void
ssl_rc4_set_key(void * rc4_info, char * key, int len);
void
ssl_rc4_crypt(void * rc4_info, char * in_data, char * out_data, int len);
int
ssl_mod_exp(char* out, int out_len, char* in, int in_len,
char* mod, int mod_len, char* exp, int exp_len);
extern char g_username[64];
extern char g_hostname[16];
@ -172,11 +172,11 @@ licence_process_demand(STREAM s)
licence_generate_hwid(hwid);
sec_sign(signature, 16, g_licence_sign_key, 16, hwid, sizeof(hwid));
/* Now encrypt the HWID */
crypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(crypt_key, g_licence_key, 16);
ssl_rc4_crypt(crypt_key, hwid, hwid, sizeof(hwid));
ssl_rc4_info_delete(crypt_key);
/* Now encrypt the HWID */
crypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(crypt_key, g_licence_key, 16);
ssl_rc4_crypt(crypt_key, hwid, hwid, sizeof(hwid));
ssl_rc4_info_delete(crypt_key);
licence_present(null_data, null_data, licence_data, licence_size, hwid, signature);
xfree(licence_data);
@ -251,11 +251,11 @@ licence_process_authreq(STREAM s)
memcpy(out_token, in_token, LICENCE_TOKEN_SIZE);
/* Decrypt the token. It should read TEST in Unicode. */
crypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(crypt_key, g_licence_key, 16);
ssl_rc4_crypt(crypt_key, in_token, decrypt_token, LICENCE_TOKEN_SIZE);
ssl_rc4_info_delete(crypt_key);
crypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(crypt_key, g_licence_key, 16);
ssl_rc4_crypt(crypt_key, in_token, decrypt_token, LICENCE_TOKEN_SIZE);
ssl_rc4_info_delete(crypt_key);
/* Generate a signature for a buffer of token and HWID */
licence_generate_hwid(hwid);
memcpy(sealed_buffer, decrypt_token, LICENCE_TOKEN_SIZE);
@ -263,11 +263,11 @@ licence_process_authreq(STREAM s)
sec_sign(out_sig, 16, g_licence_sign_key, 16, sealed_buffer, sizeof(sealed_buffer));
/* Now encrypt the HWID */
crypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(crypt_key, g_licence_key, 16);
ssl_rc4_crypt(crypt_key, hwid, crypt_hwid, LICENCE_HWID_SIZE);
ssl_rc4_info_delete(crypt_key);
crypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(crypt_key, g_licence_key, 16);
ssl_rc4_crypt(crypt_key, hwid, crypt_hwid, LICENCE_HWID_SIZE);
ssl_rc4_info_delete(crypt_key);
licence_send_authresp(out_token, crypt_hwid, out_sig);
}
@ -285,11 +285,11 @@ licence_process_issue(STREAM s)
if (!s_check_rem(s, length))
return;
crypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(crypt_key, g_licence_key, 16);
ssl_rc4_crypt(crypt_key, s->p, s->p, length);
ssl_rc4_info_delete(crypt_key);
crypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(crypt_key, g_licence_key, 16);
ssl_rc4_crypt(crypt_key, s->p, s->p, length);
ssl_rc4_info_delete(crypt_key);
in_uint16(s, check);
if (check != 0)
return;

@ -1,19 +1,19 @@
# makefile
OBJS = tcp.obj iso.obj mcs.obj secure.obj rdp.obj rdp5.obj orders.obj \
bitmap.obj cache.obj mppc.obj pstcache.obj channels.obj licence.obj \
ssl_calls.obj
UIOBJS = uimain.obj bsops.obj win32.obj
#-w-aus -w-rch
CFLAGS = -O2 -w-par -I.. -Ic:\borland\bcc55\include
LDFLAGS = -W -Lc:\borland\bcc55\lib
all: rd
rd: $(OBJS) $(UIOBJS)
$(CC) -ewinrdesktop.exe $(LDFLAGS) $(OBJS) $(UIOBJS)
clean:
del /q $(OBJS) $(UIOBJS) winrdesktop.exe *.tds
# makefile
OBJS = tcp.obj iso.obj mcs.obj secure.obj rdp.obj rdp5.obj orders.obj \
bitmap.obj cache.obj mppc.obj pstcache.obj channels.obj licence.obj \
ssl_calls.obj
UIOBJS = uimain.obj bsops.obj win32.obj
#-w-aus -w-rch
CFLAGS = -O2 -w-par -I.. -Ic:\borland\bcc55\include
LDFLAGS = -W -Lc:\borland\bcc55\lib
all: rd
rd: $(OBJS) $(UIOBJS)
$(CC) -ewinrdesktop.exe $(LDFLAGS) $(OBJS) $(UIOBJS)
clean:
del /q $(OBJS) $(UIOBJS) winrdesktop.exe *.tds

@ -107,7 +107,7 @@ pstcache_save_bitmap(uint8 cache_id, uint16 cache_idx, uint8 * key,
int
pstcache_enumerate(uint8 id, HASH_KEY * keylist)
{
int fd, n;
int fd, n;
uint16 idx;
sint16 mru_idx[0xa00];
uint32 mru_stamp[0xa00];

@ -20,22 +20,22 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef _WIN32
#include <winsock2.h> /* winsock2.h first */
#include <windows.h>
#include <time.h>
#else /* WIN32 */
#include <dirent.h>
#include <sys/types.h>
#include <sys/time.h>
#include <string.h>
#ifdef _WIN32
#include <winsock2.h> /* winsock2.h first */
#include <windows.h>
#include <time.h>
#else /* WIN32 */
#include <dirent.h>
#include <sys/types.h>
#include <sys/time.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#else /* HAVE_SYS_SELECT_H */
#include <sys/types.h>
#include <unistd.h>
#endif /* HAVE_SYS_SELECT_H */
#endif /* WIN32 */
#endif /* WIN32 */
#include <limits.h> /* PATH_MAX */
#define VERSION "1.4.1"

File diff suppressed because it is too large Load Diff

@ -24,44 +24,44 @@
//#include <openssl/md5.h>
//#include <openssl/sha.h>
//#include <openssl/bn.h>
//#include <openssl/x509v3.h>
void *
ssl_sha1_info_create(void);
void
ssl_sha1_info_delete(void * sha1_info);
void
ssl_sha1_clear(void * sha1_info);
void
ssl_sha1_transform(void * sha1_info, char * data, int len);
void
ssl_sha1_complete(void * sha1_info, char * data);
void *
ssl_md5_info_create(void);
void
ssl_md5_info_delete(void * md5_info);
void *
ssl_md5_info_create(void);
void
ssl_md5_info_delete(void * md5_info);
void
ssl_md5_clear(void * md5_info);
void
ssl_md5_transform(void * md5_info, char * data, int len);
void
ssl_md5_complete(void * md5_info, char * data);
void *
ssl_rc4_info_create(void);
void
ssl_rc4_info_delete(void * rc4_info);
void
ssl_rc4_set_key(void * rc4_info, char * key, int len);
void
ssl_rc4_crypt(void * rc4_info, char * in_data, char * out_data, int len);
int
ssl_mod_exp(char* out, int out_len, char* in, int in_len,
char* mod, int mod_len, char* exp, int exp_len);
//#include <openssl/x509v3.h>
void *
ssl_sha1_info_create(void);
void
ssl_sha1_info_delete(void * sha1_info);
void
ssl_sha1_clear(void * sha1_info);
void
ssl_sha1_transform(void * sha1_info, char * data, int len);
void
ssl_sha1_complete(void * sha1_info, char * data);
void *
ssl_md5_info_create(void);
void
ssl_md5_info_delete(void * md5_info);
void *
ssl_md5_info_create(void);
void
ssl_md5_info_delete(void * md5_info);
void
ssl_md5_clear(void * md5_info);
void
ssl_md5_transform(void * md5_info, char * data, int len);
void
ssl_md5_complete(void * md5_info, char * data);
void *
ssl_rc4_info_create(void);
void
ssl_rc4_info_delete(void * rc4_info);
void
ssl_rc4_set_key(void * rc4_info, char * key, int len);
void
ssl_rc4_crypt(void * rc4_info, char * in_data, char * out_data, int len);
int
ssl_mod_exp(char* out, int out_len, char* in, int in_len,
char* mod, int mod_len, char* exp, int exp_len);
extern char g_hostname[16];
extern int g_width;
extern int g_height;
@ -82,7 +82,7 @@ static int rc4_key_len;
static void * rc4_decrypt_key = 0;
static void * rc4_encrypt_key = 0;
//static RSA *server_public_key;
static void * server_public_key;
static void * server_public_key;
static uint8 sec_sign_key[16];
static uint8 sec_decrypt_key[16];
@ -123,19 +123,19 @@ sec_hash_48(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2, uint8 salt)
for (i = 0; i < 3; i++)
{
memset(pad, salt + i, i + 1);
sha = ssl_sha1_info_create();
ssl_sha1_clear(sha);
ssl_sha1_transform(sha, pad, i + 1);
ssl_sha1_transform(sha, in, 48);
ssl_sha1_transform(sha, salt1, 32);
ssl_sha1_transform(sha, salt2, 32);
ssl_sha1_complete(sha, shasig);
ssl_sha1_info_delete(sha);
md5 = ssl_md5_info_create();
ssl_md5_clear(md5);
ssl_md5_transform(md5, in, 48);
ssl_md5_transform(md5, shasig, 20);
ssl_md5_complete(md5, out + i * 16);
sha = ssl_sha1_info_create();
ssl_sha1_clear(sha);
ssl_sha1_transform(sha, pad, i + 1);
ssl_sha1_transform(sha, in, 48);
ssl_sha1_transform(sha, salt1, 32);
ssl_sha1_transform(sha, salt2, 32);
ssl_sha1_complete(sha, shasig);
ssl_sha1_info_delete(sha);
md5 = ssl_md5_info_create();
ssl_md5_clear(md5);
ssl_md5_transform(md5, in, 48);
ssl_md5_transform(md5, shasig, 20);
ssl_md5_complete(md5, out + i * 16);
ssl_md5_info_delete(md5);
}
}
@ -147,13 +147,13 @@ void
sec_hash_16(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2)
{
void * md5;
md5 = ssl_md5_info_create();
ssl_md5_clear(md5);
md5 = ssl_md5_info_create();
ssl_md5_clear(md5);
ssl_md5_transform(md5, in, 16);
ssl_md5_transform(md5, salt1, 32);
ssl_md5_transform(md5, salt2, 32);
ssl_md5_complete(md5, out);
ssl_md5_transform(md5, salt2, 32);
ssl_md5_complete(md5, out);
ssl_md5_info_delete(md5);
}
@ -207,15 +207,15 @@ sec_generate_keys(uint8 * client_random, uint8 * server_random, int rc4_key_size
memcpy(sec_decrypt_update_key, sec_decrypt_key, 16);
memcpy(sec_encrypt_update_key, sec_encrypt_key, 16);
/* Initialise RC4 state arrays */
ssl_rc4_info_delete(rc4_decrypt_key);
rc4_decrypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(rc4_decrypt_key, sec_decrypt_key, rc4_key_len);
/* Initialise RC4 state arrays */
ssl_rc4_info_delete(rc4_decrypt_key);
rc4_decrypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(rc4_decrypt_key, sec_decrypt_key, rc4_key_len);
ssl_rc4_info_delete(rc4_encrypt_key);
rc4_encrypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(rc4_encrypt_key, sec_encrypt_key, rc4_key_len);
ssl_rc4_info_delete(rc4_encrypt_key);
rc4_encrypt_key = ssl_rc4_info_create();
ssl_rc4_set_key(rc4_encrypt_key, sec_encrypt_key, rc4_key_len);
}
static uint8 pad_54[40] = {
@ -254,23 +254,23 @@ sec_sign(uint8 * signature, int siglen, uint8 * session_key, int keylen, uint8 *
buf_out_uint32(lenhdr, datalen);
sha = ssl_sha1_info_create();
ssl_sha1_clear(sha);
ssl_sha1_transform(sha, session_key, keylen);
ssl_sha1_transform(sha, pad_54, 40);
ssl_sha1_transform(sha, lenhdr, 4);
ssl_sha1_transform(sha, data, datalen);
ssl_sha1_complete(sha, shasig);
ssl_sha1_info_delete(sha);
md5 = ssl_md5_info_create();
ssl_md5_clear(md5);
ssl_md5_transform(md5, session_key, keylen);
ssl_md5_transform(md5, pad_92, 48);
ssl_md5_transform(md5, shasig, 20);
ssl_md5_complete(md5, md5sig);
ssl_md5_info_delete(md5);
sha = ssl_sha1_info_create();
ssl_sha1_clear(sha);
ssl_sha1_transform(sha, session_key, keylen);
ssl_sha1_transform(sha, pad_54, 40);
ssl_sha1_transform(sha, lenhdr, 4);
ssl_sha1_transform(sha, data, datalen);
ssl_sha1_complete(sha, shasig);
ssl_sha1_info_delete(sha);
md5 = ssl_md5_info_create();
ssl_md5_clear(md5);
ssl_md5_transform(md5, session_key, keylen);
ssl_md5_transform(md5, pad_92, 48);
ssl_md5_transform(md5, shasig, 20);
ssl_md5_complete(md5, md5sig);
ssl_md5_info_delete(md5);
memcpy(signature, md5sig, siglen);
}
@ -282,29 +282,29 @@ sec_update(uint8 * key, uint8 * update_key)
void * sha;
void * md5;
void * update;
sha = ssl_sha1_info_create();
ssl_sha1_clear(sha);
ssl_sha1_transform(sha, update_key, rc4_key_len);
ssl_sha1_transform(sha, pad_54, 40);
ssl_sha1_transform(sha, key, rc4_key_len);
ssl_sha1_complete(sha, shasig);
ssl_sha1_info_delete(sha);
md5 = ssl_md5_info_create();
ssl_md5_clear(md5);
ssl_md5_transform(md5, update_key, rc4_key_len);
ssl_md5_transform(md5, pad_92, 48);
ssl_md5_transform(md5, shasig, 20);
ssl_md5_complete(md5, key);
ssl_md5_info_delete(md5);
update = ssl_rc4_info_create();
ssl_rc4_set_key(update, key, rc4_key_len);
ssl_rc4_crypt(update, key, key, rc4_key_len);
ssl_rc4_info_delete(update);
sha = ssl_sha1_info_create();
ssl_sha1_clear(sha);
ssl_sha1_transform(sha, update_key, rc4_key_len);
ssl_sha1_transform(sha, pad_54, 40);
ssl_sha1_transform(sha, key, rc4_key_len);
ssl_sha1_complete(sha, shasig);
ssl_sha1_info_delete(sha);
md5 = ssl_md5_info_create();
ssl_md5_clear(md5);
ssl_md5_transform(md5, update_key, rc4_key_len);
ssl_md5_transform(md5, pad_92, 48);
ssl_md5_transform(md5, shasig, 20);
ssl_md5_complete(md5, key);
ssl_md5_info_delete(md5);
update = ssl_rc4_info_create();
ssl_rc4_set_key(update, key, rc4_key_len);
ssl_rc4_crypt(update, key, key, rc4_key_len);
ssl_rc4_info_delete(update);
if (rc4_key_len == 8)
sec_make_40bit(key);
}
@ -315,7 +315,7 @@ sec_encrypt(uint8 * data, int length)
{
if (sec_encrypt_use_count == 4096)
{
sec_update(sec_encrypt_key, sec_encrypt_update_key);
sec_update(sec_encrypt_key, sec_encrypt_update_key);
ssl_rc4_set_key(rc4_encrypt_key, sec_encrypt_key, rc4_key_len);
sec_encrypt_use_count = 0;
}
@ -330,10 +330,10 @@ sec_decrypt(uint8 * data, int length)
if (sec_decrypt_use_count == 4096)
{
sec_update(sec_decrypt_key, sec_decrypt_update_key);
ssl_rc4_set_key(rc4_decrypt_key, sec_decrypt_key, rc4_key_len);
ssl_rc4_set_key(rc4_decrypt_key, sec_decrypt_key, rc4_key_len);
sec_decrypt_use_count = 0;
}
ssl_rc4_crypt(rc4_decrypt_key, data, data, length);
ssl_rc4_crypt(rc4_decrypt_key, data, data, length);
sec_decrypt_use_count++;
}
@ -354,8 +354,8 @@ reverse(uint8 * p, int len)
/* Perform an RSA public key encryption operation */
static void
sec_rsa_encrypt(uint8 * out, uint8 * in, int len, uint8 * modulus, uint8 * exponent)
{
ssl_mod_exp(out, 64, in, 32, modulus, 64, exponent, 4);
{
ssl_mod_exp(out, 64, in, 32, modulus, 64, exponent, 4);
/*
BN_CTX *ctx;
BIGNUM mod, exp, x, y;
@ -578,7 +578,7 @@ sec_parse_public_key(STREAM s, uint8 ** modulus, uint8 ** exponent)
return s_check(s);
}
/* Parse a crypto information structure */
static BOOL
sec_parse_crypt_info(STREAM s, uint32 * rc4_key_size,
@ -647,7 +647,7 @@ sec_parse_crypt_info(STREAM s, uint32 * rc4_key_size,
}
}
else
{
{
#if 0
uint32 certcount;
@ -737,7 +737,7 @@ sec_parse_crypt_info(STREAM s, uint32 * rc4_key_size,
}
X509_free(server_cert);
return True; /* There's some garbage here we don't care about */
#endif
#endif
}
return s_check_end(s);
}
@ -783,7 +783,7 @@ sec_process_crypt_info(STREAM s)
reverse(sec_crypted_random, SEC_MODULUS_SIZE);
RSA_free(server_public_key);
server_public_key = NULL;
server_public_key = NULL;
#endif
}
else

@ -18,30 +18,30 @@
ssl calls
*/
*/
#include "rdesktop.h"
#define APP_CC
/*****************************************************************************/
static void * g_malloc(int size, int zero)
{
void * p;
p = xmalloc(size);
if (zero)
{
memset(p, 0, size);
}
return p;
}
/*****************************************************************************/
static void g_free(void * in)
{
xfree(in);
}
#define APP_CC
/*****************************************************************************/
static void * g_malloc(int size, int zero)
{
void * p;
p = xmalloc(size);
if (zero)
{
memset(p, 0, size);
}
return p;
}
/*****************************************************************************/
static void g_free(void * in)
{
xfree(in);
}
/*****************************************************************************/
/*****************************************************************************/

@ -28,22 +28,22 @@
#include <arpa/inet.h> /* inet_addr */
#include <errno.h> /* errno */
#endif /* _WIN32 */
#include "rdesktop.h"
#ifdef _WIN32
#define socklen_t int
#define TCP_CLOSE(_sck) closesocket(_sck)
#define TCP_STRERROR "tcp error"
#define TCP_SLEEP(_n) Sleep(_n)
#define TCP_BLOCKS (WSAGetLastError() == WSAEWOULDBLOCK)
#else /* _WIN32 */
#define TCP_CLOSE(_sck) close(_sck)
#define TCP_STRERROR strerror(errno)
#define TCP_SLEEP(_n) sleep(_n)
#define TCP_BLOCKS (errno == EWOULDBLOCK)
#endif /* _WIN32 */
#include "rdesktop.h"
#ifdef _WIN32
#define socklen_t int
#define TCP_CLOSE(_sck) closesocket(_sck)
#define TCP_STRERROR "tcp error"
#define TCP_SLEEP(_n) Sleep(_n)
#define TCP_BLOCKS (WSAGetLastError() == WSAEWOULDBLOCK)
#else /* _WIN32 */
#define TCP_CLOSE(_sck) close(_sck)
#define TCP_STRERROR strerror(errno)
#define TCP_SLEEP(_n) sleep(_n)
#define TCP_BLOCKS (errno == EWOULDBLOCK)
#endif /* _WIN32 */
#ifndef INADDR_NONE
#define INADDR_NONE ((unsigned long) -1)
#endif

@ -251,7 +251,7 @@ NOTIFY;
#ifndef PATH_MAX
#define PATH_MAX 256
#endif
#ifndef _WIN32
typedef struct fileinfo
{
@ -264,7 +264,7 @@ typedef struct fileinfo
NOTIFY notify;
uint32 info_class;
}
FILEINFO;
FILEINFO;
#endif
typedef BOOL(*str_handle_lines_t) (const char *line, void *data);

File diff suppressed because it is too large Load Diff

@ -1,83 +1,85 @@
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
main ui header
Copyright (C) Jay Sorg 2005-2006
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* in uimain.c */
int
ui_main(void);
void
ui_invalidate(int x, int y, int cx, int cy);
int
ui_read_wire(void);
void
ui_mouse_move(int x, int y);
void
ui_mouse_button(int button, int x, int y, int down);
void
ui_key_down(int key, int ext);
void
ui_key_up(int key, int ext);
void
ui_set_modifier_state(int code);
#define SPLIT_COLOUR15(c, r, g, b) \
{ \
r = ((c >> 7) & 0xf8) | ((c >> 12) & 0x7); \
g = ((c >> 2) & 0xf8) | ((c >> 8) & 0x7); \
b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
}
#define SPLIT_COLOUR16(c, r, g, b) \
{ \
r = ((c >> 8) & 0xf8) | ((c >> 13) & 0x7); \
g = ((c >> 3) & 0xfc) | ((c >> 9) & 0x3); \
b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
}
#define SPLIT_COLOUR32(c, r, g, b) \
{ \
r = ((c >> 0) & 0xff); \
g = ((c >> 8) & 0xff); \
b = ((c >> 16) & 0xff); \
}
#define MAKE_COLOUR15(c, r, g, b) \
{ \
c = ( \
(((r & 0xff) >> 3) << 10) | \
(((g & 0xff) >> 3) << 5) | \
(((b & 0xff) >> 3) << 0) \
); \
}
#define MAKE_COLOUR32(c, r, g, b) \
{ \
c = ( \
((r & 0xff) << 16) | \
((g & 0xff) << 8) | \
((b & 0xff) << 0) \
); \
}
#undef UI_MAX
#define UI_MAX(a, b) (((a) > (b)) ? (a) : (b))
#undef UI_MIN
#define UI_MIN(a, b) (((a) < (b)) ? (a) : (b))
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
main ui header
Copyright (C) Jay Sorg 2005-2006
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* in uimain.c */
int
ui_main(void);
void
ui_invalidate(int x, int y, int cx, int cy);
int
ui_read_wire(void);
void
ui_mouse_move(int x, int y);
void
ui_mouse_button(int button, int x, int y, int down);
void
ui_key_down(int key, int ext);
void
ui_key_up(int key, int ext);
void
ui_set_modifier_state(int code);
#define SPLIT_COLOUR15(c, r, g, b) \
{ \
r = ((c >> 7) & 0xf8) | ((c >> 12) & 0x7); \
g = ((c >> 2) & 0xf8) | ((c >> 8) & 0x7); \
b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
}
#define SPLIT_COLOUR16(c, r, g, b) \
{ \
r = ((c >> 8) & 0xf8) | ((c >> 13) & 0x7); \
g = ((c >> 3) & 0xfc) | ((c >> 9) & 0x3); \
b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
}
#define SPLIT_COLOUR32(c, r, g, b) \
{ \
r = ((c >> 0) & 0xff); \
g = ((c >> 8) & 0xff); \
b = ((c >> 16) & 0xff); \
}
#define MAKE_COLOUR15(c, r, g, b) \
{ \
c = ( \
(((r & 0xff) >> 3) << 10) | \
(((g & 0xff) >> 3) << 5) | \
(((b & 0xff) >> 3) << 0) \
); \
}
#define MAKE_COLOUR32(c, r, g, b) \
{ \
c = ( \
((r & 0xff) << 16) | \
((g & 0xff) << 8) | \
((b & 0xff) << 0) \
); \
}
#undef UI_MAX
#define UI_MAX(a, b) (((a) > (b)) ? (a) : (b))
#undef UI_MIN
#define UI_MIN(a, b) (((a) < (b)) ? (a) : (b))

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save