Commit Graph

150 Commits

Author SHA1 Message Date
Daniel Richard G
1c0c923ad1 Split g_file_open() into _ro() and _rw() variants
Rename g_file_open() to g_file_open_rw(), and add a new g_file_open_ro()
call that wraps the common g_file_open_ex(file, 1, 0, 0, 0) idiom. This
will make the file access mode more explicit in the code.

Change all calls to g_file_open() to the _ro() or _rw() variant as
appropriate, and replace g_file_open_ex(file, 1, 0, 0, 0) with the _ro()
call.

Lastly, add tests for the two new calls to test_os_calls.c (code
courteously provided by matt335672).
2023-05-15 17:38:31 -04:00
matt335672
d8c8b22589 Disable autologon for empty passwords
Although there is nothing in the specification to prevent automatic
logons with empty passwords, this is not a secure default.

The autologon flag INFO_AUTOLOGON ([MS-RDPBCGR] 2.2.1.11.1.1) is now
ignored for empty passwords.
2022-12-30 10:28:57 +00:00
matt335672
1e42426db5 CVE-2022-23482
Check minimum length of TS_UD_CS_CORE message
2022-12-09 18:11:03 +00:00
a1346054
7fe18cc1c0
fix typos 2022-09-03 02:01:48 +00:00
matt335672
d5445e9dc1 Parse more physical monitor size information
To implement a scalable login screen, we need to be able to ascertain
the DPI of the connected primary monitor.

At present, in a multi-monitor situation, this information is available in
the struct display_size_description, which can be searched for the primary
monitor. This is only the case however if the Display Control Channel
Extension is in use ([MS-RDPEDISP]), and a DISPLAYCONTROL_MONITOR_LAYOUT
has been received.

This PR retrieves physical monitor size information from the following
two additional places.

1) The TS_UD_CS_CORE PDU. Physical size information is optionally
   included in this PDU for single-screen configurations.
2) The TS_UD_CS_MONITOR_EX PDU. This includes physical size
   information for multiple-screen configurations.
2022-07-29 10:48:04 +01:00
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
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
Christopher Pitstick
0a2562d33d Initial cut at a unit test for xrdp_sec_process_mcs_data_monitors 2021-12-08 01:41:07 -05: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
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
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
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
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
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
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
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
daixj
fcb1b825c5 neutrinordp: don't enable remote_app if the INFO_RAIL flag is not set 2018-11-23 17:18:26 +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
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
788ae1467a xrdp_sec: constify color depth value 2017-12-01 11:20:42 +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
6ed4c969f4 Eliminate APP_CC and DEFAULT_CC 2017-03-14 00:21:48 -07:00
Pavel Roskin
b2d3dcf169 Include config_ac.h from all source files 2017-03-04 00:52:34 -08: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
speidy
0a5bc44a0b libxrdp: use log_message 2017-01-15 08:46:04 +02:00
speidy
58d8cb0fd2 libxrdp: ignore incoming channels with empty names 2017-01-06 08:01:33 +02:00
speidy
94cdbdcee6 libxrdp: change channel_code into a meaningful name 2017-01-06 07:59:49 +02:00
Jay Sorg
da9439f24d libxrdp: warn when using 512 bit key 2016-11-11 22:29:54 -08:00
Koichiro IWAO
e2d4b65787 libxrdp: cleanup log log in xrdp_load_keyboard_layout 2016-09-06 15:55:11 +09:00
Koichiro IWAO
2488159645 libxrdp: log keyboard type/subtype 2016-09-02 13:44:11 +09:00
Koichiro IWAO
644242fc53 libxrdp: log keyboard options 2016-09-02 13:44:11 +09:00
metalefty
b934e55fc8 Merge pull request #364 from laigor/devel
Allows use the xkb options that for example allows you to specify a key combination to change the layouts.
2016-08-30 09:28:25 +09:00
Alex Illsley
47124df4ed new options for xrdp.ini disableSSlv3=yes and tls_ciphers=HIGH and code to implement 2016-08-25 11:20:47 -07:00
Pavel Roskin
ae5bb5bf9c Fix incorrect use of "it's" and "its", adjust wording 2016-06-21 16:30:15 -07:00
speidy
f5ec7f4102 libxrdp: oops, fix virtual desktop size check 2016-05-18 00:24:16 -04:00
speidy
881756a82c libxrdp: oops, fix virtual desktop size check 2016-05-18 00:23:07 -04:00
speidy
36c17767b7 libxrdp: in CS_MONITOR, validate virtual desktop size we got from client 2016-05-18 00:20:41 -04:00
speidy
b38dcf1bb0 xrdp_wm: fix for multimon, draw login window and log window on primary
monitor
2016-05-17 20:11:49 -04:00
Pavel Roskin
70f3d4c5e2 Fix warnings for unused variables read from byte streams 2016-04-23 00:18:38 -07:00