]> git.sesse.net Git - rdpsrv/commitdiff
Handle AUrq/AUcf, and fix a type error.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 00:18:25 +0000 (00:18 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 00:18:25 +0000 (00:18 +0000)
mcs.c
rdpsrv.c

diff --git a/mcs.c b/mcs.c
index cee23643e00473371fc8d4be9a307e7dc7e8b785..460e0d4b6610957900c42c8dc2514807b5265583 100644 (file)
--- a/mcs.c
+++ b/mcs.c
@@ -215,35 +215,20 @@ mcs_send_aurq(void)
        iso_send(s);
 }
 
        iso_send(s);
 }
 
-/* Expect a AUcf message (ASN.1 PER) */
-static BOOL
-mcs_recv_aucf(uint16 * mcs_userid)
+/* Send a AUcf message (ASN.1 PER) */
+static void
+mcs_send_aucf(uint16 mcs_userid)
 {
 {
-       uint8 opcode, result;
        STREAM s;
 
        STREAM s;
 
-       s = iso_recv();
-       if (s == NULL)
-               return False;
-
-       in_uint8(s, opcode);
-       if ((opcode >> 2) != MCS_AUCF)
-       {
-               error("expected AUcf, got %d\n", opcode);
-               return False;
-       }
-
-       in_uint8(s, result);
-       if (result != 0)
-       {
-               error("AUrq: %d\n", result);
-               return False;
-       }
-
-       if (opcode & 2)
-               in_uint16_be(s, *mcs_userid);
+       s = iso_init(5);
 
 
-       return s_check_end(s);
+       out_uint8(s, (MCS_AUCF << 2) | 2);  // | 2 = send user ID
+       out_uint8(s, 0);  // success
+       out_uint16_be(s, 0);
+       
+       s_mark_end(s);
+       iso_send(s);
 }
 
 /* Send a CJrq message (ASN.1 PER) */
 }
 
 /* Send a CJrq message (ASN.1 PER) */
@@ -364,6 +349,11 @@ mcs_recv(uint16 * channel)
                // Erect Domain (ignore)
                printf("Received EDrq\n");
                return NULL;
                // Erect Domain (ignore)
                printf("Received EDrq\n");
                return NULL;
+       case MCS_AURQ:
+               // Attach User Request, respond with AUcf (Attach User Confirm)
+               printf("Received AUrq, sending AUcf\n");
+               mcs_send_aucf(0);
+               return NULL;
        default:
                error("expected data, got %d\n", opcode);
                return NULL;
        default:
                error("expected data, got %d\n", opcode);
                return NULL;
index 577f4a726aef0e7f7076db91c0b79907e2d6c1dc..138cff249551ce3f85b2a1ec54f7e13f51e47fe6 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -67,7 +67,7 @@ int serve_client()
        
        for ( ;; ) {
                short channel;
        
        for ( ;; ) {
                short channel;
-               STREAM *s;
+               STREAM s;
                
                /* receive ISO packets */
                s = mcs_recv(&channel);
                
                /* receive ISO packets */
                s = mcs_recv(&channel);