[pkg-remote-commits] [xrdp] 01/01: New upstream version 0.9.5

Dominik George natureshadow-guest at moszumanska.debian.org
Sun Jan 7 16:07:09 UTC 2018


This is an automated email from the git hooks/post-receive script.

natureshadow-guest pushed a commit to branch upstream
in repository xrdp.

commit 685ef4e88ddd24c612749b2de710922ab8f80ce3
Author: Dominik George <nik at naturalnet.de>
Date:   Sun Jan 7 15:53:27 2018 +0100

    New upstream version 0.9.5
---
 NEWS.md                                            |   35 +
 README.md                                          |    9 +-
 common/Makefile.am                                 |    1 -
 common/Makefile.in                                 |   11 +-
 common/crc16.h                                     |    0
 common/log.c                                       |   12 +-
 common/log.h                                       |    3 +-
 common/os_calls.c                                  |   90 +-
 common/os_calls.h                                  |    2 +
 common/ssl_calls.c                                 |    9 +
 common/trans.c                                     |   20 +
 common/trans.h                                     |    3 +-
 common/xrdp_constants.h                            | 1023 ++++++++++---------
 config_ac-h.in                                     |    9 +
 configure                                          |   50 +-
 configure.ac                                       |   14 +-
 genkeymap/dump-keymaps.sh                          |    4 +
 instfiles/Makefile.am                              |    3 +-
 instfiles/Makefile.in                              |    3 +-
 instfiles/km-00010409.ini                          | 1055 ++++++++++++++++++++
 librfxcodec/configure                              |   20 +-
 librfxcodec/configure.ac                           |    2 +-
 librfxcodec/include/rfxcodec_encode.h              |   34 +
 librfxcodec/src/Makefile.am                        |    6 +-
 librfxcodec/src/Makefile.in                        |   10 +-
 librfxcodec/src/rfxencode.c                        |   36 +-
 librfxcodec/src/rfxencode.h                        |   10 +
 .../{rfxencode_tile.c => rfxencode_rgb_to_yuv.c}   |  227 +----
 librfxcodec/src/rfxencode_rgb_to_yuv.h             |   33 +
 librfxcodec/src/rfxencode_tile.c                   |  419 +-------
 libxrdp/xrdp_caps.c                                |   72 +-
 libxrdp/xrdp_sec.c                                 |   14 +-
 neutrinordp/xrdp-neutrinordp.c                     |    9 +-
 sesman/chansrv/chansrv.c                           |    3 +-
 sesman/chansrv/pulse/README.md                     |  117 +++
 sesman/chansrv/pulse/README.md~                    |  145 +++
 sesman/chansrv/pulse/pulse-notes.txt               |   79 --
 sesman/chansrv/pulse/pulse-notes.ubuntu.txt        |   77 --
 sesman/chansrv/sound.c                             |    6 +-
 sesman/libscp/libscp_v0.c                          |   32 +-
 sesman/sesman.ini                                  |   34 +-
 xorg/X11R7.6/rdp/rdp.h                             |    2 +-
 xorg/X11R7.6/rdp/rdp.h~                            |    2 +-
 xorgxrdp/README.md                                 |    2 +-
 xorgxrdp/configure                                 |   20 +-
 xorgxrdp/configure.ac                              |    2 +-
 xorgxrdp/module/amd64/Makefile.am                  |    2 +
 xorgxrdp/module/amd64/Makefile.in                  |    2 +-
 .../amd64/a8r8g8b8_to_a8b8g8r8_box_amd64_sse2.asm  |   20 +-
 .../amd64/a8r8g8b8_to_nv12_box_amd64_sse2.asm      |  116 +--
 xorgxrdp/module/amd64/cpuid_amd64.asm              |    5 +-
 xorgxrdp/module/amd64/i420_to_rgb32_amd64_sse2.asm |   21 +-
 xorgxrdp/module/amd64/uyvy_to_rgb32_amd64_sse2.asm |   18 +-
 xorgxrdp/module/amd64/yuy2_to_rgb32_amd64_sse2.asm |   18 +-
 xorgxrdp/module/amd64/yv12_to_rgb32_amd64_sse2.asm |   21 +-
 xorgxrdp/module/common.asm                         |   75 ++
 xorgxrdp/module/rdpClientCon.c                     |   11 +-
 xorgxrdp/module/x86/Makefile.am                    |    2 +
 xorgxrdp/module/x86/Makefile.in                    |    2 +-
 .../x86/a8r8g8b8_to_a8b8g8r8_box_x86_sse2.asm      |   58 +-
 .../module/x86/a8r8g8b8_to_nv12_box_x86_sse2.asm   |  124 ++-
 xorgxrdp/module/x86/cpuid_x86.asm                  |    5 +-
 xorgxrdp/module/x86/i420_to_rgb32_x86_sse2.asm     |   62 +-
 xorgxrdp/module/x86/uyvy_to_rgb32_x86_sse2.asm     |   20 +-
 xorgxrdp/module/x86/yuy2_to_rgb32_x86_sse2.asm     |   20 +-
 xorgxrdp/module/x86/yv12_to_rgb32_x86_sse2.asm     |   62 +-
 xrdp/xrdp.ini                                      |    5 +
 xrdp/xrdp_bitmap.c                                 |    1 -
 xrdp/xrdp_cache.c                                  |    1 -
 xrdp/xrdp_keyboard.ini                             |    6 +
 xrdp/xrdp_listen.c                                 |   37 +-
 xrdp/xrdp_mm.c                                     |    6 +-
 xrdp/xrdp_wm.c                                     |   85 +-
 73 files changed, 2859 insertions(+), 1715 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 59123ac..898f4ba 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,34 @@
