38 |
uint8 *g_next_packet; |
uint8 *g_next_packet; |
39 |
uint32 g_rdp_shareid; |
uint32 g_rdp_shareid; |
40 |
|
|
41 |
extern RDPCOMP mppc_dict; |
extern RDPCOMP g_mppc_dict; |
42 |
|
|
43 |
#if WITH_DEBUG |
#if WITH_DEBUG |
44 |
static uint32 g_packetno; |
static uint32 g_packetno; |
176 |
time_t t = time(NULL); |
time_t t = time(NULL); |
177 |
time_t tzone; |
time_t tzone; |
178 |
|
|
179 |
|
#if 0 |
180 |
|
/* enable rdp compression */ |
181 |
|
/* some problems still exist with rdp5 */ |
182 |
|
flags |= RDP_COMPRESSION; |
183 |
|
#endif |
184 |
|
|
185 |
if (!g_use_rdp5 || 1 == g_server_rdp_version) |
if (!g_use_rdp5 || 1 == g_server_rdp_version) |
186 |
{ |
{ |
187 |
DEBUG_RDP5(("Sending RDP4-style Logon packet\n")); |
DEBUG_RDP5(("Sending RDP4-style Logon packet\n")); |
188 |
|
|
|
#if 0 |
|
|
/* enable rdp compression */ |
|
|
/* decompression also works with rdp5 */ |
|
|
/* but there are some unknown opcodes */ |
|
|
flags |= RDP_COMPRESSION; |
|
|
#endif |
|
189 |
s = sec_init(sec_flags, 18 + len_domain + len_user + len_password |
s = sec_init(sec_flags, 18 + len_domain + len_user + len_password |
190 |
+ len_program + len_directory + 10); |
+ len_program + len_directory + 10); |
191 |
|
|
962 |
|
|
963 |
uint32 roff, rlen; |
uint32 roff, rlen; |
964 |
|
|
965 |
struct stream *ns = &(mppc_dict.ns); |
struct stream *ns = &(g_mppc_dict.ns); |
|
uint8 *dict = (mppc_dict.hist); |
|
966 |
|
|
967 |
in_uint8s(s, 6); /* shareid, pad, streamid */ |
in_uint8s(s, 6); /* shareid, pad, streamid */ |
968 |
in_uint16(s, len); |
in_uint16(s, len); |
977 |
if (mppc_expand(s->p, clen, ctype, &roff, &rlen) == -1) |
if (mppc_expand(s->p, clen, ctype, &roff, &rlen) == -1) |
978 |
error("error while decompressing packet\n"); |
error("error while decompressing packet\n"); |
979 |
|
|
980 |
len -= 18; |
//len -= 18; |
|
|
|
|
/* this should never happen */ |
|
|
if (len != rlen) |
|
|
error("decompression error len != rlen\n"); |
|
981 |
|
|
982 |
/* allocate memory and copy the uncompressed data into the temporary stream */ |
/* allocate memory and copy the uncompressed data into the temporary stream */ |
983 |
ns->data = xrealloc(ns->data, len); |
ns->data = xrealloc(ns->data, rlen); |
984 |
|
|
985 |
memcpy((ns->data), (unsigned char *) (mppc_dict.hist + roff), len); |
memcpy((ns->data), (unsigned char *) (g_mppc_dict.hist + roff), rlen); |
986 |
|
|
987 |
ns->size = len; |
ns->size = rlen; |
988 |
ns->end = (ns->data + ns->size); |
ns->end = (ns->data + ns->size); |
989 |
ns->p = ns->data; |
ns->p = ns->data; |
990 |
ns->rdp_hdr = ns->p; |
ns->rdp_hdr = ns->p; |