From 63fa9a9043d4a58ee7994e669bcc566f09bc9e9b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 4 Feb 2005 01:19:57 +0000 Subject: [PATCH] Change RDP version to v1, to get simpler login packets. Notice login packets. --- mcs.c | 4 ++-- rdp.c | 2 +- secure.c | 18 ++++++++++++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/mcs.c b/mcs.c index e369051..ff2dfdb 100644 --- a/mcs.c +++ b/mcs.c @@ -172,10 +172,10 @@ mcs_send_connect_response() out_uint8s(s, 21); // ick out_uint8(s, 0); - // server info -- we claim to support RDP5 + // server info -- we claim to support RDP4 out_uint16_le(s, SEC_TAG_SRV_INFO); out_uint16_le(s, 6); // length - out_uint16_le(s, 5); + out_uint16_le(s, 1); // aiee, no crypto info yet! :-) diff --git a/rdp.c b/rdp.c index 1663dfd..11ed6f9 100644 --- a/rdp.c +++ b/rdp.c @@ -71,7 +71,7 @@ rdp_recv(uint8 * type) *type = pdu_type & 0xf; #if WITH_DEBUG - DEBUG(("RDP packet #%d, (type %x)\n", ++g_packetno, *type)); + DEBUG(("RDP packet #%d, (type %x, length %u)\n", ++g_packetno, *type, length)); hexdump(g_next_packet, length); #endif /* */ diff --git a/secure.c b/secure.c index fd96936..9147cbc 100644 --- a/secure.c +++ b/secure.c @@ -344,7 +344,7 @@ sec_send_to_channel(STREAM s, uint32 flags, uint16 channel) int datalen; s_pop_layer(s, sec_hdr); - //if (!g_licence_issued || (flags & SEC_ENCRYPT)) +// if (!g_licence_issued || (flags & SEC_ENCRYPT)) out_uint32_le(s, flags); if (flags & SEC_ENCRYPT) @@ -721,23 +721,33 @@ sec_recv(void) while ((s = mcs_recv(&channel)) != NULL) { - if (/*g_encryption || !g_licence_issued*/ 0) + if (/*g_encryption || !g_licence_issued*/ 1) { in_uint32_le(s, sec_flags); - + printf("sec_flags=%x\n", sec_flags); + if (sec_flags & SEC_ENCRYPT) { + printf("encrypt\n"); in_uint8s(s, 8); /* signature */ sec_decrypt(s->p, s->end - s->p); } if (sec_flags & SEC_LICENCE_NEG) { - licence_process(s); + printf("SEC_LICENSE_NEG unknown\n"); + //licence_process(s); continue; } + + if (sec_flags & SEC_LOGON_INFO) + { + printf("Received logon packet!\n"); + + } } + printf("Received MCS data on ch %u\n", channel); if (channel != MCS_GLOBAL_CHANNEL) { channel_process(s, channel); -- 2.39.2