]> git.sesse.net Git - rdpsrv/commitdiff
Various changes to try to work better with MS RDC (no big luck)
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 02:20:01 +0000 (02:20 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 02:20:01 +0000 (02:20 +0000)
mcs.c
proto.h
rdp.c

diff --git a/mcs.c b/mcs.c
index d1cbf8c004be9ab4198d71a0cb0f684dc517392f..4a8fc3fd87379284b5ff4add82e2b62f9cd42745 100644 (file)
--- a/mcs.c
+++ b/mcs.c
@@ -155,8 +155,9 @@ void
 mcs_send_connect_response()
 {
        STREAM s;
 mcs_send_connect_response()
 {
        STREAM s;
+       int i;
 
 
-       s = iso_init(80);  // FIXME
+       s = iso_init(92);
 
        ber_out_header(s, MCS_CONNECT_RESPONSE, 80);
        ber_out_header(s, BER_TAG_RESULT, 1);
 
        ber_out_header(s, MCS_CONNECT_RESPONSE, 80);
        ber_out_header(s, BER_TAG_RESULT, 1);
@@ -167,17 +168,21 @@ mcs_send_connect_response()
        
        mcs_out_domain_params(s, 34, 2, 0, 0xffff);  // dumdidum?
 
        
        mcs_out_domain_params(s, 34, 2, 0, 0xffff);  // dumdidum?
 
-       ber_out_header(s, BER_TAG_OCTET_STRING, 28);
+       ber_out_header(s, BER_TAG_OCTET_STRING, 40);
 
        out_uint8s(s, 21);   // ick
        out_uint8(s, 0);
 
 
        out_uint8s(s, 21);   // ick
        out_uint8(s, 0);
 
-       // server info -- we claim to support RDP4
+       // server info -- we claim to support RDP1
        out_uint16_le(s, SEC_TAG_SRV_INFO);
        out_uint16_le(s, 6);  // length
        out_uint16_le(s, 1);
 
        out_uint16_le(s, SEC_TAG_SRV_INFO);
        out_uint16_le(s, 6);  // length
        out_uint16_le(s, 1);
 
-       // aiee, no crypto info yet! :-)
+       // crypto info
+       out_uint16_le(s, SEC_TAG_SRV_CRYPT);
+       out_uint16_le(s, 12); // length
+       out_uint32_le(s, 1); // 40-bit
+       out_uint32_le(s, 0); // no encryption
        
        s_mark_end(s);
        printf("LEN: %u\n", s->p - s->iso_hdr);
        
        s_mark_end(s);
        printf("LEN: %u\n", s->p - s->iso_hdr);
diff --git a/proto.h b/proto.h
index e0e081d01c847655af1fd474c8ac5572ad93f200..d2cf92afd29b65947a28e8d997af830ed111cfa8 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -65,8 +65,7 @@ void rdp5_process(STREAM s, BOOL encryption);
 /* rdp.c */
 STREAM rdp_recv(uint8 * type);
 void rdp_out_unistr(STREAM s, char *string, int len);
 /* rdp.c */
 STREAM rdp_recv(uint8 * type);
 void rdp_out_unistr(STREAM s, char *string, int len);
-void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1,
-                   uint16 param2);
+void rdp_recv_input(STREAM s, uint32 *time, uint16 *message_type, uint16 *device_flags, uint16 *param1, uint16 *param2);
 void process_colour_pointer_pdu(STREAM s);
 void process_cached_pointer_pdu(STREAM s);
 void process_system_pointer_pdu(STREAM s);
 void process_colour_pointer_pdu(STREAM s);
 void process_cached_pointer_pdu(STREAM s);
 void process_system_pointer_pdu(STREAM s);
diff --git a/rdp.c b/rdp.c
index f7fac2dd83a858d77f24dbe00df1721e14749fb5..ff302fbd84737c8aeff707dd6369511da93ea122 100644 (file)
--- a/rdp.c
+++ b/rdp.c
@@ -260,25 +260,15 @@ rdp_send_synchronise(void)
        rdp_send_data(s, RDP_DATA_PDU_SYNCHRONISE);
 }
 
        rdp_send_data(s, RDP_DATA_PDU_SYNCHRONISE);
 }
 
-/* Send a single input event */
+/* Receive a single input event */
 void
 void
-rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
+rdp_recv_input(STREAM s, uint32 *time, uint16 *message_type, uint16 *device_flags, uint16 *param1, uint16 *param2)
 {
 {
-       STREAM s;
-
-       s = rdp_init_data(16);
-
-       out_uint16_le(s, 1);    /* number of events */
-       out_uint16(s, 0);       /* pad */
-
-       out_uint32_le(s, time);
-       out_uint16_le(s, message_type);
-       out_uint16_le(s, device_flags);
-       out_uint16_le(s, param1);
-       out_uint16_le(s, param2);
-
-       s_mark_end(s);
-       rdp_send_data(s, RDP_DATA_PDU_INPUT);
+       in_uint32_le(s, time);
+       in_uint16_le(s, message_type);
+       in_uint16_le(s, device_flags);
+       in_uint16_le(s, param1);
+       in_uint16_le(s, param2);
 }
 
 /* Disconnect from the RDP layer */
 }
 
 /* Disconnect from the RDP layer */