+# Release notes for xrdp v0.9.5 (2017/12/27)
+
+## Security fixes
+* Fix local denial of service [CVE-2017-16927](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16927) #958 #979
+
+## New features
+* Add a new log level TRACE more verbose than DEBUG #835 #944
+* SSH agent forwarding via RDP #867 #868 FreeRDP/FreeRDP#4122
+* Support horizontal wheel properly #928
+
+## Bug fixes
+
+* Avoid use of hard-coded sesman port #895
+* Workaround for corrupted display with Windows Server 2008 using NeutrinoRDP #869
+* Fix glitch in audio redirection by AAC #910 #936
+* Implement vsock support #930 #935 #948
+* Avoid 100% CPU usage on SSL accept #956
+
+## Other changes
+* Add US Dvorak keyboard #929
+* Suppress some misleading logs #964
+* Add Finnish keyboard #972
+* Add more user-friendlier description about Xorg config #974
+* Renew pulseaudio document #984 #985
+* Lots of cleanups and refactoring
+
+## Known issues
+* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
+
+-----------------------
+
 # Release notes for xrdp v0.9.4 (2017/09/28)
 
 ## New features
@@ -22,6 +53,8 @@
   * Windows 10 (1703) shows black blank screen in RemoteFX mode
    * This issue is already fixed at Insider Preview build 16273
 
+-----------------------
+
 # Release notes for xrdp v0.9.3.1 (2017/08/16)
 
 This release fixes a trivial packaging issue #848 occurred in v0.9.3.  The issue only affects systemd systems.  This release is principally for distro packagers or users who compile & install xrdp from source.
@@ -31,6 +64,8 @@ Users who running xrdp on these systems don't need to upgrade from v0.9.3 to v0.
 * Linux systems without systemd
 * non-Linux systems such as BSD operating systems
 
+-----------------------
+
 # Release notes for xrdp v0.9.3 (2017/07/15)
 
 ## New features
diff --git a/README.md b/README.md
index ddbbf3f..f8fe462 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
 [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/neutrinolabs/xrdp)
 ![Apache-License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)
 
-*Current Version:* 0.9.4
+*Current Version:* 0.9.5
 
 # xrdp - an open source RDP server
 
@@ -29,7 +29,7 @@ RDP transport is encrypted using TLS by default.
 
 ### Access to Remote Resources
  * two-way clipboard transfer (text, bitmap, file)
- * audio redirection
+ * audio redirection ([requires to build additional modules](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection))
  * drive redirection (mount local client drives on remote machine)
 
 ## Quick Start
@@ -114,6 +114,11 @@ make
 sudo make install
 ```
 
+If you want to use audio redirection, you need to build and install additional
+pulseaudio modules. The build instructions can be found at wiki.
+
+* [How to set up audio redirection](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection)
+
 ## Directory Structure
 
 ```
diff --git a/common/Makefile.am b/common/Makefile.am
index 3f44dff..a76c3f6 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -33,7 +33,6 @@ libcommon_la_SOURCES = \
   arch.h \
   base64.h \
   base64.c \
-  crc16.h \
   defines.h \
   fifo.c \
   fifo.h \
diff --git a/common/Makefile.in b/common/Makefile.in
index 747dd54..f5c115d 100644
--- a/common/Makefile.in
+++ b/common/Makefile.in
@@ -143,11 +143,11 @@ LTLIBRARIES = $(module_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libcommon_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1)
-am__libcommon_la_SOURCES_DIST = arch.h base64.h base64.c crc16.h \
-	defines.h fifo.c fifo.h file.c file.h list.c list.h list16.c \
-	list16.h log.c log.h os_calls.c os_calls.h parse.h rail.h \
-	ssl_calls.c ssl_calls.h thread_calls.c thread_calls.h trans.c \
-	trans.h pixman-region16.c pixman-region.h
+am__libcommon_la_SOURCES_DIST = arch.h base64.h base64.c defines.h \
+	fifo.c fifo.h file.c file.h list.c list.h list16.c list16.h \
+	log.c log.h os_calls.c os_calls.h parse.h rail.h ssl_calls.c \
+	ssl_calls.h thread_calls.c thread_calls.h trans.c trans.h \
+	pixman-region16.c pixman-region.h
 @XRDP_PIXMAN_FALSE at am__objects_1 = pixman-region16.lo
 am_libcommon_la_OBJECTS = base64.lo fifo.lo file.lo list.lo list16.lo \
 	log.lo os_calls.lo ssl_calls.lo thread_calls.lo trans.lo \
@@ -386,7 +386,6 @@ libcommon_la_SOURCES = \
   arch.h \
   base64.h \
   base64.c \
-  crc16.h \
   defines.h \
   fifo.c \
   fifo.h \
diff --git a/common/crc16.h b/common/crc16.h
deleted file mode 100644
index e69de29..0000000
diff --git a/common/log.c b/common/log.c
index 29904fe..ea2af31 100644
--- a/common/log.c
+++ b/common/log.c
@@ -94,6 +94,7 @@ internal_log_xrdp2syslog(const enum logLevels lvl)
         case LOG_LEVEL_INFO:
             return LOG_INFO;
         case LOG_LEVEL_DEBUG:
+        case LOG_LEVEL_TRACE:
             return LOG_DEBUG;
         default:
             g_writeln("Undefined log level - programming error");
@@ -128,6 +129,9 @@ internal_log_lvl2str(const enum logLevels lvl, char *str)
         case LOG_LEVEL_DEBUG:
             snprintf(str, 9, "%s", "[DEBUG] ");
             break;
+        case LOG_LEVEL_TRACE:
+            snprintf(str, 9, "%s", "[TRACE] ");
+            break;
         default:
             snprintf(str, 9, "%s", "PRG ERR!");
             g_writeln("Programming error - undefined log level!!!");
@@ -194,9 +198,6 @@ internal_log_end(struct log_config *l_cfg)
         return ret;
     }
 
