Commit Graph

552 Commits

Author SHA1 Message Date
matt335672
6838643494 Log connected client version 2022-05-18 12:18:23 +01:00
matt335672
28da2045d9 Send MS-compatible user channel
The Windows 10 RDS sets the user channel ID to be one more than the
ID of the last allocated static virtual channel. Currently we set it to
1002 (0x03ea) which is allocated to the server channel. This change
makes xrdp emulate RDS more closely.
2022-05-18 12:18:23 +01:00
matt335672
7eb44bd54c Update channel logging 2022-05-18 12:18:23 +01:00
matt335672
829106d793
Merge pull request #2219 from matt335672/off_by_one
Fix off-by-one errors in monitor resize logic
2022-04-19 09:11:58 +01:00
matt335672
7cfd3bb3d8 Fix off-by-one errors in monitor resize logic 2022-04-08 12:11:14 +01:00
matt335672
dc72ca269b Set closed RDP socket to -1 rather than 0 2022-04-01 13:00:33 +01:00
Christopher Pitstick
bd9147d18f Updating to refactor xrdp_client_info
- Eliminate duplicaiton for display_size_description
- monitorCount needs to be uint32_t
- width/height -> session_width/session_height
- Update CLIENT_INFO_CURRENT_VERSION
- Also some misc unit test updates.
- Minor log updates.
2022-03-27 16:38:32 -04:00
Christopher Pitstick
4a0db63be7 Unify monitor processing logic.
There are two places where monitor descriptions are passed through the
RDP protocol:

- TS_UD_CS_MONITOR ([MS-RDPBCGR] 2.2.1.3.6 Client Monitor Data)
- DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT ([MS-RDPEDISP] 2.2.2.2)

The processing logic for both of them is similar enough that they should be unified.

Also update to define the constants for the maximum and minimum desktop width/height for monitors and total area.

Also a large number of clarifications for the constants and protocol
requirements.

Note that this is also the first step to making resizing work with the extension GFX channel as well as an important
foundational step to enable HiDPI compatibility.

Also some misc logging updates.
2022-03-26 23:45:16 -04:00
Nexarian
d23f7328f8 Minor logging fixes in xrdp_iso.c
Two logging errors found while working in these files.
2022-02-15 08:29:42 -05:00
Nexarian
773a8f7da1 Move DRDYNVC_STATUS_* to xrdp_channel.h
These statuses are necessary for egfx resizing, as visibility to channel
status is a pre-req for closing and re-opening a channel.
2022-02-14 14:53:37 -05:00
matt335672
c894ba5b40 Better logging of classic connection security 2022-01-28 12:23:40 +00:00
matt335672
15b8578b54
Merge pull request #1932 from Nexarian/add_monitor_processing_unit_tests
Add monitor processing unit tests for existing xrdp_sec function
2022-01-05 10:23:55 +00:00
matt335672
9140737a6e Add calculate_multifragmentupdate_len() 2021-12-15 10:08:28 +00:00
Christopher Pitstick
0a2562d33d Initial cut at a unit test for xrdp_sec_process_mcs_data_monitors 2021-12-08 01:41:07 -05:00
matt335672
c39bb18469 Fix buffer size check 2021-12-02 13:47:09 +00:00
matt335672
f64c824a78 Set stream size correctly before adding TS_SURFCMD_STREAM_SURF_BITS header 2021-11-30 11:04:57 +00:00
matt335672
60016c1f75 Rename client_ip to connection_description 2021-10-25 11:35:35 +01:00
matt335672
62ca216d4d Improve security level logging at ISO layer 2021-09-03 12:30:02 +01:00
TOMATO-ONE
7847b23808 Bug fix when parameter is 0 2021-08-16 00:20:13 +09:00
TOMATO-ONE
badc612a8a override keyboard infomation #1950 2021-08-08 22:23:01 +09:00
matt335672
3ea19ef0cd Create ms-rdpeclip.h and update ms-rdpbcgr.h 2021-06-08 14:11:17 +01:00
matt335672
763f8fab7f xrdp_rdp_send_data() now works with --enable-devel-streamcheck 2021-05-28 10:57:12 +01:00
matt335672
52a52daddd Split development option into separate things 2021-05-28 10:57:12 +01:00
Koichiro IWAO
b7f5004008
Demote some too verbose logs to TRACE level
Fixes #1864.
2021-04-26 11:49:46 +09:00
Christopher Pitstick
deb66ce766 Resolution switching without reconnecting.
- Based on https://github.com/jsorg71/xrdp/tree/dynamic_monitor
- Tested with xorgxrdp
- Tested with vnc
- Only works with single monitor.
- Update documentation to clarify the difference between MSTSC and
Microsoft Remote Desktop.
- Does not include compatibility with /gfx at this time, which is still
in testing.
- Updates to include ms-rdpedisp.h header for the 2.2.2 specification of
the protocol.
- Adds new dynamic_monitor_layout struct that shares the number of
monitors with xrdp_client_info.h
- Does not allow for BPP changes because the RDP protocol doesn't
support it.
- Option to disable feature as NeutrinoRDP doesn't support it (It was
based on FreeRDP 1.0.1 which didn't yet have this feature.)
- Add CLIENT_MONITOR_DATA_MAXIMUM_MONITORS constant and reference
spec definition.

