Commit Graph

294 Commits

Author SHA1 Message Date
Pierre Ossman
256d8e2b3c Respect TLS version argument
The code handling it was lost in the switch from OpenSSL to GnuTLS.
Restore the functionality in the new code.
2019-09-16 09:24:49 +02:00
Pierre Ossman
9f14da3eb2 Revert "Always prompt for password if not provided via commandline."
This reverts commit 1aaafc80c0.

This change has caused a lot of issues, so we need to pause this for
now and figure out a way to make the transition smoother.
2019-09-03 16:07:58 +02:00
Pierre Ossman
48b184477e Fix bad call to strncat() 2019-04-12 14:37:24 +02:00
Pierre Ossman
cf95138c9b Don't use strncpy() when not needed
It upsets the compiler warnings when you do strncpy() with the
source buffer size as the limit. It is also unnecessary to use
strncpy() here as we just allocated a buffer guaranteed to be
large enough.
2019-04-12 14:37:24 +02:00
Alexander Zakharov
85f99edd65 Update copyrights 2019-02-01 11:21:32 +03:00
Alexander Zakharov
d7d55cf3f7 PoC: Check server's certificate 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
Markus Beth
1aeff476b2 fix l_to_a does not work for a base other than 10 2018-11-07 00:20:39 +01:00
Henrik Andersson
c16b74a974 Run indent-all.sh script on source 2018-10-29 15:53:57 +01:00
gpatel-fr
305b06d7fd Add TLS 1.1 and 1.2 support 2018-10-18 17:35:02 +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
5c48d5d788
Revert "Reconnect-related fixes" 2018-03-23 15:49:11 +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
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
07abc9bade Defer pending resize until after autoreconnect cookie is received
Resize session using disconnect/reconnect sequence should not be
performed before we have received an auto-reconnect cookie which is
used for reconnecting to the session. There is a race when trying to
reconnect at this point so a defer timer is used to delay this further
from the point where the auto-reconnect cookie is received.

Fixes a problem where a login prompt is shown upon reconnect even if
the auto-reconnect cookie is available and used.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-31 11:03:32 +01:00
kekePower
8376afac54
Fix to compile with GCC 7.3.0 and possibly fix a security issue
Did a google search and found this.
https://stackoverflow.com/questions/4419293/warning-format-not-a-string-literal-and-no-format-arguments/4419319#4419319

