Commit Graph

71 Commits

Author SHA1 Message Date
dbac3db7b7 Fourth Batch: Update files using ChatGPT 4o 2024-05-31 16:42:49 +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
e099d79879 Remove dangerous s_check()
This macro checks if a pointer is valid _after_ we've already used
that pointer. So it will only trigger if we're already performed some
for of buffer overflow. As such, it provides little to no value and
can only server to encourage broken behaviour.

Let's remove it and replace it with proper bounds checking before
access instead.
2019-05-06 14:33:05 +02:00
Pierre Ossman
d8b0f3782a Give source code info in rdp_protocol_error()
Makes it easier to debug things by seeing exactly where the protocol
handling crashed.
2019-05-06 13:29:44 +02:00
Karl Mikaelsson
28b3c6b621 Explain the +7 constant while processing secondary drawing orders 2019-01-30 10:49:27 +01:00
XiaopengZHOU
6249a5fec3
Fix checking the length of remaining data in stream for very compact orders. 2019-01-28 12:11:03 +01: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
Henrik Andersson
896a923f55 Markup unused parameters 2017-10-20 11:05:52 +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
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
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
55eaf2a098 Fix build with DEBUG: depth variable is no longer.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1507 423420c4-83ab-492f-b58f-81f9feb106b5
2009-08-26 15:20:32 +00:00
Peter Åstrand
c7feab2840 Ran indent-all
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1484 423420c4-83ab-492f-b58f-81f9feb106b5
2008-11-25 08:05:25 +00:00
Jay Sorg
c3dc159869 brush cache for > 2 color brushes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1482 423420c4-83ab-492f-b58f-81f9feb106b5
2008-11-01 02:37:10 +00:00
Jay Sorg
f306257aa4 ran indent and removed some spaces at EOL
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1475 423420c4-83ab-492f-b58f-81f9feb106b5
2008-07-11 03:55:52 +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
b59c4b92a6 added brush cache
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1473 423420c4-83ab-492f-b58f-81f9feb106b5
2008-07-11 03:35:24 +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
Jay Sorg
b670bdacfa RD_ prefix and win32 compatibility for core files
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1363 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-04 04:55:56 +00:00
Michael Gernoth
ad536be89b ignore colour-cache with id 0. This fixes my colour-problems when using
compressed rdp at 8bpp


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@892 423420c4-83ab-492f-b58f-81f9feb106b5
2005-04-23 22:36:42 +00:00
Peter Åstrand
f5bce2e0a9 Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@878 423420c4-83ab-492f-b58f-81f9feb106b5
2005-04-03 18:08:05 +00:00
Michael Gernoth
4cca15390d remove C++-style comments
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@864 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-15 11:25:50 +00:00
Jeroen Meijer
2099f0e3b8 fix previously introduced memory leak in process_polyline
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@845 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-11 00:50:19 +00:00
Jeroen Meijer
e5da76753d polyline bugfix
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@844 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-10 23:09:35 +00:00
Jeroen Meijer
0b5bb3b442 do polyline in a single ui operation: ui_polyline
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@843 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-10 22:48:15 +00:00
Jeroen Meijer
8bc5e0ad3f Fix text2 order parsing. The brush is parsed but not yet used.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@842 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-10 22:40:20 +00:00
Jeroen Meijer
f589939e23 Add support for ellipse and polygon orders
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@830 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-08 00:43:10 +00:00
Jeroen Meijer
a78d2b3ec9 optimise persistent bitmap caching and hopefully improve the terminology
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@829 423420c4-83ab-492f-b58f-81f9feb106b5
2005-03-08 00:23:02 +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
Jeroen Meijer
d9d1413912 Improve parsing of unknown text2 order members
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@812 423420c4-83ab-492f-b58f-81f9feb106b5
2005-02-16 22:28:17 +00:00
Peter Åstrand
dc156f8fcd Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@737 423420c4-83ab-492f-b58f-81f9feb106b5
2004-07-12 21:07:39 +00:00
Jay Sorg
73ce8ad4d6 fix a minor DEDUG spelling error
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@731 423420c4-83ab-492f-b58f-81f9feb106b5
2004-06-30 17:59:40 +00:00
Michael Gernoth
e08ca4e7ac Fix compiler error:
"orders.c", line 887: a cast does not yield an lvalue

