Commit Graph

66 Commits

Author SHA1 Message Date
dbac3db7b7 Fourth Batch: Update files using ChatGPT 4o 2024-05-31 16:42:49 +02:00
Pierre Ossman
aa5164ede4 Fix protocol code handling new licenses
s_seek() is a macro, so it is dangerous to use complex expressions
in it as they may be evaluated multiple times and at incorrect times.
In this case we ended up trying to jump to an incorrect offset.
Work around this by having a dedicated variable for the target offset.
2019-05-21 12:58:47 +02:00
Pierre Ossman
25b8412333 Avoid poking around in STREAM internals
It's easy to make mistakes this way, and bypassed the normal bounds
checking. So make sure we always use macros or functions.
2019-05-06 14:33:38 +02:00
Pierre Ossman
c6d8b933c8 Avoid preallocated streams in tcp.c
We don't know when the caller might be done with a stream, so we
can end up with code overwriting things in a stream that is in use
elsewhere.

Solve the issue by returning a new stream each time and leave it
up to the callers to free it.
2019-05-06 14:33:05 +02:00
Pierre Ossman
75221eb3c5 Separate behaviour of out_uint8a and out_uint8p
Make them more match in_uint8a and in_uint8p in that one copies and
the other just gives you a pointer and it is up to the caller how
to fill it in. This can be useful when other APIs are used to
generate the data as it avoids a temporary buffer.
2019-05-06 14:33:05 +02:00
Henrik Andersson
c16b74a974 Run indent-all.sh script on source 2018-10-29 15:53:57 +01:00
René Genz
9e99dd52d6 Fix minor spelling mistakes 2017-11-02 01:01:44 +01:00
Henrik Andersson
fd1673392e Fix unused-but-set-variable compiler warnings 2017-10-17 10:50:14 +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
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
0628179dba Send correct type for new licence request.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1783 423420c4-83ab-492f-b58f-81f9feb106b5
2014-02-06 10:33:44 +00:00
Henrik Andersson
f8b0b64742 Update licence constants to match specs for clarity
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1782 423420c4-83ab-492f-b58f-81f9feb106b5
2014-02-06 10:32:52 +00:00
Henrik Andersson
b9d0c366e2 Update debug log to use the new license constants.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1781 423420c4-83ab-492f-b58f-81f9feb106b5
2014-02-06 09:48:56 +00:00
Henrik Andersson
f613559ea5 Added a handler for license error alert.
There is a special case in here we need to consider, when no license is received
from the server we will get a License Error Alert PDU - Valid Client packet which
indicates that everything is ok.

This solves a connection error which resulted in protocol error 76.




git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1780 423420c4-83ab-492f-b58f-81f9feb106b5
2014-02-05 11:58:22 +00:00
Henrik Andersson
b4dfb9b5e0 Use license terms used in specification for easier overview.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1779 423420c4-83ab-492f-b58f-81f9feb106b5
2014-02-05 09:50:29 +00:00
Henrik Andersson
9189cd55de Removed bad check against dwVersion which always made returned
before licence is stored.