Depends on https://github.com/neutrinolabs/xorgxrdp/pull/183
2021-04-22 01:34:03 -04:00
matt335672
89843b12f4 Add versioning to xrdp_client_info 2021-02-26 11:27:13 +00:00
matt335672
94cda679f5 Added libxrdp_get_channel_count() 2021-02-04 10:29:56 +00:00
aquesnel
0ec471b02d
Add detailed logging to libxrdp (#1742)
* Added s_rem(s) for getting the remaining bytes in a stream
* Added s_rem_out() macro
* Fixed 15bpp pointer error checking
* Combined the 512 and 2048 bit certificate sending  code paths
* Other detailed comments and logging added following MS-RDPBCGR
2021-02-04 10:11:54 +00:00
Alexandre Quesnel
87c89f0aa2 Fixing TS_PLAY_SOUND_PDU_DATA to set the correct frequency and duration 2021-01-23 22:57:15 +00:00
metalefty
bba65b3592
Merge pull request #1738 from aquesnel/unify_logging_libxrdp
Unify logging in libxrdp
2020-12-23 09:59:21 +09:00
matt335672
0a1a8f40e5 Moved a lot of string funcs to string_calls module 2020-12-22 11:57:24 +00:00
matt335672
5523847540 Allow FuseMountName for chansrv to be absolute path 2020-12-21 12:36:31 +00:00
Alexandre Quesnel
121c17e818 Removing duplicate logging statements 2020-12-12 17:05:09 +00:00
Alexandre Quesnel
a82ee03d4d Changing LOG_DEVEL to LOG to avoid silent failures. 2020-12-05 19:22:50 +00:00
Alexandre Quesnel
2d6d249f76 Fixing code formatting with astyle 2020-11-30 05:04:11 +00:00
Alexandre Quesnel
51905d765a Migrating logging to LOG() and LOG_DEVEL() in libxrdp/* 2020-11-30 05:04:10 +00:00
matt335672
ebc21fe180 Added -c / --config to xrdp 2020-10-16 10:55:23 +01:00
matt335672
68f0fa7e4d
Merge pull request #1668 from bolkedebruin/enable_token_sso
Add support for token authentication
2020-09-09 10:10:13 +01:00
metalefty
8822771169
Merge pull request #1662 from aquesnel/fix_chunk_assembly
Adding checks to prevent buffer overruns during data chunk re-assembly
2020-09-01 08:37:11 +09:00
Bolke de Bruin
a6a0e5e004 Allow domain name to be concatenated to username
If a server is multihomed (i.e. mutiple domains) the
users are identified by their domain name. This change
allows to concat the domain name to the username with
a specific separator.
2020-08-30 21:56:16 +02:00
Bolke de Bruin
b0bca1363e Add support for token authentication
This feature allows to embed a token in the username field. Tokens
are separated from the username by the ASCII field separator character
0x1F (unicode 0x001F).
2020-08-29 10:40:22 +02:00
Alexandre Quesnel
33d9e1d5d7 Adding checks to prevent buffer overruns during data chunk re-assembly 2020-08-24 00:03:08 +00:00
bolkedebruin
5cd36c511c Set max character buffer len to 512 per MS specification
The MS specs determine that the character buffer lenngths
for usernames, domains, passwords, alternate shells, etc
can be up to 512 characters including the mandatory null
terminator.
2020-08-17 10:35:35 +02:00
matt335672
3c4b42b1aa Implemented resize and multimon support for VNC backend 2020-06-04 15:10:35 +01:00
matt335672
1c99d0a366
Merge pull request #1595 from matt335672/reset-improvements
Prevent chansrv input channels being scanned during a server reset
2020-06-03 12:15:07 +01:00
matt335672
81e037e964 Prevent chansrv input channels being scanned during a server reset 2020-06-03 11:57:25 +01:00
matt335672
bfffc40cba Ignore TS_MULTIFRAGMENTUPDATE_CAPABILITYSET from client if fp disabled 2020-05-26 12:02:11 +01:00
matt335672
da3114007c Address possible memory out-of-bounds accesses 2020-04-15 09:57:05 +01:00
matt335672
6f881d47d3 Rationalise ms- constants
Constants from MS documents (MS-RDPBCGR etc) moved out of
common/xrdp_constants.h into includes named after the documents.

Similar includes moved from sesman/chansrv to the common area.
2020-01-06 15:46:37 +00:00
Jay Sorg
0fbbc47092 cleanup refresh rect and check stream bounds 2019-11-07 02:03:57 +00:00
Jay Sorg
f4aebe021a add caps for refreshRect and suppressOutput 2019-04-25 14:54:25 -07:00
Jay Sorg
21f90e3ca2 work on suppress 2019-04-25 14:54:25 -07:00
Jay Sorg
9e9cada4ec work on suppress 2019-04-25 14:54:25 -07:00
Jay Sorg
ecf4acf5f1 work on suppress 2019-04-25 14:54:25 -07:00
Koichiro IWAO
062699334e
Fix typo s/BITMACACHE/BITMAPCACHE/ 2018-12-13 17:27:25 +09:00
Koichiro IWAO
c5d04a1133
Also rename constants in debug messages and comments 2018-12-13 17:25:57 +09:00
Koichiro IWAO
f714124b78
Fix constants mistakenly replaced
Pointed out by daixj-shterm.
2018-12-13 17:19:06 +09:00
Koichiro IWAO
0e9e25f100
use MS name for PDU types
RDP_PDU_REDIRECT has been removed as it is not found in MS-RDPBCGR and
not used anywhere.
2018-12-12 17:40:58 +09:00
Koichiro IWAO
b2a7bb0cf0
use MS for orderType constants 2018-12-12 17:40:58 +09:00
Koichiro IWAO
1ba921c5ed
Fix and / or mistake 2018-11-28 09:55:39 +09:00
Koichiro IWAO
83d3349c5a
add some more constants and use them 2018-11-27 15:08:22 +09:00
Koichiro IWAO
d188519c0c
constify more magic numbers 2018-11-27 15:08:22 +09:00
Koichiro IWAO
f1f699b954
remove redundunt comments 2018-11-27 15:08:22 +09:00
Koichiro IWAO
43f6ac0723
use MS name for constants 2018-11-27 15:08:22 +09:00
daixj
fcb1b825c5 neutrinordp: don't enable remote_app if the INFO_RAIL flag is not set 2018-11-23 17:18:26 +08:00
daixj
bc150c2e56 set use_cache_glyph_v2 on if the client support 2018-10-25 17:02:43 +08:00
daixj
b3a1889200 Support Cache Glyph Revison 2, issue #367 2018-10-25 10:34:00 +08:00
jsorg71
ae1514c167
dynamic virtual channel improvements
remove not used chansrv <-> xrdp messages
move static channel disable control into libxrdp
remove some blocking read, write chansrv calls
add drdynvc calls to libxrdp
add drdynvc calls to chansrv
channel cleanup
2018-10-11 22:09:20 -07:00
daixj
828079b442 libxrdp: fix memory leak 2018-02-13 16:44:37 +09:00
Koichiro IWAO
b17c45d86f
fix potential fd leak
In most cases, checking fd > 0 is not valid. open(2) returns -1 on
error, 0 on stdin, 1 on stdout, 2 on stderr, >2 . The border should be
between -1 and 0. Additionally, between 2 and 3.

Pointed out by: #919
2018-01-17 09:38:28 +09:00
Koichiro IWAO
a20d5c29e8 xrdp_caps: remove unneeded comment on case statement 2017-12-01 11:20:42 +09:00
Koichiro IWAO
64f15d6553 xrdp_caps: constify and sort capability set 2017-12-01 11:20:42 +09:00
Koichiro IWAO
788ae1467a xrdp_sec: constify color depth value 2017-12-01 11:20:42 +09:00
Koichiro IWAO
391c69731c libxrdp: advertise horizontal mouse wheel capability 2017-11-06 16:18:42 +09:00
Jay Sorg
9d36983ae7 fix for protocol error when 32 bit and non rfx 2017-07-12 15:03:08 +09:00
Jay Sorg
8d63c32899 move openssl calls to common/libssl.c, check for defines 2017-06-22 11:47:48 +09:00
Koichiro IWAO
a1b0344db5 Use the words "cannot read" rather than "cannot open"
as the code actually tests readability.
2017-06-12 16:57:04 +09:00
Koichiro IWAO
4f7969b562 Check certificate/privkey readability not existence
to fail RDP security negotiation if certificate/privkey is not readable
2017-06-12 16:57:04 +09:00
Koichiro IWAO
65c1fe87d7 Log user-friendly message when certificate/privkey is inaccessible
We shouldn't assume that xrdp daemon is running under root privilege.
In many cases, root privilege is not really needed for xrdp daemon.
xrdp may fail to load certificate/privkey due to lack of permissions
when running under user privilege. Checking existence of files is not
enough and xrdp should output user-friendly log in such case.

Reported by Debian user in bug 856436 [1].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856436
2017-06-12 16:57:04 +09:00
Pavel Roskin
148afd1170 Rename file_loc.h to xrdp_sockets.h, install it
Include xrdp_sockets.h directly, not through headers.
2017-03-28 00:59:16 -07:00
speidy
1c70e4915f xrdp_orders_rail: fix resulting unicode length 2017-03-24 15:36:36 +09:00
speidy
22f0b05b03 libxrdp: window update, simplify length checks 2017-03-24 15:36:36 +09:00
speidy
954b68314d xrdp_orders_rail: fix g_mbstowcs error handling 2017-03-24 15:36:36 +09:00
speidy
dfd639a3a9 RAIL: use fixed size length for window texts 2017-03-24 15:36:36 +09:00
Jay Sorg
fdb6195bbc rail, text length checks 2017-03-24 15:36:36 +09:00
Jay Sorg
3c95a2aef2 rail, text length checks 2017-03-24 15:36:36 +09:00
speidy
2f382d2a16 libxrdp: print connected client name to log 2017-03-21 22:02:29 -07:00
speidy
9d578d9c5f libxrdp: fix misleading variable name 2017-03-21 22:02:29 -07:00
speidy
b905967ba6 libxrdp: improve unicode_in 2017-03-21 22:02:29 -07:00
Pavel Roskin
43899b7e0c Allocate space for tls_ciphers dynamically 2017-03-21 10:39:40 -07:00
Pavel Roskin
6ed4c969f4 Eliminate APP_CC and DEFAULT_CC 2017-03-14 00:21:48 -07:00
Pavel Roskin
9cdcb38d87 Fix memory leak in tls_ciphers parsing 2017-03-13 17:17:06 +09:00
Koichiro IWAO
08ba9ed4a8 Remove useless comment, no logic change
Now client addr and port are properly logged.
2017-03-09 15:42:14 +09:00
Pavel Roskin
30a7a947b1 Don't include config_ac.h from any header files 2017-03-04 00:52:34 -08:00
Pavel Roskin
b2d3dcf169 Include config_ac.h from all source files 2017-03-04 00:52:34 -08:00
Pavel Roskin
1c355409a7 Fix compilation on MacOS
xrdp_rdp.c includes openssl/ssl.h now, make sure the OpenSSL include path
is used.
2017-03-01 20:39:48 -08:00
Koichiro IWAO
096baec331 no cast is needed for NULL 2017-02-27 14:17:25 +09:00
Koichiro IWAO
849c1a22a2 TLS: switch ssl_protocols to a comma separated list 2017-02-27 14:17:25 +09:00
Koichiro IWAO
c64e9992e6 TLS: warn if no SSL/TLS protocols enabled 2017-02-27 14:17:25 +09:00
Koichiro IWAO
e94ab10e14 TLS: new method to specify SSL/TLS version
SSL/TLS protocols only listed in ssl_protocols should be used.
The name "ssl_protocols" comes from nginx.

Resolves #428.
2017-02-27 14:17:25 +09:00