Fix warnings:
"rdp.c", line 550: warning: integer overflow detected: op "<<"
"cache.c", line 42: warning: initializer does not fit or is out of range: -1


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@725 423420c4-83ab-492f-b58f-81f9feb106b5
2004-06-27 18:53:08 +00:00
Jay Sorg
7f836f0384 added persistant bitmap chaching from Jeroen Meijer, slightly modified
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@724 423420c4-83ab-492f-b58f-81f9feb106b5
2004-06-27 17:51:54 +00:00
Peter Kallden
5db5d38a46 mppc like decompression for the rdp protocol. code not activated. rdp5 gets some extra opcodes, and the decompression seems to work fine. :\
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@682 423420c4-83ab-492f-b58f-81f9feb106b5
2004-04-27 12:55:33 +00:00
Peter Åstrand
bbd2c8f209 Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@541 423420c4-83ab-492f-b58f-81f9feb106b5
2003-11-03 13:22:09 +00:00
Peter Åstrand
6dbb270f2f Replaced C++ comments with C-style
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@539 423420c4-83ab-492f-b58f-81f9feb106b5
2003-10-31 20:34:26 +00:00
Jay Sorg
d49e190f92 more g_ prefix for global vars
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@437 423420c4-83ab-492f-b58f-81f9feb106b5
2003-08-01 17:01:58 +00:00
Jay Sorg
694bd388a4 use sizeof instead of hardcoded struct size in colour cache
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@435 423420c4-83ab-492f-b58f-81f9feb106b5
2003-07-28 18:13:30 +00:00
Erik Forsberg
e83406e100 Changes after running indent-all.sh.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@413 423420c4-83ab-492f-b58f-81f9feb106b5
2003-06-06 11:09:24 +00:00
Jay Sorg
d4d47c0ea9 adding g_ prefix to global vars, orders.c done
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@381 423420c4-83ab-492f-b58f-81f9feb106b5
2003-05-30 22:04:25 +00:00
Jay Sorg
70de4fa1f9 changes so it compiles with g++(mainly for ports)
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@375 423420c4-83ab-492f-b58f-81f9feb106b5
2003-05-19 21:36:33 +00:00
Jay Sorg
679261b7fc changed all order vars that go through rdp_in_coord to sint16
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@374 423420c4-83ab-492f-b58f-81f9feb106b5
2003-05-16 21:55:14 +00:00
Erik Forsberg
e1d1e03e00 Initialize some variables in order to avoid a compiler warning. Umm.. A bit ugly. Might remove this later.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@355 423420c4-83ab-492f-b58f-81f9feb106b5
2003-03-28 09:13:48 +00:00
Erik Forsberg
1bc2511c0b Got bitmap decompression to work. It turned out Microsoft doesn't care about sending the compressed
bitmap header any longer, instead the size of the compressed bitmap data is sent in the bitmapLength
field of the cache bitmap order. Of course this doesn't concur with T.128.

Added more detailed debugging which helped in finding this.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@354 423420c4-83ab-492f-b58f-81f9feb106b5
2003-03-28 09:09:17 +00:00
Erik Forsberg
6ab3861ea0 process_orders now take the number of orders to process as an argument
instead of reading it itself. Adaptation for the RDP5 code to work.

Added some debugging.

Indent fixes.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@348 423420c4-83ab-492f-b58f-81f9feb106b5
2003-03-27 13:17:26 +00:00
Jay Sorg
b5bb68ced4 fix for connecting to a server that was disconnected with ms client
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@335 423420c4-83ab-492f-b58f-81f9feb106b5
2003-03-02 23:45:34 +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