Commit Graph

1939 Commits

Author SHA1 Message Date
Henrik Andersson
a61bb39dec Fix compiling warnings 2019-01-29 10:38:14 +01:00
Henrik Andersson
4bae3de6cd Add requirement of GnuTLS version 3.0
This is required for gnutls_store_pubkey/gnutls_verify_pubkey
api used in pubkey cache verification.
2019-01-29 10:38:14 +01:00
Henrik Andersson
307ca2eb03 Use base64 encode/decode routines from nettle instead of gnutls
This relaxes the version requirement for gnutls
2019-01-29 10:38:14 +01:00
Henrik Andersson
4781868e33 Added implementation of a gnutls pubkey store (tdb)
This fixes the problem with the default gnutls implementaion
that keys could not be updated eg. overwritten.
2019-01-29 10:38:14 +01:00
Henrik Andersson
11ca5446d9 Make certificate mismatch handling use util_dialog_choice() 2019-01-29 10:38:14 +01:00
Henrik Andersson
9c47a9fe66 Add util_dialog_choice() for display prompt and handle response 2019-01-29 10:38:13 +01:00
Alexander Zakharov
d7d55cf3f7 PoC: Check server's certificate 2019-01-29 10:38:13 +01:00
Alexander Zakharov
78afb19536 Fix Travis CI OSX build 2019-01-29 10:38:13 +01:00
Alexander Zakharov
23e22e3834 Temporary fix for gnutls_handshake() failure 2019-01-29 10:38:13 +01:00
Alexander Zakharov
90fd660803 Parse X.509 certificate, get RSA public key, RSA encrypt
Also add support older (< 3.5.0) GnuTLS versions
2019-01-29 10:38:13 +01:00
Alexander Zakharov
166d1bc14d Replace OpenSSL with GnuTLS for all network communications 2019-01-29 10:38:13 +01:00
Alexander Zakharov
00d9e0c4c8 Replace HMAC_MD5, SHA1, RC4, MD5 with Nettle's counterparts 2019-01-29 10:38:13 +01:00
Alexander Zakharov
673b267e66 Add ASN.1 parsing routines 2019-01-29 10:38:13 +01:00
Henrik Andersson
bc727e7ef1 One should be able to provide empty password via -p 2019-01-29 10:28:14 +01:00
Karl Mikaelsson
e92916eaae
Merge pull request #306 from rdesktop/uglym8-ewmh-fullscreen
Change the way we do fullscreen
2019-01-28 16:21:21 +01:00
Alexander Zakharov
1cbc2aa739 Change the way we do fullscreen 2019-01-28 11:09:16 +01:00
Henrik Andersson
1353fd75dd
Merge pull request #73 from uglym8/fix_sc_death
Handle insufficient server side buffer for smartcard operations
2019-01-23 14:26:39 +01:00
Alexander Zakharov
758f7b5156 scard: Fix buffer overflow
Even though we can detect that the server buffer is too small to
receive the APDU result we don't prevent the actual copy of this result
to allocated buffer which results in overflow.
2019-01-23 16:12:21 +03:00
Alexander Zakharov
774a657975 Handle insufficient server side buffer for smartcard operations
We should pay attention to OutputBufferLength of DR_CONTROL_REQ
and send STATUS_BUFFER_TOO_SMALL if it's insufficient for returned
result.
2019-01-23 16:12:21 +03:00
Henrik Andersson
d12204b424 Bumb version of supported redirect PDU
Before this change we announce that we support redirection
packet version 3 (Microsoft RDP 5.1 and 5.2 clients), this
makes the server to only send back LB_TARGET_NET_ADDRESS which
includes an IP address for the redirection. Announcing version
4 (Microsoft RDP 6.0 and 6.1 clients) will make the server to
send a LB_TARGET_FQDN which solves a few problems, for example
using kerberos authentication.

Fixes issue #303
2019-01-22 13:20:13 +01:00
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