Commit Graph

2019 Commits

Author SHA1 Message Date
Henrik Andersson
2e80cdf396
Merge pull request #302 from uglym8/freebsd_conf_fix
Fix configure script on FreeBSD
2019-01-18 13:38:21 +01:00
Alexander Zakharov
68c7f9afbc Fix configure script on FreeBSD 2019-01-18 13:16:47 +03:00
Henrik Andersson
70931792f9
Merge pull request #301 from uglym8/fix_freebsd_build
Fix FreeBSD build
2019-01-18 11:15:12 +01:00
Alexander Zakharov
bb1c90fb49 Fix FreeBSD build 2019-01-18 13:01:12 +03:00
Henrik Andersson
4dca546d04 Malicious RDP server security fixes
This commit includes fixes for a set of 21 vulnerabilities in
rdesktop when a malicious RDP server is used.

All vulnerabilities was identified and reported by Eyal Itkin.

 * Add rdp_protocol_error function that is used in several fixes
 * Refactor of process_bitmap_updates
 * Fix possible integer overflow in s_check_rem() on 32bit arch
 * Fix memory corruption in process_bitmap_data - CVE-2018-8794
 * Fix remote code execution in process_bitmap_data - CVE-2018-8795
 * Fix remote code execution in process_plane - CVE-2018-8797
 * Fix Denial of Service in mcs_recv_connect_response - CVE-2018-20175
 * Fix Denial of Service in mcs_parse_domain_params - CVE-2018-20175
 * Fix Denial of Service in sec_parse_crypt_info - CVE-2018-20176
 * Fix Denial of Service in sec_recv - CVE-2018-20176
 * Fix minor information leak in rdpdr_process - CVE-2018-8791
 * Fix Denial of Service in cssp_read_tsrequest - CVE-2018-8792
 * Fix remote code execution in cssp_read_tsrequest - CVE-2018-8793
 * Fix Denial of Service in process_bitmap_data - CVE-2018-8796
 * Fix minor information leak in rdpsnd_process_ping - CVE-2018-8798
 * Fix Denial of Service in process_secondary_order - CVE-2018-8799
 * Fix remote code execution in in ui_clip_handle_data - CVE-2018-8800
 * Fix major information leak in ui_clip_handle_data - CVE-2018-20174
 * Fix memory corruption in rdp_in_unistr - CVE-2018-20177
 * Fix Denial of Service in process_demand_active - CVE-2018-20178
 * Fix remote code execution in lspci_process - CVE-2018-20179
 * Fix remote code execution in rdpsnddbg_process - CVE-2018-20180
 * Fix remote code execution in seamless_process - CVE-2018-20181
 * Fix remote code execution in seamless_process_line - CVE-2018-20182
2019-01-16 12:28:44 +01:00
Alexander Zakharov
1f13bf5c5e
Merge pull request #288 from markusbeth/lgtm_fixes
Lgtm fixes
2018-11-08 12:57:20 +03:00
Markus Beth
1aeff476b2 fix l_to_a does not work for a base other than 10 2018-11-07 00:20:39 +01:00
Markus Beth
55c85b55e7 fix lgtm: 'Too few arguments to formatting function'
maybe a typo that got copied around and leads to too few arguments in
formatting functions
2018-11-06 22:23:25 +01:00
Alexander Zakharov
ca03f60a09 Fix Solaris build 2018-10-31 10:51:13 +03:00
Henrik Andersson
c16b74a974 Run indent-all.sh script on source 2018-10-29 15:53:57 +01:00
Alexander Zakharov
6a14831965
Merge pull request #285 from gpatel-fr/master
Add TLS 1.1 and 1.2 support
2018-10-23 11:53:16 +03:00
gpatel-fr
8fcb535eba fix comments about TLS version 2018-10-22 21:03:57 +02:00
gpatel-fr
5ef8706e13 more helpful error message for TLS version problems 2018-10-22 21:02:23 +02:00
gpatel-fr
305b06d7fd Add TLS 1.1 and 1.2 support 2018-10-18 17:35:02 +02:00
Pierre Ossman
74b2129e09 Free socket buffers on disconnect
Otherwise we would leak the memory on every reconnect (and exit).
2018-07-02 13:40:46 +02:00
Pierre Ossman
daaa48108a Always include frame pointers with address sanitizer
This is needed to get proper stack traces with the sanitizer.
2018-07-02 13:39:39 +02:00
Pierre Ossman
5278291a82 Drain X event queue without any delay
A 100 ms delay between iterations was still too large for many cases,
so try to clear the event queue as fast as possible.
2018-07-02 13:23:22 +02:00
Henrik Andersson
5fbf4bd953 Fixes memleak where unprocessed X11 events builds up on queue
There is a limiter used for processing X11 events set to 20
for slicing between processing X11 event and processing data
on file descriptors. Before this fix, when waiting for data on
filedescriptors, we assumed that there were no pending X11
events left on queue and therefore the select() timeout on
60 seconds.