Remove set of g_licence_issued flag at the wrong place.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1672 423420c4-83ab-492f-b58f-81f9feb106b5
2012-10-29 07:20:54 +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
Henrik Andersson
cdce9aae75 Run indentation script.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1658 423420c4-83ab-492f-b58f-81f9feb106b5
2012-01-16 06:35:13 +00:00
Henrik Andersson
e789af1aea Added some meaning to a hardcoded value.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1647 423420c4-83ab-492f-b58f-81f9feb106b5
2011-11-25 09:55:32 +00:00
Henrik Andersson
0b87100632 Applied patch from Thomas Uhle which includes fixes
the license handling, this patch fixes bug 2817779.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1642 423420c4-83ab-492f-b58f-81f9feb106b5
2011-11-15 07:27:17 +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
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
27388283ad Removed the hardcoded limit of the username length.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1478 423420c4-83ab-492f-b58f-81f9feb106b5
2008-09-26 11:40:54 +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
Jay Sorg
e486d11511 moved all openssl calls to one file
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1373 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-09 07:24:44 +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
Michael Gernoth
1ea625c969 fix some warnings
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1239 423420c4-83ab-492f-b58f-81f9feb106b5
2006-07-02 13:03:22 +00:00
Peter Åstrand
1320755f2b Added missing c-basic-offset:s and license headers
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@962 423420c4-83ab-492f-b58f-81f9feb106b5
2005-08-03 10:56:16 +00:00
Michael Gernoth
6b1bacd41c unicode support from Andy Igoshin <ai@vsu.ru>
Currently disabled, need HAVE_ICONV and HAVE_ICONV_H defined to be
used. This should be done with a new configure test.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@854 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-13 13:18:48 +00:00
Michael Gernoth
ec643e4718 bump version to 1.4.0
change year in files
add missing docu for updated commandline-flags
update changelog


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@827 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-06 21:11:18 +00:00
Peter Åstrand
336cb6cc1f Now using Autoconf. Old OpenSSL files removed.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@739 423420c4-83ab-492f-b58f-81f9feb106b5
2004-07-31 13:07:41 +00:00
Jay Sorg
a9cad0b9cf proceed more global vars with g_
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@709 423420c4-83ab-492f-b58f-81f9feb106b5
2004-06-15 22:17:08 +00:00
Peter Åstrand
030f5f0ca1 Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@705 423420c4-83ab-492f-b58f-81f9feb106b5
2004-06-01 08:06:02 +00:00
Matt Chapman
80ef1df3b3 Document differences between RDP encryption and SSLv3, and bring some
of the terminology in line with the SSLv3 specification.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@698 423420c4-83ab-492f-b58f-81f9feb106b5
2004-05-16 11:18:20 +00:00
Jay Sorg
de7a67cd41 preceeded more global vars with g_
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@436 423420c4-83ab-492f-b58f-81f9feb106b5
2003-07-28 21:41:12 +00:00
Erik Forsberg
dc6de146a4 Indentation changes.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@407 423420c4-83ab-492f-b58f-81f9feb106b5
2003-06-06 10:44:20 +00:00
Jay Sorg
599062c6a0 adding g_ prefix to global vars, licence.c done
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@379 423420c4-83ab-492f-b58f-81f9feb106b5
2003-05-30 21:44:06 +00:00
Matt Chapman
7cf36760da Move non system dependent part of save_licence back to licence.c.
Clean up overly paranoid code, close files, free memory, etc.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@366 423420c4-83ab-492f-b58f-81f9feb106b5
2003-04-16 13:04:15 +00:00
Matt Chapman
46c3dca918 Update other places where LICENCE_TAG_* is used.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@365 423420c4-83ab-492f-b58f-81f9feb106b5
2003-04-16 12:52:46 +00:00
Matt Chapman
33ee95a206 Fix some instances of out_uint{16|32} with non-zero value (should be
out_uint{16|32}_{le|be}


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@364 423420c4-83ab-492f-b58f-81f9feb106b5
2003-04-16 08:19:15 +00:00
Matt Chapman
ce7ad4cfb0 Split licensing "tag" into 8-bit tag/version and remove LICENCE_TAG_*_5
constants.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@363 423420c4-83ab-492f-b58f-81f9feb106b5
2003-04-16 08:08:40 +00:00
Erik Forsberg
bc446480d5 Define and use RDP5-related licence tags. Seems to solve the troubles with
undefined licence tags when running in RDP5 mode.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@358 423420c4-83ab-492f-b58f-81f9feb106b5
2003-04-03 13:52:41 +00:00
Peter Åstrand
5ab5ba17eb Moved save_licence/load_licence back to rdesktop.c
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@324 423420c4-83ab-492f-b58f-81f9feb106b5
2003-02-11 11:31:04 +00:00
Peter Åstrand
c3f9bde92c load_licence/save_licence static.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@319 423420c4-83ab-492f-b58f-81f9feb106b5
2003-02-10 13:05:40 +00:00
Peter Åstrand
0f0bb5f281 Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@317 423420c4-83ab-492f-b58f-81f9feb106b5
2003-02-10 12:58:51 +00:00
Peter Åstrand
2dd0b246fb Moved load_licence/save_licence to licence.c. Removed SAVE_LICENCE cond.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@316 423420c4-83ab-492f-b58f-81f9feb106b5
2003-02-10 12:56:34 +00:00
Peter Åstrand
e3af880313 Uses <openssl/rc4.h> if WITH_OPENSSL.
(patch [ 666773 ] Let licence.c optionally use the real rc4.h file)


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@292 423420c4-83ab-492f-b58f-81f9feb106b5
2003-01-21 20:22:44 +00:00