-    /* closing log file */
-    log_message(LOG_LEVEL_ALWAYS, "shutting down log subsystem...");
-
     if (-1 != l_cfg->fd)
     {
         /* closing logfile... */
@@ -254,6 +255,11 @@ internal_log_text2level(const char *buf)
     {
         return LOG_LEVEL_DEBUG;
     }
+    else if (0 == g_strcasecmp(buf, "5") ||
+             0 == g_strcasecmp(buf, "trace"))
+    {
+        return LOG_LEVEL_TRACE;
+    }
 
     g_writeln("Your configured log level is corrupt - we use debug log level");
     return LOG_LEVEL_DEBUG;
diff --git a/common/log.h b/common/log.h
index bd5852e..2f8063e 100644
--- a/common/log.h
+++ b/common/log.h
@@ -33,7 +33,8 @@ enum logLevels
     LOG_LEVEL_ERROR,
     LOG_LEVEL_WARNING,
     LOG_LEVEL_INFO,
-    LOG_LEVEL_DEBUG
+    LOG_LEVEL_DEBUG,
+    LOG_LEVEL_TRACE
 };
 
 /* startup return values */
diff --git a/common/os_calls.c b/common/os_calls.c
index 642ba4a..e7fc144 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -41,6 +41,9 @@
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <sys/socket.h>
+#if defined(XRDP_ENABLE_VSOCK)
+#include <linux/vm_sockets.h>
+#endif
 #include <sys/un.h>
 #include <sys/time.h>
 #include <sys/times.h>
@@ -576,13 +579,24 @@ int
 g_sck_local_socket(void)
 {
 #if defined(_WIN32)
-    return 0;
+    return -1;
 #else
     return socket(PF_LOCAL, SOCK_STREAM, 0);
 #endif
 }
 
 /*****************************************************************************/
+int
+g_sck_vsock_socket(void)
+{
+#if defined(XRDP_ENABLE_VSOCK)
+    return socket(PF_VSOCK, SOCK_STREAM, 0);
+#else
+    return -1;
+#endif
+}
+
+/*****************************************************************************/
 /* returns error */
 int
 g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid)
@@ -656,6 +670,9 @@ g_sck_close(int sck)
 #if defined(XRDP_ENABLE_IPV6)
         struct sockaddr_in6 sock_addr_in6;
 #endif
+#if defined(XRDP_ENABLE_VSOCK)
+        struct sockaddr_vm sock_addr_vm;
+#endif
     } sock_info;
     socklen_t sock_len = sizeof(sock_info);
 
@@ -695,6 +712,22 @@ g_sck_close(int sck)
                 g_snprintf(sockname, sizeof(sockname), "AF_UNIX");
                 break;
 
+#if defined(XRDP_ENABLE_VSOCK)
+
+            case AF_VSOCK:
+            {
+                struct sockaddr_vm *sock_addr_vm = &sock_info.sock_addr_vm;
+
+                g_snprintf(sockname,
+                           sizeof(sockname),
+                           "AF_VSOCK cid %d port %d",
+                           sock_addr_vm->svm_cid,
+                           sock_addr_vm->svm_port);
+                break;
+            }
+
+#endif
+
             default:
                 g_snprintf(sockname, sizeof(sockname), "unknown family %d",
                            sock_info.sock_addr.sa_family);
@@ -990,6 +1023,24 @@ g_sck_local_bind(int sck, const char *port)
 #endif
 }
 
+/*****************************************************************************/
+int
+g_sck_vsock_bind(int sck, const char *port)
+{
+#if defined(XRDP_ENABLE_VSOCK)
+    struct sockaddr_vm s;
+
+    g_memset(&s, 0, sizeof(struct sockaddr_vm));
+    s.svm_family = AF_VSOCK;
+    s.svm_port = atoi(port);
+    s.svm_cid = VMADDR_CID_ANY;
+
+    return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_vm));
+#else
+    return -1;
+#endif
+}
+
 #if defined(XRDP_ENABLE_IPV6)
 /*****************************************************************************/
 /* Helper function for g_tcp_bind_address.                                   */
@@ -1180,9 +1231,9 @@ g_tcp_accept(int sck)
             {
                 struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in;
 
-                snprintf(msg, sizeof(msg), "A connection received from %s port %d",
-                         inet_ntoa(sock_addr_in->sin_addr),
-                         ntohs(sock_addr_in->sin_port));
+                g_snprintf(msg, sizeof(msg), "A connection received from %s port %d",
+                           inet_ntoa(sock_addr_in->sin_addr),
+                           ntohs(sock_addr_in->sin_port));
                 log_message(LOG_LEVEL_INFO, "%s", msg);
 
                 break;
@@ -1197,8 +1248,8 @@ g_tcp_accept(int sck)
 
                 inet_ntop(sock_addr_in6->sin6_family,
                           &sock_addr_in6->sin6_addr, addr, sizeof(addr));
-                snprintf(msg, sizeof(msg), "A connection received from %s port %d",
-                         addr, ntohs(sock_addr_in6->sin6_port));
+                g_snprintf(msg, sizeof(msg), "A connection received from %s port %d",
+                           addr, ntohs(sock_addr_in6->sin6_port));
                 log_message(LOG_LEVEL_INFO, "%s", msg);
 
                 break;
@@ -1226,6 +1277,9 @@ g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes)
         struct sockaddr_in6 sock_addr_in6;
 #endif
         struct sockaddr_un sock_addr_un;
+#if defined(XRDP_ENABLE_VSOCK)
+        struct sockaddr_vm sock_addr_vm;
+#endif
     } sock_info;
 
     socklen_t sock_len = sizeof(sock_info);
@@ -1273,6 +1327,26 @@ g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes)
                 g_snprintf(msg, sizeof(msg), "AF_UNIX connection received");
                 break;
             }
+
+#if defined(XRDP_ENABLE_VSOCK)
+
+            case AF_VSOCK:
+            {
+                struct sockaddr_vm *sock_addr_vm = &sock_info.sock_addr_vm;
+
+                g_snprintf(addr, addr_bytes - 1, "%d", sock_addr_vm->svm_cid);
+                g_snprintf(port, addr_bytes - 1, "%d", sock_addr_vm->svm_port);
+
+                g_snprintf(msg,
+                           sizeof(msg),
+                           "AF_VSOCK connection received from cid: %s port: %s",
+                           addr,
+                           port);
+
+                break;
+            }
+
+#endif
             default:
             {
                 g_strncpy(addr, "", addr_bytes - 1);
@@ -1358,13 +1432,13 @@ g_write_ip_address(int rcv_sck, char *ip_address, int bytes)
 
         if (ok)
         {
-            snprintf(ip_address, bytes, "%s:%d - socket: %d", addr, port, rcv_sck);
+            g_snprintf(ip_address, bytes, "%s:%d - socket: %d", addr, port, rcv_sck);
         }
     }
 
     if (!ok)
     {
-        snprintf(ip_address, bytes, "NULL:NULL - socket: %d", rcv_sck);
+        g_snprintf(ip_address, bytes, "NULL:NULL - socket: %d", rcv_sck);
     }
 
     g_free(addr);