Now we will check the queue and select a timeout depending
on whats left to do.

Fixes bug #275
2018-06-29 10:31:48 +02:00
Henrik Andersson
79e5b3353b Add support for 16bit cursors
Fixes issue #273
2018-06-26 10:03:50 +02:00
Henrik Andersson
3918157521 Fix crash when freeing already freed null cursor.
The fallback cursor should never be destroy when removed from
cursor cache.

Fixes issue #274
2018-06-26 10:00:50 +02:00
Alexander Zakharov
0f9e410094
Merge pull request #258 from uglym8/sc_drop_refs
Fix scard logon
2018-04-27 12:03:06 +03:00
Alexander Zakharov
b77d00ceba Fix TS_SCardEstablishContext/TS_SCardIsValidContext
Current approach for TS_SCardEstablishContext() causes
Windows not to detect scard reader insertion in a case
when rdesktop was lauched without attached reader(s).

Thanks to demansong@gmail.com for the help to pinpoint this issue.
2018-04-27 13:46:45 +03:00
Rostislav Kondratenko
58f855a3a2 Enable PnP sc reader notifications 2018-04-27 13:46:45 +03:00
Rostislav Kondratenko
2abd25ae2a Fix scard logon 2018-04-27 13:46:45 +03:00
Henrik Andersson
567b1f7432 Clear password is smart card pin upon redirect
Upon a redirection, we have received a cookie that is used
for authentication and we should not flag this as a pin
code for the smartcard. This solves a problem with incorrect
pin code when using smart card authentication and if
redirected to a server were a session exists.
2018-04-17 16:57:05 +02:00
Pierre Ossman
0374d2ce9b Merge branches 'reconnect' and 'redynresize' of https://github.com/CendioOssman/rdesktop 2018-03-28 16:49:39 +02:00
Pierre Ossman
2fb1fd610f Update requested session size with RDPEDISP
We need to track the desired session size even if we can resize
without a reconnect. Otherwise we will request the wrong size in
the event we need to reconnect for another reason (e.g. network
problems).
2018-03-28 16:38:55 +02:00
Karl Mikaelsson
081eac429c Save and re-use resolved address for given hostname
If tcp_connect is called with the same server name, don't look up the
address again. This avoids connecting to other servers when using a
round-robin RDS farm name, as recommended by Microsoft.

This introduces a backwards-incompatible change. If rdesktop was
reconnecting because the user was moving between networks and the
server is no longer reachable on the same address, the user must
re-start rdesktop to reach their server.
2018-03-28 13:35:10 +02:00
Henrik Andersson
83aef969ab Cleanup of reconnect code
We have seen different behaviour between versions of Windows RDP
servers how a connection should be closed and rdesktop should exit.
Windows 2008 server and earlier versions sets an error info value of
0 and then sends deactivate PDU. Later versions sends a error info
of vlaue 12 (User initiated logoff) but does not send deactivate PDU.

A work around was added to translate this case for Windows 2008 and
earlier to newer aporach to get proper handling.

This prevents reconnect loop introduced when hitting ESC or wait for
timeout at logon screen against 2008 server or earlier.

This commit also fixes a problem where a reconnect loop was triggerd
even if no required 'auto-reconnect cookie' is received from the server.
2018-03-28 13:34:16 +02:00
Karl Mikaelsson
a0bf290ea2
Merge pull request #252 from rdesktop/revert-249-reconnect-related-fixes
Revert "Reconnect-related fixes"
2018-03-23 15:52:50 +01:00
Karl Mikaelsson
5c48d5d788
Revert "Reconnect-related fixes" 2018-03-23 15:49:11 +01:00
Karl Mikaelsson
8346fea6cc
Merge pull request #249 from derfian/reconnect-related-fixes
* When connecting to a Windows 2008 Server, pressing Cancel or hitting Escape while entering credentials (on the server) would lead to a reconnect if there was a resize pending.

* When connecting to a RDS farm name (round robin DNS entry as per MS recommendations), reconnecting could connect you to a different server, leading to a login screen rather than your session.

