]> git.sesse.net Git - rdpsrv/commitdiff
Handle MCS_CONNECT_INITIAL.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 3 Feb 2005 23:29:40 +0000 (23:29 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 3 Feb 2005 23:29:40 +0000 (23:29 +0000)
mcs.c
proto.h
rdpsrv.c

diff --git a/mcs.c b/mcs.c
index ac8148b43e16690ede259522354f9bc398c557d6..a9fb3d261bd2955635e1f5bf3bf783fc57217fe7 100644 (file)
--- a/mcs.c
+++ b/mcs.c
@@ -147,46 +147,37 @@ mcs_send_connect_initial(STREAM mcs_data)
 }
 
 /* Expect a MCS_CONNECT_RESPONSE message (ASN.1 BER) */
-static BOOL
-mcs_recv_connect_response(STREAM mcs_data)
+BOOL
+mcs_recv_connect_initial()
 {
        uint8 result;
        int length;
        STREAM s;
+       char *buf;
 
        s = iso_recv();
        if (s == NULL)
                return False;
 
-       ber_parse_header(s, MCS_CONNECT_RESPONSE, &length);
-
-       ber_parse_header(s, BER_TAG_RESULT, &length);
+       ber_parse_header(s, MCS_CONNECT_INITIAL, &length);
+       printf("parsing MCS_CONNECT_INITIAL (len=%u)\n", length);
+       ber_parse_header(s, BER_TAG_OCTET_STRING, &length);   /* calling domain */
+       in_uint8(s, result);
+       ber_parse_header(s, BER_TAG_OCTET_STRING, &length);   /* called domain */
+       in_uint8(s, result);
+       
+       ber_parse_header(s, BER_TAG_BOOLEAN, &length);
        in_uint8(s, result);
-       if (result != 0)
-       {
-               error("MCS connect: %d\n", result);
-               return False;
-       }
 
-       ber_parse_header(s, BER_TAG_INTEGER, &length);
-       in_uint8s(s, length);   /* connect id */
+       mcs_parse_domain_params(s);
+       mcs_parse_domain_params(s);
        mcs_parse_domain_params(s);
 
        ber_parse_header(s, BER_TAG_OCTET_STRING, &length);
+       in_uint8p(s, buf, length);
 
-       sec_process_mcs_data(s);
-       /*
-          if (length > mcs_data->size)
-          {
-          error("MCS data length %d, expected %d\n", length,
-          mcs_data->size);
-          length = mcs_data->size;
-          }
-
-          in_uint8a(s, mcs_data->data, length);
-          mcs_data->p = mcs_data->data;
-          mcs_data->end = mcs_data->data + length;
-        */
+       printf("Data from MCS connect: '%*s'\n", length, buf);
+       
        return s_check_end(s);
 }
 
diff --git a/proto.h b/proto.h
index 97a628bcbebbec061fa3283d2fe2a15c3f97609c..3fc91a5d907b944ddc94a6cb29a8ecfe2e8fc7d2 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -38,6 +38,7 @@ void iso_disconnect(void);
 void licence_process(STREAM s);
 /* mcs.c */
 STREAM mcs_init(int length);
+BOOL mcs_recv_connect_initial();
 void mcs_send_to_channel(STREAM s, uint16 channel);
 void mcs_send(STREAM s);
 STREAM mcs_recv(uint16 * channel);
index 561a2e4753d5f8aad68d557d1c6ad785bdf04f6d..e321ba6342c3b8806fc57bb9f6c4bcabda2c47eb 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -61,6 +61,8 @@ int create_server_socket()
 
 int serve_client()
 {
+       mcs_recv_connect_initial();
+       
        for ( ;; ) {
                short channel;