Commit Graph

169 Commits

Author SHA1 Message Date
Karl Mikaelsson
3b0a0c1334 Improve rdp_out_general_caps
Rename to rdp_out_ts_general_capabilityset to match the structure
name, describe all fields and use constants instead of magic numbers.
2017-10-13 14:02:03 +02:00
Henrik Andersson
594438e5eb Make deprecated rdp_out_unistr() static 2017-09-29 16:30:17 +02:00
Henrik Andersson
de8fe9429f Add two new stream functions for writing utf16 strings
This is the first steps of removing the old rdp_out_unistr() and
using clearer code.
2017-09-29 14:24:27 +02:00
Henrik Andersson
b872ddb21d Ran indent script 2017-06-07 09:39:29 +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
708b0f0071 Rename redirection flags matching names in specification
Also added missing flags available from spec
2017-05-15 08:03:39 +02:00
Henrik Andersson
c93960b266 Cleanup of TS_SECURITY_HEADER code
Add correct naming of header TS_SECURITY_HEADER and its flags
as per MSRDPBCGR specification.
2017-03-07 15:32:14 +01: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
79b9813df5 Minor refactor of rdp_out_unistr()
The logon packets wants a mandatory null termination
to be written to stream if not string is available.
The current design was to do if statements at those
points to handle this. Refactored that code into
function rdp_out_unistr_mandatory_null() for a
cleaner code when building up the packets.
2017-01-20 10:32:46 +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
c7369052cc Regression in RDP_V4 logon packet introduced by commit 78a4f41.
Commit 78a4f41, forces the caller to handle the write of empty string byte
where protocol needs it. This commit fixes the RDP V4 logon packet which needs
a mandatory 2 bytes null terminator to be written if strings are empty.

Fixes issue #67
2016-10-14 13:27:09 +02:00
Henrik Andersson
e62ad7cee9 Fix crash in rdp_in_unistr() issue #25 2016-06-16 16:06:36 +02:00
Henrik Andersson
ee8366405d Make sure we handle redirection PDU packet received
within rdp_connect() loop.

Fixes silent exits of rdesktop when receiving a redirection
PDU before license handling which is a corner case appeared
while using CredSSP+Kerberos.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1825 423420c4-83ab-492f-b58f-81f9feb106b5
2014-08-27 12:19:59 +00:00
Henrik Andersson
78a4f41f48 Fix sigsegv while using credssp and kerberos without
specifying domainname as argument.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1824 423420c4-83ab-492f-b58f-81f9feb106b5
2014-08-27 12:15:21 +00:00
Henrik Andersson
d70b65edc7 Revert of commit 1794.
Fixes regression with "disconnect: Invalid licensing message."



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1823 423420c4-83ab-492f-b58f-81f9feb106b5
2014-08-18 07:47:07 +00:00
Henrik Andersson
d3c4cb3535 Run indentation script.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1805 423420c4-83ab-492f-b58f-81f9feb106b5
2014-05-20 14:34:45 +00:00
Henrik Andersson
a563c49723 Use correct types for reading cursot hotspot and
clamp the point into cursor boundingbox.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1799 423420c4-83ab-492f-b58f-81f9feb106b5
2014-05-20 06:27:09 +00:00
Henrik Andersson
a1f8856484 Make password variable global and clear it in correct place.
This fix a bug where redirection using CredSSP fails to SSO
due to wrong password sent to server and asks for a correct one.
The source to this issue was that the password was zeroed before
the actual redirection is handled.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1795 423420c4-83ab-492f-b58f-81f9feb106b5
2014-04-24 12:02:40 +00:00
Henrik Andersson
708c3861f1 Remove process of packets in rdp_connect.
The process of packets in rdp_connect assumes that the
first packets are demand active to set g_rdp_shareid which
is not true. In case when CredSSP+Kerberos is in use an
enhanced redirection PDU packet is sent before the demande
active PDU.

This fixes the problem with rdesktop silently exists in
the case above.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1794 423420c4-83ab-492f-b58f-81f9feb106b5
2014-04-23 06:11:55 +00:00
Henrik Andersson
38ca609c78 Added minimal implementation for TS_AUTORECONNECT_STATUS_PDU.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1789 423420c4-83ab-492f-b58f-81f9feb106b5
2014-02-19 08:57:51 +00:00
Henrik Andersson
f28bddc81b Fix bug with broken auto reconnect packet, introduced
in commit 1766.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1786 423420c4-83ab-492f-b58f-81f9feb106b5
2014-02-07 13:10:45 +00:00
Henrik Andersson
7ece007132 Fix indentation...
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1778 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-12 14:01:58 +00:00
Henrik Andersson
c618390bbe Break out of rdp main loop if server sent a redirect PDU.
This is needed on 2012r2 were server will not disconnect
a rdp connection after a redirect packet.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1777 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-10 11:16:56 +00:00
Henrik Andersson
f0b6604347 Changed rdp_in_unistr() to make dynamic allocation of converted string
instead of using hardcoded buffer sizes and assumtion that conversion
just fits the size.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1773 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-06 12:43:08 +00:00
Henrik Andersson
6de37a4f3b Dynamic allocation of redirect username.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1772 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-06 07:54:51 +00:00
Henrik Andersson
8c5d480bf3 Use g_redirect flag when creating a logon packet and clear
the flag when finished.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1771 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-04 11:52:33 +00:00
Henrik Andersson
a090d06331 Use redirect cookie instead of password if available.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1768 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-28 15:13:04 +00:00
Henrik Andersson
a2492ab3b0 Missed to run indent-all script of previous script.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1767 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-28 14:47:29 +00:00
Henrik Andersson
030333d7e1 Cleanup and clarify of TS_INFO_PAKCKET.
- Removed unused LOGON_BLOB code
- Removed AUTOLOGON, if password is null no logon will be
  performed anyway.