* rdesktop never had any logging that told you which address you were connecting to.
2018-03-23 09:38:17 +01:00
Karl Mikaelsson
d6c99bf599 Save and re-use resolved address for given hostname
If tcp_connect is called with the same server name, don't look up the
address again. This avoids connecting to other servers when using a
round-robin RDS farm name, as recommended by Microsoft.

This introduces a backwards-incompatible change. If rdesktop was
reconnecting because the user was moving between networks and the
server is no longer reachable on the same address, the user must
re-start rdesktop to reach their server.
2018-03-22 15:36:36 +01:00
Karl Mikaelsson
8c9c52abd2 Don't check server error codes if the server didn't disconnect us
When a user presses cancel in the login dialog on a session on Windows
2008 R2 while a resize was pending, the user would be reconnected to
the session rather than disconnected.

A naive fix for this problem led to problems where reconnecting to
resize a session led to the user being disconnected instead.

The solution for both of these problems is to only look at the error
code sent by the server is if the connection also was deactivated at
the time of the disconnect. In just about all other cases, a
disconnect/main loop quit when the connection is active should result
in a reconnect. The sole exception is if the user closed the rdesktop
window, in case rdesktop also should exit.
2018-03-22 15:31:37 +01:00
Cendio
4580492c12 Prefer online resize over reconnect resizes
We had a case on Windows 2012R2 where any early resizes would be
handled by a reconnect rather than an online resize, which led to a
bunch of follow-up problems with the session startup.

To solve this, we gave the RDPEDISP channel more time to become
established.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-03-07 10:49:25 +01:00
Cendio
62ea190c0c Exit rdesktop if error info is set
This fixes a problem where a connect loop is triggered
when a user is closing the session and there is a pending
resize triggered. When server sends error info PDU, this
means that the client should close and not enter a
reconnect due to pending resize or other reason such as
network error or redirect...

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
Co-authored-by: Thomas Nilefalk <thomas@nilefalk.se>
2018-03-01 13:52:54 +01:00
Cendio
a0af72a337 Fix fullscreen toggle when dynamic session resize is disabled
When dynamic session resize is disabled, leaving fullscreen should
result in a window that matches the session size.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-14 10:49:39 +01:00
Cendio
8bc2cea80f Add check if we can use dynamic session resize
When the server does not comply with our initial session size
request, we disable the dynamic session resize feature.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-14 10:49:30 +01:00
Cendio
9d163423eb Fullscreen windows should not be resized to match the session size
Given that a fullscreen window should have the same size as the
screen, when the server tells us a session size, then we can't
resize the fullscreen window.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
2018-02-13 14:14:02 +01:00
Alexander Zakharov
ad3ed6bcf0
Merge pull request #238 from uglym8/pcsc_v2_part10
Fix scard handling of PCSCv2 Part 10.
2018-02-09 14:39:48 +03:00
Alexander Zakharov
e3fbadfcf5 Fix scard handling of PCSCv2 Part 10.
We must not modify any features codes before sending
them off to Windows.
2018-02-09 14:34:01 +03:00
Karl Mikaelsson
08c293b405 Fix Fast-Path PDU decryption regression
This solves a problem where rdesktop would get really confused about
the data read from the server and crash in random places just after
connecting.
2018-02-02 17:13:36 +01:00
Henrik Andersson
fe8438d5c3
Merge pull request #245 from derfian/implicit-fallthrough
Remove implicit fall-throughs from bitmap.c and parallel.c
2018-02-01 16:31:29 +01:00
Karl Mikaelsson
50edf775e6
Merge pull request #236 from hean01-cendio/fastpath_cleanup
Refactoring of slow and fastpath handling and rdp_recv()
2018-02-01 14:39:25 +01:00
Henrik Andersson
1a82d4139b Cleanup of rdp_loop() and rdp_recv() for clarity 2018-02-01 13:12:57 +01:00
Henrik Andersson
b5708cf775 Refactoring of slow and fastpath handling
This changes clarifies a chunk of code related to receiving
data and handle slow and fast path pdus.
2018-02-01 12:47:22 +01:00
Karl Mikaelsson
1cdf4e87cb Remove implicit fall-throughs from bitmap.c and parallel.c 2018-01-31 15:04:49 +01:00
Cendio
81c030a887 Fix reconnect-loop going from initial fullscreen on Unity
Moving responsibility for actual resize to process_pending_resize()
Cleaning up duplicated calculation of session size
Removing handling of percentage of screen for now

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
58d8f78eea Add lots of protocol debug logging
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-31 11:03:32 +01:00
Cendio
3e2867e7ac Flush stdout for proper order of log messages
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-31 11:03:32 +01:00