Commit Graph

82 Commits

Author SHA1 Message Date
Henrik Andersson
6577cc57e9 Do not use DN as key for certificate cache as it is insecure 2019-01-29 10:38:14 +01:00
Henrik Andersson
3ab19d543c Revert "Added implementation of a gnutls pubkey store (tdb)"
This reverts commit f493395fc7e36e504c27cab8ad973042c55f0767.
2019-01-29 10:38:14 +01:00
Henrik Andersson
95fac5e1f6 Revert "Use base64 encode/decode routines from nettle instead of gnutls"
This reverts commit 252bc346e2379475f8547d4a458743bed067448d.
2019-01-29 10:38:14 +01:00
Henrik Andersson
18287bdacf Add certificate verification against system trust store
Verify the certificate from the peer against the system’s default
trusted CAs. If certificate fails the verification a fallback to
use the certificate cache is used.

The certificate cache is used to give the user the option to add
exceptions for invalid certificates. For example; self-signed
certificates etc.
2019-01-29 10:38:14 +01:00
Henrik Andersson
2a955dbf84 Never silently add a certificate to cache
A user always needs to approve to add an exception for
a invalid certificate.
2019-01-29 10:38:14 +01:00
Henrik Andersson
a61bb39dec Fix compiling warnings 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
Alexander Zakharov
d7d55cf3f7 PoC: Check server's certificate 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
166d1bc14d Replace OpenSSL with GnuTLS for all network communications 2019-01-29 10:38:13 +01:00
Henrik Andersson
c16b74a974 Run indent-all.sh script on source 2018-10-29 15:53:57 +01:00
gpatel-fr
8fcb535eba fix comments about TLS version 2018-10-22 21:03:57 +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
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
Karl Mikaelsson
5c48d5d788
Revert "Reconnect-related fixes" 2018-03-23 15:49:11 +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
Cendio
ab50ea31cf Implement dynamic session resize
This adds support for resizing the RDP session dynamically based on
the window size. Some complicated logic has been added to avoid
sending excessive amounts of resize requests to the RDP server.

When supported, this resize mechanism should use the RDPEDISP way of
signalling the server to initiate a Deactivate/Activate sequence, but
rdesktop will fall back on Disconnect/Reconnect if RDPEDISP is not
supported by the server.

ui_select has been refactored and most functionality has been broken
out into three new functions, simplifying ui_select into a loop.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2017-12-07 11:15:03 +01:00
Henrik Andersson
fc6ce03875 Make use of shared stream api
Remove own componized realloc and reset code to
shared stream api implementation.
2017-09-28 19:15:00 +02:00
Henrik Andersson
908ad64d84 Add additional logging for SSL errors
This was added to provide more information when things fails
as in  issue #118.
2017-05-12 13:15:45 +02:00
Henrik Andersson
87d8d123b8 Rework the logging system
This commit will add a logging system to solve the problem that
one actually need to recompile rdesktop from source to enable
different debug logging.

- Same logging api  for all kind of logging and messages to
   end user.

- Adding -v for verbose output when running rdesktop.

- All messages are logged into a subject and with a type, eg:

     logger(Keyboard, Notice, "Autos-electing %s based on locale.", locale);

- Debug logging is enabled trough a environment variable RDEKSTOP_DEBUG,
  which specifies subjects of interest, comma separated. There is a special
  subject named All which includes all subject for debug loggin. There is also
  a simple logic opeartor '!' = NOT which can be used in combination like:

    RDESKTOP_DEBUG=All,!Graphics,!Sound

  Which would give debug log output for All subject except Graphics and Sound.