- Comments of fields written to packet
- Clarified string handling difference between TS_INFO_PACKET
  and TS_EXTENDED_INFO_PACKET



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1766 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-28 14:46:14 +00:00
Henrik Andersson
820a2f7bb8 Server redirect password should be interpreted as a binary blob
and not a unicode string, which is passed though as a password
during the redirection.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1765 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-28 11:59:05 +00:00
Henrik Andersson
a1db8d906c Fix issue while parsing the redirect packet to match the spec.
However there is a change in the length compared to current
implementation which has provenly been working, so lets handle it
with a flag for now.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1764 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-28 11:33:50 +00:00
Henrik Andersson
092f895a20 Revert an issue introduced by commit r1757 due to
unclear specs. The data is processed in lower layers
in the protocol stack.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1763 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-28 11:18:11 +00:00
Henrik Andersson
448a16511f Fixe bug with size of destination for unistr convert.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1761 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-26 11:47:16 +00:00
Henrik Andersson
e63a44acb1 Completes previous commit r1759, making redirect server string
dynamically allocated when used.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1760 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-26 11:40:45 +00:00
Henrik Andersson
a080b6750e Make use of announce target FQDN in a redirect.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1759 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-26 11:26:49 +00:00
Henrik Andersson
3c110e5e17 Do not perform an actual redirect if server redirect pdu is
flagged as informational.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1758 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-26 11:06:32 +00:00
Henrik Andersson
f74729b592 Added handling of enhanced security redirect PDU.
Part of the rework of server redirection.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1757 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-26 08:21:06 +00:00
Henrik Andersson
3e0d255bfb Initial cleanup of the redirection implementation.
Renamed redirect cookie to proper redirect load balance info,
also made it dynamically allocated due to its variable length.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1756 423420c4-83ab-492f-b58f-81f9feb106b5
2013-11-26 07:56:04 +00:00
Henrik Andersson
58363c5351 - Added rd_create_ui() helper function
- Make sure that ui is created if processing demand active PDU
- Make sure we use precached bitmap cache again

This fixes bugs #367 and #368



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1732 423420c4-83ab-492f-b58f-81f9feb106b5
2013-08-14 13:49:45 +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
51014c91df Initial implementation of kerberos server autentication with CredSSP,
disabled by default and is enabled using argument --enable-credssp
to configure script.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1676 423420c4-83ab-492f-b58f-81f9feb106b5
2012-11-15 11:21:01 +00:00
Peter Åstrand
5cb7910413 Indented with indent-all.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1670 423420c4-83ab-492f-b58f-81f9feb106b5
2012-10-23 11:38:27 +00:00
Henrik Andersson
0f5824d414 Rename of internal ssl_ wrapper functions/defines to
rdssl_ to prevent nameclashing with openssl library now
when we link against ssl library.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1665 423420c4-83ab-492f-b58f-81f9feb106b5
2012-07-02 11:36:39 +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
c5415ded44 Try to fix 3428380 - session redirection broken in 1.7.0. We must not
call sizeof or strlen on a new dynamically allocated string. 



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1639 423420c4-83ab-492f-b58f-81f9feb106b5
2011-10-26 10:53:39 +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
42f4ca28d5 Committed load balancing fixes from Daniel Drown. Hopefully fixes bug
#2845414.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1557 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-21 09:24:40 +00:00
Peter Åstrand
6ee9faeffc Added RandR support: If the specified geometry depends on the screen
size, and the screen size is changed, rdesktop will automatically
reconnect using the new screen size. This feature uses the previously
implemented autoreconnect feature. 

The new UI function ui_seamless_end() has been introduced, to make it
possible to resize in seamless mode as well. 



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1556 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-20 09:59:47 +00:00
Peter Åstrand
0983e771c8 Only try to use automatic reconnect if we have earlier recieved the
reconnect random. It seems to work anyway, but let's take care.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1541 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-12 15:00:49 +00:00