With this little fix, rdesktop compiled again using gcc 7.3.0.
2018-01-29 20:35:44 +01:00
Cendio
1f3d1fb3e0 Refactor handling of user requested window sizes
Extract ui_init_connection() into smaller functions
to clarify purpose.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
7f76e2218a Rename of global variable for clarity
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
8ef9f39aa8 Avoid fight about requested session size upon disconnect/reconnect resize.
Move ui_init_connection() outside main loop since it is the source for the
fight of requested session size after a resize reconnect. This should only
be called once for setting up initial requested session size via command
line args.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
ba41f749c6 Refactor g_sizeopt into an enumeration for clarity
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-11 15:10:05 +01:00
Cendio
e2f5a7b532 Refactor geometry string parsing
Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2018-01-11 15:10:05 +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
Alexander Zakharov
04ebaefede Allow single character passwords 2017-12-01 11:55:06 +03:00
Cendio
d037db1086 Increase default desktop size and enable wallpaper 2017-11-09 17:15:16 +01:00
Cendio
2f03f65efe Add Dynamic Virtual Channels and basic RDPEDISP support
Fix issue #192

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Karl Mikaelsson <derfian@cendio.se>
2017-11-09 15:39:39 +01:00
René Genz
9e99dd52d6 Fix minor spelling mistakes 2017-11-02 01:01:44 +01:00
Joshua Hudson
e7cda3dbf8 add -M for local mouse cursor 2017-11-01 06:47:31 +01:00
joshudson
fe692058a2 Add Windows 10 support: add option to send DPI to server as Windows 1… (#66)
Add support  for choosing DPI of remote session
2017-11-01 06:37:18 +01:00
Henrik Andersson
bace190ba5 Merge pull request #175 from derfian/pointer-shadows
Enable cursor shadows in all experience levels but modem
2017-10-18 10:02:49 +02:00
Karl Mikaelsson
ad98c55130 Enable cursor shadows in all experience levels but modem
Cursor shadows started working after the large pointer support was
introduced, so turn it on for most experience levels.
2017-10-17 10:40:32 +02:00
Henrik Andersson
c99eb954d3 Fix warning about compare of signed and unsigned 2017-10-17 09:56:54 +02:00
Henrik Andersson
032d67f6ac Remove global variable g_bitmap_compression
g_bitmap_compression is a global variable scattered through the code
but only accessed and used in one place; rdp_out_bitmap_caps().
Demoted it to localvariable and replaced with hardcoded value.
2017-10-16 15:34:47 +02:00
Samuel Mannehed
b0813fa275 Add handling for a few special RDP error codes
Most of the RPD protocol errors (reason > 0x1000) would only be
triggered by coding errors in the client. A few of them can occur due
to server errors however. We should attempt to handle these cases.
2017-10-04 16:27:34 +02:00
Samuel Mannehed
e8562507e7 Add handling for connection broker error codes 2017-10-04 15:51:36 +02:00
Samuel Mannehed
e272feaa8a Print the reason code for protocol errors 2017-10-04 15:50:49 +02:00
Samuel Mannehed
dfad103fd9 Tweak wording of disconnect reason messages
They are now a bit more specific and better match the description of
the disconnection reasons sent by the server.
2017-10-04 12:36:59 +02:00
Samuel Mannehed
3aca74880a Fix specific admin/user disconnect/logout codes
There seems to have been confusion with regards to which exit code and
message was returned by rdesktop for the following cases:

* disconnected by admin
* logged out by admin
* disconnect by user
* logoff by user

Looking at Microsoft's official documentation as well as testing using
Windows Server 2008 R2, 2012 R2 and 2016 reveals that this commit fixes
this issue. They do now match the reasons sent by the server.
2017-10-04 12:32:42 +02:00
Samuel Mannehed
a6a2120cf7 Rename constants for disconnect reasons
To make them easier to search for - let's match the names with the
corresponding names on the server side:

https://msdn.microsoft.com/en-us/library/cc240544.aspx
2017-10-04 09:35:14 +02:00
Henrik Andersson
1aaafc80c0 Always prompt for password if not provided via commandline.
This fixes several issues where credentials are required
before the connection is carried out. Such as dual
authentication prompts when redirected by load balancer.
2017-08-15 12:37:14 +02:00
Henrik Andersson
c07bfffabf Use a prompt reflecting password or smart card pin 2017-08-15 10:48:35 +02:00
Henrik Andersson
8586cfc8cb Remove deprecated rdp2vnc
Fixes issue #95
2017-08-14 15:58:48 +02:00
Henrik Andersson
05689dbc99 Fix to reset clipping at reconnect resize
The previous fix for clipping problems was not enough, reverted
that change in xwin.c in favor for adding reset of window clipping
rect at reconnect.

Fix issue #117
2017-05-15 14:57:50 +02:00
Henrik Andersson
b9481bb01b Fix reconnection using the cookie
The use of redirection cookie was never done due to global
g_redirect flag was cleared on the wrong place. This fixes
the problem with dual authentication prompts when redirect
to another server upon connect.

Fixes issue #18
2017-05-15 08:36:41 +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
71bf45a5d7 Ran indent-all script 2017-01-25 00:34:37 +01:00
Henrik Andersson
2ea3f69873 Raise requirment for iconv to required
This commit changes rdesktop project to require iconv().

Part of issue #89
2017-01-20 08:46:27 +01:00
Henrik Andersson
d952852629 Enable FontSmoothing per default
FontSmoothing is now enabled per default or if experience selected by lan or broadband.
2016-08-23 12:43:15 +02:00
David Hill
b3eeca3da0 Fix crash due to missing argument 2016-07-21 12:39:56 -04:00
remijouannet
b46639ad3c indent-all.sh 2016-05-24 18:02:22 +02:00
remijouannet
0f0f64a97e fixing indent 2016-05-24 17:55:28 +02:00