diff --git a/common/os_calls.h b/common/os_calls.h
index 98f87b3..e42e95b 100644
--- a/common/os_calls.h
+++ b/common/os_calls.h
@@ -62,6 +62,7 @@ int      g_sck_get_send_buffer_bytes(int sck, int *bytes);
 int      g_sck_set_recv_buffer_bytes(int sck, int bytes);
 int      g_sck_get_recv_buffer_bytes(int sck, int *bytes);
 int      g_sck_local_socket(void);
+int      g_sck_vsock_socket(void);
 int      g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid);
 void     g_sck_close(int sck);
 int      g_tcp_connect(int sck, const char* address, const char* port);
@@ -69,6 +70,7 @@ int      g_sck_local_connect(int sck, const char* port);
 int      g_sck_set_non_blocking(int sck);
 int      g_tcp_bind(int sck, const char *port);
 int      g_sck_local_bind(int sck, const char* port);
+int      g_sck_vsock_bind(int sck, const char* port);
 int      g_tcp_bind_address(int sck, const char* port, const char* address);
 int      g_sck_listen(int sck);
 int      g_tcp_accept(int sck);
diff --git a/common/ssl_calls.c b/common/ssl_calls.c
index 0e12e96..8eec712 100644
--- a/common/ssl_calls.c
+++ b/common/ssl_calls.c
@@ -651,6 +651,15 @@ ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
              *     SSL_ERROR_WANT_READ
              *     SSL_ERROR_WANT_WRITE
              */
+            switch (SSL_get_error(self->ssl, connection_status))
+            {
+                case SSL_ERROR_WANT_READ:
+                    g_sck_can_recv(self->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT);
+                    break;
+                case SSL_ERROR_WANT_WRITE:
+                    g_sck_can_send(self->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT);
+                    break;
+            }
         }
         else
         {
diff --git a/common/trans.c b/common/trans.c
index d73764d..9448760 100644
--- a/common/trans.c
+++ b/common/trans.c
@@ -831,6 +831,26 @@ trans_listen_address(struct trans *self, char *port, const char *address)
             }
         }
     }
+    else if (self->mode == TRANS_MODE_VSOCK) /* vsock socket */
+    {
+        self->sck = g_sck_vsock_socket();
+        if (self->sck < 0)
+        {
+            return 1;
+        }
+
+        g_tcp_set_non_blocking(self->sck);
+
+        if (g_sck_vsock_bind(self->sck, port) == 0)
+        {
+            if (g_tcp_listen(self->sck) == 0)
+            {
+                self->status = TRANS_STATUS_UP; /* ok */
+                self->type1 = TRANS_TYPE_LISTENER; /* listener */
+                return 0;
+            }
+        }
+    }
 
     return 1;
 }
diff --git a/common/trans.h b/common/trans.h
index 77d1ed1..57a0fd6 100644
--- a/common/trans.h
+++ b/common/trans.h
@@ -26,6 +26,7 @@
 
 #define TRANS_MODE_TCP 1
 #define TRANS_MODE_UNIX 2
+#define TRANS_MODE_VSOCK 3
 
 #define TRANS_TYPE_LISTENER 1
 #define TRANS_TYPE_SERVER 2