2017-01-26 14:19:40 +01:00
Henrik Andersson
a90ea17abb Test if SSL_OP_NO_COMPRESSION is defined before use.
OpenSSL < 0.9.9 does not support this option, see upstream
commit 566dda07ba16f9d3b9774fd5c8d526d7cc93f179 for reference.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1734 423420c4-83ab-492f-b58f-81f9feb106b5
2013-08-29 14:27:25 +00:00
Henrik Andersson
be5ae57fe0 Return a NULL value as expected.
Partly fix for bug #366



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1728 423420c4-83ab-492f-b58f-81f9feb106b5
2013-08-10 16:16:55 +00:00
Henrik Andersson
cab6380beb Do not do SSL_Shutdown if we have triggered a network error,
this will result in segfault in ssl.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1722 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-27 10:43:34 +00:00
Henrik Andersson
adbb6cf0fc Run indent-all script.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1721 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-20 12:57:00 +00:00
Henrik Andersson
e6b10f6bcb Added tcp_ui_run() to prevent ui_select() push data on transport
which corrupts the stream and prevents a SSL reconnect to work.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1720 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-20 12:51:27 +00:00
Henrik Andersson
dc3be1486d Bring back reset of g_ssl on reset_state()
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1719 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-20 11:10:24 +00:00
Henrik Andersson
8200b5bbd4 Move g_ssl cleanup from reset_state() and only setup one ssl context per process.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1718 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-20 10:50:39 +00:00
Henrik Andersson
8ba120fdbd SSL library initialization is not reentrant, lets do it once.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1717 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-20 09:36:11 +00:00
Henrik Andersson
ae7c48a1c0 Set g_sock at correct point and remove from reset_state()
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1716 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-20 09:29:21 +00:00
Henrik Andersson
cd7a7342cb Silence some error spamming when rdesktop is in reconnect loop.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1713 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-14 12:54:38 +00:00
Henrik Andersson
7d2f65002a Make sure we don't spam log with failed send() messages if we
already have detected a network failure.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1711 423420c4-83ab-492f-b58f-81f9feb106b5
2013-06-13 11:01:55 +00:00
Henrik Andersson
eced6ca821 Reconnect upon network failure, retry as long the autoreconnect
cookie is valid.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1707 423420c4-83ab-492f-b58f-81f9feb106b5
2013-04-12 06:46:07 +00:00
Henrik Andersson
9f174ea864 Added check if socket is connected to prevent sending disconnect
sequence to a closed socket.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1681 423420c4-83ab-492f-b58f-81f9feb106b5
2012-11-22 13:38:35 +00:00
Henrik Andersson
6d437f8116 Change the SSL context option to specific onse instead of using all
which introduces some problems.
Added some graceful handling of peer SSL shutdown for better error
reporting.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1675 423420c4-83ab-492f-b58f-81f9feb106b5
2012-11-15 11:20:37 +00:00
Henrik Andersson
c44025aa18 Added support for protocol negotiation, this is a part of
adding Enhanced RDP Security support to rdesktop and brings
support for TLSv1 tunnel functionality.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1659 423420c4-83ab-492f-b58f-81f9feb106b5
2012-06-15 05:16:20 +00:00
Peter Åstrand
b638882347 Include emails in copyright statements.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1615 423420c4-83ab-492f-b58f-81f9feb106b5
2011-04-13 11:13:04 +00:00
Peter Åstrand
27068f53f8 Updated the copyright notices for the things we have been working on.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1612 423420c4-83ab-492f-b58f-81f9feb106b5
2011-04-13 08:55:42 +00:00
Peter Åstrand
281d7c9f06 Changed license to GPLv3
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1534 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-12 08:31:06 +00:00
Peter Åstrand
058ee33be3 Clean up and document the return values. Trying to solve a number of issues:
* The current return values have been selected pretty much without any
thought. Basically, the value 1 is used for all different kinds of
errors, except for a corner case where the server doesn't send a
RDP_PDU_DEACTIVATE in combination with a few special "reasons", where
the value 2 is used instead.

* rdesktop will currently also return with 2 if the user is closing
the rdesktop window, the same error as many other fatal errors, which
is somewhat strange.

* The main principle of my patch is to utilize more of the available
256 return codes. We are currently only using 3 values out of
256. This is bad; rdesktop should expose more information to the
caller about error conditions if it can.

Besides using the standardized exit codes for generic errors such as
EX_USAGE for command line usage errors, I've also exposed the
"extended disconnect reasons" from RDP. This allows for, for example,
to be able to distinguish between a logoff and a disconnect.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1510 423420c4-83ab-492f-b58f-81f9feb106b5
2009-09-02 13:03:43 +00:00
Jay Sorg
88855ddcbf update the copyright year
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1474 423420c4-83ab-492f-b58f-81f9feb106b5
2008-07-11 03:51:23 +00:00
Michael Gernoth
a8338fcd6e always make g_out an array
this removes duplicated code from scard.c


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1396 423420c4-83ab-492f-b58f-81f9feb106b5
2007-02-20 16:51:46 +00:00
Jay Sorg
6091381a81 prefix BOOL with RD_
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1371 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-08 04:47:06 +00:00
Jay Sorg
797df4fa02 copyright year update
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1364 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-04 05:39:39 +00:00
Peter Åstrand
9d9a7ecdcb Indent fix
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1361 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-03 06:41:13 +00:00
Jay Sorg
c1aa0656a4 win32 bits
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1348 423420c4-83ab-492f-b58f-81f9feb106b5
2006-12-23 03:23:59 +00:00
Michael Gernoth
c3f49ea246 more smartcard locking fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1327 423420c4-83ab-492f-b58f-81f9feb106b5
2006-11-03 23:51:35 +00:00
Michael Gernoth
f37c871e8b Smartcard support by Alexi Volkov <alexi@pravex.kiev.ua> and additional
patches for smartcard-support by Jennings Jared <jared.jennings.ctr@eglin.af.mil>


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1308 423420c4-83ab-492f-b58f-81f9feb106b5
2006-11-01 20:52:01 +00:00