@@ -62,7 +63,7 @@ struct source_info
 struct trans
 {
     tbus sck; /* socket handle */
-    int mode; /* 1 tcp, 2 unix socket */
+    int mode; /* 1 tcp, 2 unix socket, 3 vsock */
     int status;
     int type1; /* 1 listener 2 server 3 client */
     ttrans_data_in trans_data_in;
diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h
index f1b1323..4a6d2c2 100644
--- a/common/xrdp_constants.h
+++ b/common/xrdp_constants.h
@@ -25,37 +25,32 @@
 /* TCP port for Remote Desktop Protocol */
 #define TCP_PORT_RDP                   3389
 
+/******************************************************************************
+ *
+ * xrdp constants
+ *
+ ******************************************************************************/
+
+#define INFO_CLIENT_NAME_BYTES  32
+
+#define XRDP_MAX_BITMAP_CACHE_ID  3
+#define XRDP_MAX_BITMAP_CACHE_IDX 2000
+#define XRDP_BITMAP_CACHE_ENTRIES 2048
+
+#define XR_MIN_KEY_CODE 8
+#define XR_MAX_KEY_CODE 256
+
+/*
+ * Constants come from ITU-T Recommendations
+ */
+
 #define ISO_PDU_CR                     0xE0 /* X.224 Connection Request */
 #define ISO_PDU_CC                     0xD0 /* X.224 Connection Confirm */
 #define ISO_PDU_DR                     0x80 /* Disconnect Request */
 #define ISO_PDU_DT                     0xF0 /* Data */
 #define ISO_PDU_ER                     0x70 /* Error */
 
-
-/* RDP Security Negotiation codes */
-#define RDP_NEG_REQ                    0x01
-#define RDP_NEG_RSP                    0x02
-#define RDP_NEG_FAILURE                0x03
-#define RDP_CORRELATION_INFO           0x06
-/* Protocol types codes */
-#define PROTOCOL_RDP                   0x0
-#define PROTOCOL_SSL                   0x1
-#define PROTOCOL_HYBRID                0x2
-#define PROTOCOL_HYBRID_EX             0x8
-/* Negotiation packet flags */
-#define EXTENDED_CLIENT_DATA_SUPPORTED 0x1
-#define DYNVC_GFX_PROTOCOL_SUPPORTED   0x2
-#define RDP_NEGRSP_RESERVED            0x4
-/* Failure Codes */
-#define SSL_REQUIRED_BY_SERVER          0x1
-#define SSL_NOT_ALLOWED_BY_SERVER       0x2
-#define SSL_CERT_NOT_ON_SERVER          0x3
-#define INCONSISTENT_FLAGS              0x4
-#define HYBRID_REQUIRED_BY_SERVER       0x5
-#define SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER   0x6
-
-
-/* MCS PDU codes */
+/* MCS PDU codes (T.125) */
 #define MCS_EDRQ                       1  /* Erect Domain Request */
 #define MCS_DPUM                       8  /* Disconnect Provider Ultimatum */
 #define MCS_AURQ                       10 /* Attach User Request */
@@ -65,19 +60,39 @@
 #define MCS_SDRQ                       25 /* Send Data Request */
 #define MCS_SDIN                       26 /* Send Data Indication */
 
-#define MCS_CONNECT_INITIAL            0x7f65
-#define MCS_CONNECT_RESPONSE           0x7f66
-
-#define BER_TAG_BOOLEAN                1
-#define BER_TAG_INTEGER                2
-#define BER_TAG_OCTET_STRING           4
-#define BER_TAG_RESULT                 10
-#define MCS_TAG_DOMAIN_PARAMS          0x30
-
-#define MCS_GLOBAL_CHANNEL             1003
-#define MCS_USERCHANNEL_BASE           1001
+/*
+ * Constants come from Remote Desktop Protocol
+ */
 
-/* MCS Connection Type (MS-RDPBCGR 2.2.1.3.2) */
+/* RDP Security Negotiation codes */
+#define RDP_NEG_REQ                    0x01  /* MS-RDPBCGR 2.2.1.1.1 */
+#define RDP_NEG_RSP                    0x02  /* MS-RDPBCGR 2.2.1.2.1 */
+#define RDP_NEG_FAILURE                0x03  /* MS-RDPBCGR 2.2.1.2.2 */
+#define RDP_CORRELATION_INFO           0x06  /* MS-RDPBCGR 2.2.1.1.2 */
+
+/* Protocol types codes (MS-RDPBCGR 2.2.1.1.1) */
+#define PROTOCOL_RDP                   0x00000000
+#define PROTOCOL_SSL                   0x00000001
+#define PROTOCOL_HYBRID                0x00000002
+#define PROTOCOL_RDSTLS                0x00000004
+#define PROTOCOL_HYBRID_EX             0x00000008
+
+/* Negotiation packet flags (MS-RDPBCGR 2.2.1.2.1) */
+#define EXTENDED_CLIENT_DATA_SUPPORTED            0x01
+#define DYNVC_GFX_PROTOCOL_SUPPORTED              0x02
+#define NEGRSP_RESERVED                           0x04
+#define RESTRICTED_ADMIN_MODE_SUPPORTED           0x08
+#define REDIRECTED_AUTHENTICATION_MODE_SUPPORTED  0x10
+
+/* RDP Negotiation Failure Codes (MS-RDPBCGR 2.2.1.2.2) */
+#define SSL_REQUIRED_BY_SERVER                 0x00000001
+#define SSL_NOT_ALLOWED_BY_SERVER              0x00000002
+#define SSL_CERT_NOT_ON_SERVER                 0x00000003
+#define INCONSISTENT_FLAGS                     0x00000004
+#define HYBRID_REQUIRED_BY_SERVER              0x00000005
+#define SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER  0x00000006
+
+/* Client Core Data: connectionType  (MS-RDPBCGR 2.2.1.3.2) */
 #define CONNECTION_TYPE_MODEM          0x01
 #define CONNECTION_TYPE_BROADBAND_LOW  0x02
 #define CONNECTION_TYPE_SATELLITE      0x03
@@ -86,85 +101,15 @@
 #define CONNECTION_TYPE_LAN            0x06
 #define CONNECTION_TYPE_AUTODETECT     0x07
 
-/* RDP secure transport constants */
-#define SEC_RANDOM_SIZE                32
-#define SEC_MODULUS_SIZE               64
-#define SEC_PADDING_SIZE               8
-#define SEC_EXPONENT_SIZE              4
-
-#define SEC_CLIENT_RANDOM              0x0001
-#define SEC_ENCRYPT                    0x0008
-#define SEC_LOGON_INFO                 0x0040
-#define SEC_LICENCE_NEG                0x0080
-
-#define SEC_TAG_SRV_INFO               0x0c01
-#define SEC_TAG_SRV_CRYPT              0x0c02
-#define SEC_TAG_SRV_CHANNELS           0x0c03
-
-#define SEC_TAG_CLI_INFO               0xc001
-#define SEC_TAG_CLI_CRYPT              0xc002
-#define SEC_TAG_CLI_CHANNELS           0xc003
-#define SEC_TAG_CLI_4                  0xc004
-#define SEC_TAG_CLI_MONITOR            0xc005
-
-#define SEC_TAG_PUBKEY                 0x0006
-#define SEC_TAG_KEYSIG                 0x0008
-
-#define SEC_RSA_MAGIC                  0x31415352 /* RSA1 */
-
-/* RDP licensing constants */
-#define LICENCE_TOKEN_SIZE             10
-#define LICENCE_HWID_SIZE              20
-#define LICENCE_SIGNATURE_SIZE         16
-
-#define LICENCE_TAG_DEMAND             0x01
-#define LICENCE_TAG_AUTHREQ            0x02
-#define LICENCE_TAG_ISSUE              0x03
-#define LICENCE_TAG_REISSUE            0x04
-#define LICENCE_TAG_PRESENT            0x12
-#define LICENCE_TAG_REQUEST            0x13
-#define LICENCE_TAG_AUTHRESP           0x15
-#define LICENCE_TAG_RESULT             0xff
-
-#define LICENCE_TAG_USER               0x000f
-#define LICENCE_TAG_HOST               0x0010
-
-/* RDP PDU codes */
-#define RDP_PDU_DEMAND_ACTIVE          1
-#define RDP_PDU_CONFIRM_ACTIVE         3
-#define RDP_PDU_REDIRECT               4
-#define RDP_PDU_DEACTIVATE             6
-#define RDP_PDU_DATA                   7
-
-#define RDP_DATA_PDU_UPDATE            2
-#define RDP_DATA_PDU_CONTROL           20
-#define RDP_DATA_PDU_POINTER           27
-#define RDP_DATA_PDU_INPUT             28
-#define RDP_DATA_PDU_SYNCHRONISE       31
-#define RDP_DATA_PDU_PLAY_SOUND        34
-#define RDP_DATA_PDU_LOGON             38
-#define RDP_DATA_PDU_FONT2             39
-#define RDP_DATA_PDU_DISCONNECT        47
-
-#define RDP_CTL_REQUEST_CONTROL        1
-#define RDP_CTL_GRANT_CONTROL          2
-#define RDP_CTL_DETACH                 3
-#define RDP_CTL_COOPERATE              4
-
-#define RDP_UPDATE_ORDERS              0
-#define RDP_UPDATE_BITMAP              1
-#define RDP_UPDATE_PALETTE             2
-#define RDP_UPDATE_SYNCHRONIZE         3
-
-#define RDP_POINTER_SYSTEM             1
-#define RDP_POINTER_MOVE               3
-#define RDP_POINTER_COLOR              6
-#define RDP_POINTER_CACHED             7
-#define RDP_POINTER_POINTER            8
-
-#define RDP_NULL_POINTER               0
-#define RDP_DEFAULT_POINTER            0x7F00
+/* Client Core Data: colorDepth, postBeta2ColorDepth (MS-RDPBCGR 2.2.1.3.2) */
+#define RNS_UD_COLOR_4BPP              0xCA00
+#define RNS_UD_COLOR_8BPP              0xCA01
+#define RNS_UD_COLOR_16BPP_555         0xCA02
+#define RNS_UD_COLOR_16BPP_565         0xCA03
+#define RNS_UD_COLOR_24BPP             0xCA04
 
+/* Slow-Path Input Event: messageType (MS-RDPBCGR 2.2.8.1.1.3.1.1) */
+/* TODO: to be renamed */
 #define RDP_INPUT_SYNCHRONIZE          0
 #define RDP_INPUT_CODEPOINT            1
 #define RDP_INPUT_VIRTKEY              2
@@ -173,60 +118,67 @@
 #define RDP_INPUT_MOUSE                0x8001
 #define RDP_INPUT_MOUSEX               0x8002
 
-/* Device flags */
-#define KBD_FLAG_RIGHT                 0x0001
-#define KBD_FLAG_EXT                   0x0100
-#define KBD_FLAG_QUIET                 0x1000
-#define KBD_FLAG_DOWN                  0x4000
-#define KBD_FLAG_UP                    0x8000
+#define FASTPATH_INPUT_ENCRYPTED            0x2
 
-/* These are for synchronization; not for keystrokes */
-#define KBD_FLAG_SCROLL                0x0001
-#define KBD_FLAG_NUMLOCK               0x0002
-#define KBD_FLAG_CAPITAL               0x0004
+/* Fast-Path Input Event: eventCode (MS-RDPBCGR 2.2.8.1.2.2) */
+#define FASTPATH_INPUT_EVENT_SCANCODE       0x0
+#define FASTPATH_INPUT_EVENT_MOUSE          0x1
+#define FASTPATH_INPUT_EVENT_MOUSEX         0x2
+#define FASTPATH_INPUT_EVENT_SYNC           0x3
+#define FASTPATH_INPUT_EVENT_UNICODE        0x4
+#define FASTPATH_INPUT_EVENT_QOE_TIMESTAMP  0x6
 
-/* See T.128 */
-#define RDP_KEYPRESS                   0
-#define RDP_KEYRELEASE                 (KBD_FLAG_DOWN | KBD_FLAG_UP)
+/* Fast-Path Keyboard Event: eventHeader (MS-RDPBCGR 2.2.8.2.2.1) */
+#define FASTPATH_INPUT_KBDFLAGS_RELEASE     0x01
+#define FASTPATH_INPUT_KBDFLAGS_EXTENDED    0x02
+#define FASTPATH_INPUT_KBDFLAGS_EXTENDED1   0x04
 
-#define MOUSE_FLAG_MOVE                0x0800
-#define MOUSE_FLAG_BUTTON1             0x1000
-#define MOUSE_FLAG_BUTTON2             0x2000
-#define MOUSE_FLAG_BUTTON3             0x4000
-#define MOUSE_FLAG_BUTTON4             0x0280
-#define MOUSE_FLAG_BUTTON5             0x0380
-#define MOUSE_FLAG_DOWN                0x8000
+/* Server Fast-Path Update PDU: action (MS-RDPBCGR 2.2.0.1.2) */
+#define FASTPATH_OUTPUT_ACTION_FASTPATH     0x0
+#define FASTPATH_OUTPUT_ACTION_X224         0x3
 
-/* Raster operation masks */
-#define ROP2_S(rop3)                   (rop3 & 0xf)
-#define ROP2_P(rop3)                   ((rop3 & 0x3) | ((rop3 & 0x30) >> 2))
+/* Server Fast-Path Update PDU: flags (MS-RDPBCGR 2.2.0.1.2) */
+#define FASTPATH_OUTPUT_ACTION_FASTPATH     0x0
+#define FASTPATH_OUTPUT_SECURE_CHECKSUM     0x1
+#define FASTPATH_OUTPUT_ENCRYPTED           0x2
 
-#define ROP2_COPY                      0xc
-#define ROP2_XOR                       0x6
-#define ROP2_AND                       0x8
-#define ROP2_NXOR                      0x9
-#define ROP2_OR                        0xe
-
-#define MIX_TRANSPARENT                0
-#define MIX_OPAQUE                     1
-
-#define TEXT2_VERTICAL                 0x04
-#define TEXT2_IMPLICIT_X               0x20
-
-/* RDP bitmap cache (version 2) constants */
-#define BMPCACHE2_C0_CELLS             0x78
-#define BMPCACHE2_C1_CELLS             0x78
-#define BMPCACHE2_C2_CELLS             0x150
-#define BMPCACHE2_NUM_PSTCELLS         0x9f6
-
-#define PDU_FLAG_FIRST                 0x01
-#define PDU_FLAG_LAST                  0x02
-
-/* Maps to generalCapabilitySet in T.128 page 138 */
+/* Fast-Path Update: updateCode (MS-RDPBCGR 2.2.9.1.2.1) */
+#define FASTPATH_UPDATETYPE_ORDERS        0x0
+#define FASTPATH_UPDATETYPE_BITMAP        0x1
+#define FASTPATH_UPDATETYPE_PALETTE       0x2
+#define FASTPATH_UPDATETYPE_SYNCHRONIZE   0x3
+#define FASTPATH_UPDATETYPE_SURFCMDS      0x4
+#define FASTPATH_UPDATETYPE_PTR_NULL      0x5
+#define FASTPATH_UPDATETYPE_PTR_DEFAULT   0x6
+#define FASTPATH_UPDATETYPE_PTR_POSITION  0x8
+#define FASTPATH_UPDATETYPE_COLOR         0x9
+#define FASTPATH_UPDATETYPE_CACHED        0xA
+#define FASTPATH_UPDATETYPE_POINTER       0xB
 
-/* RDP capabilities */
-#define RDP_CAPSET_GENERAL             1
-#define RDP_CAPLEN_GENERAL             0x18
+/* Fast-Path Update: fragmentation (MS-RDPBCGR 2.2.9.1.2.1) */
+#define FASTPATH_FRAGMENT_SINGLE          0x0
+#define FASTPATH_FRAGMENT_LAST            0x1
+#define FASTPATH_FRAGMENT_FIRST           0x2
+#define FASTPATH_FRAGMENT_NEXT            0x3
+#define FASTPATH_OUTPUT_COMPRESSION_USED  0x2
+
+/* Mouse Event: pointerFlags (MS-RDPBCGR 2.2.8.1.1.3.1.1.3) */
+#define PTRFLAGS_HWHEEL                0x0400
+#define PTRFLAGS_WHEEL                 0x0200
+#define PTRFLAGS_WHEEL_NEGATIVE        0x0100
+#define WheelRotationMask              0x01FF
+#define PTRFLAGS_MOVE                  0x0800
+#define PTRFLAGS_DOWN                  0x8000
+#define PTRFLAGS_BUTTON1               0x1000
+#define PTRFLAGS_BUTTON2               0x2000
+#define PTRFLAGS_BUTTON3               0x4000
+
+/* Extended Mouse Event: pointerFlags (MS-RDPBCGR 2.2.8.1.1.3.1.1.4) */
+#define PTRXFLAGS_DOWN                 0x8000
+#define PTRXFLAGS_BUTTON1              0x0001
+#define PTRXFLAGS_BUTTON2              0x0002
+
+/* General Capability Set: osMajorType (MS-RDPBCGR 2.2.7.1.1) */
 #define OSMAJORTYPE_UNSPECIFIED        0x0000
 #define OSMAJORTYPE_WINDOWS            0x0001
 #define OSMAJORTYPE_OS2                0x0002
@@ -236,6 +188,8 @@
 #define OSMAJORTYPE_OSX                0x0006
 #define OSMAJORTYPE_ANDROID            0x0007
 #define OSMAJORTYPE_CHROME_OS          0x0008
+
+/* General Capability Set: osMinorType (MS-RDPBCGR 2.2.7.1.1) */
 #define OSMINORTYPE_UNSPECIFIED        0x0000
 #define OSMINORTYPE_WINDOWS_31X        0x0001
 #define OSMINORTYPE_WINDOWS_95         0x0002
@@ -247,92 +201,507 @@
 #define OSMINORTYPE_PSEUDO_XSERVER     0x0008
 #define OSMINORTYPE_WINDOWS_RT         0x0009
 
-#define RDP_CAPSET_BITMAP              2
+/* Extended Info Packet: performanceFlags (MS-RDPBCGR 2.2.1.11.1.1.1) */
+/* TODO: to be renamed */
+#define RDP5_DISABLE_NOTHING           0x00
+#define RDP5_NO_WALLPAPER              0x01
+#define RDP5_NO_FULLWINDOWDRAG         0x02
+#define RDP5_NO_MENUANIMATIONS         0x04
+#define RDP5_NO_THEMING                0x08
+#define RDP5_NO_CURSOR_SHADOW          0x20
+#define RDP5_NO_CURSORSETTINGS         0x40 /* disables cursor blinking */
+
+/* Virtual channel options */
+/* Channel Definition Structure: options (MS-RDPBCGR 2.2.1.3.4.1) */
+#define REMOTE_CONTROL_PERSISTENT       0x00100000
+/* NOTE: XR_ prefixed to avoid conflict with FreeRDP */
+#define XR_CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000
+#define XR_CHANNEL_OPTION_COMPRESS      0x00400000
+#define XR_CHANNEL_OPTION_COMPRESS_RDP  0x00800000
+#define XR_CHANNEL_OPTION_PRI_LOW       0x02000000
+#define XR_CHANNEL_OPTION_PRI_MED       0x04000000
+#define XR_CHANNEL_OPTION_PRI_HIGH      0x08000000
+#define XR_CHANNEL_OPTION_ENCRYPT_CS    0x10000000
+#define XR_CHANNEL_OPTION_ENCRYPT_SC    0x20000000
+#define XR_CHANNEL_OPTION_ENCRYPT_RDP   0x40000000
+#define XR_CHANNEL_OPTION_INITIALIZED   0x80000000
+
+/* RDPDR: Device Announce Header: DeviceType (MS-RDPEFS 2.2.1.3) */
+/* TODO: to be renamed */
+#define DEVICE_TYPE_SERIAL             0x01
+#define DEVICE_TYPE_PARALLEL           0x02
+#define DEVICE_TYPE_PRINTER            0x04
+#define DEVICE_TYPE_DISK               0x08
+#define DEVICE_TYPE_SCARD              0x20
+
+/* Order Capability Set: orderSupportExFlags (MS-RDPBCGR 2.2.7.1.3)  */
+#define XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT   0x0002
+#define XR_ORDERFLAGS_EX_ALTSEC_FRAME_MARKER_SUPPORT 0x0004
+#define XR_ORDERFLAGS_EX_OFFSCREEN_COMPOSITE_SUPPORT 0x0100
+
+/* Order Capability Set: orderSupport (MS-RDPBCGR 2.2.7.1.3) */
+#define TS_NEG_DSTBLT_INDEX             0x00
+#define TS_NEG_PATBLT_INDEX             0x01
+#define TS_NEG_SCRBLT_INDEX             0x02
+#define TS_NEG_MEMBLT_INDEX             0x03
+#define TS_NEG_MEM3BLT_INDEX            0x04
+                                     /* 0x05 */
+                                     /* 0x06 */
+#define TS_NEG_DRAWNINEGRID_INDEX       0x07
+#define TS_NEG_LINETO_INDEX             0x08
+#define TS_NEG_MULTI_DRAWNINEGRID_INDEX 0x09
+                                     /* 0x0A */
+#define TS_NEG_SAVEBITMAP_INDEX         0x0B
+                                     /* 0x0C */
+                                     /* 0x0D */
+                                     /* 0x0E */
+#define TS_NEG_MULTIDSTBLT_INDEX        0x0F
+#define TS_NEG_MULTIPATBLT_INDEX        0x10
+#define TS_NEG_MULTISCRBLT_INDEX        0x11
+#define TS_NEG_MULTIOPAQUERECT_INDEX    0x12
+#define TS_NEG_FAST_INDEX_INDEX         0x13
+#define TS_NEG_POLYGON_SC_INDEX         0x14
+#define TS_NEG_POLYGON_CB_INDEX         0x15
+#define TS_NEG_POLYLINE_INDEX           0x16
+                                     /* 0x17 */
+#define TS_NEG_FAST_GLYPH_INDEX         0x18
+#define TS_NEG_ELLIPSE_SC_INDEX         0x19
+#define TS_NEG_ELLIPSE_CB_INDEX         0x1A
+#define TS_NEG_INDEX_INDEX              0x1B
+                                     /* 0x1C */
+                                     /* 0x1D */
+                                     /* 0x1E */
+                                     /* 0x1F */
+
+/* General Capability Set: extraFlags (MS-RDPBCGR 2.2.7.1.1) */
+#define  TS_CAPS_PROTOCOLVERSION       0x0200
+#define  FASTPATH_OUTPUT_SUPPORTED     0x0001
+#define  NO_BITMAP_COMPRESSION_HDR     0x0400
+#define  LONG_CREDENTIALS_SUPPORTED    0x0004
+#define  AUTORECONNECT_SUPPORTED       0x0008
+#define  ENC_SALTED_CHECKSUM           0x0010
+
+/* Order Capability Set: orderFlags (MS-RDPBCGR 2.2.7.1.3) */
+#define  NEGOTIATEORDERSUPPORT         0x0002
+#define  ZEROBOUNDSDELTASUPPORT        0x0008
+#define  COLORINDEXSUPPORT             0x0020
+#define  SOLIDPATTERNBRUSHONLY         0x0040
+#define  ORDERFLAGS_EXTRA_FLAGS        0x0080
+
+/* Input Capability Set: inputFlags (MS-RDPBCGR 2.2.7.1.6) */
+#define  INPUT_FLAG_SCANCODES          0x0001
+#define  INPUT_FLAG_MOUSEX             0x0004
+#define  INPUT_FLAG_FASTPATH_INPUT     0x0008
+#define  INPUT_FLAG_UNICODE            0x0010
+#define  INPUT_FLAG_FASTPATH_INPUT2    0x0020
+#define  INPUT_FLAG_UNUSED1            0x0040
+#define  INPUT_FLAG_UNUSED2            0x0080
+#define  TS_INPUT_FLAG_MOUSE_HWHEEL    0x0100
+#define  TS_INPUT_FLAG_QOE_TIMESTAMPS  0x0200
+
+/* Desktop Composition Capability Set: CompDeskSupportLevel (MS-RDPBCGR 2.2.7.2.8) */
+#define  COMPDESK_NOT_SUPPORTED      0x0000
+#define  COMPDESK_SUPPORTED          0x0001
+
+/* Surface Commands Capability Set: cmdFlags (MS-RDPBCGR 2.2.7.2.9) */
+#define SURFCMDS_SETSURFACEBITS      0x00000002
+#define SURFCMDS_FRAMEMARKER         0x00000010
+#define SURFCMDS_STREAMSUFRACEBITS   0x00000040
+
+/* Bitmap Codec: codecGUID (MS-RDPBCGR 2.2.7.2.10.1.1) */
+
+/* CODEC_GUID_NSCODEC  CA8D1BB9-000F-154F-589FAE2D1A87E2D6 */
+#define XR_CODEC_GUID_NSCODEC \
+  "\xb9\x1b\x8d\xca\x0f\x00\x4f\x15\x58\x9f\xae\x2d\x1a\x87\xe2\xd6"
+
+/* CODEC_GUID_REMOTEFX 76772F12-BD72-4463-AFB3B73C9C6F7886 */
+#define XR_CODEC_GUID_REMOTEFX \
+  "\x12\x2F\x77\x76\x72\xBD\x63\x44\xAF\xB3\xB7\x3C\x9C\x6F\x78\x86"
+
+/* CODEC_GUID_IMAGE_REMOTEFX 2744CCD4-9D8A-4E74-803C-0ECBEEA19C54 */
+#define XR_CODEC_GUID_IMAGE_REMOTEFX \
+  "\xD4\xCC\x44\x27\x8A\x9D\x74\x4E\x80\x3C\x0E\xCB\xEE\xA1\x9C\x54"
+
... 6304 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-remote/xrdp.git



More information about the pkg-remote-commits mailing list