Commit Graph

85 Commits

Author SHA1 Message Date
akallabeth
d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth
0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth
207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
David Fort
7b0b273ec1 mcs: drop a server-side warning on FreeRDP_ChannelDefArray::len
Server side we often see "FreeRDP_ChannelDefArray::len expected to be >= 31,
but have XXX", where XXX is lower than 31.

This patche fixes that, the old code was setting the size of ChannelDefArray to the
number of ChannelCount, which is usually not what we want. We want to keep it to 31
and have ChannelCount indicate how many of these channels are used.
2023-04-27 08:37:11 +02:00
Armin Novak
2450bf75e8 [core] improve assertions and logging 2023-03-05 17:03:18 +01:00
akallabeth
b03f9cc8b8 [core,mcs] added return checks
Fix missing checks in mcs_send_disconnect_provider_ultimatum
2023-01-27 11:05:12 +01:00
Armin Novak
641022b795 [logging] remove __FUNCTION__ from actual message
prefer the log formatter to provide that information.
2023-01-25 16:26:39 +01:00
Armin Novak
e0a14edfbb [core,crypto] log more parsing failures 2023-01-24 10:16:55 +01:00
akallabeth
37ab25e19d Fixed all Wdocumentation warnings 2022-12-12 14:24:55 +01:00
akallabeth
6e682e204f Fixed return checks for tpdu_write_data 2022-11-04 14:46:58 +01:00
Armin Novak
a3ec857278 Improved MCS checks, added settings to MCS function 2022-10-13 13:57:11 +02:00
akallabeth
e07233ccef Fixed float comparson 2022-06-29 18:10:33 +02:00
akallabeth
3d9c972d5c
Replace direct rdpSettings access with getter/setter (#7867)
* Replace direct rdpSettings access with getter/setter

* Fixed xf_gdi_update_screen const warning
2022-05-02 10:55:44 +02:00
akallabeth
73cdcdfe09
Logging and parser fixes (#7796)
* Fixed remdesk settings pointer

* Fixed sign warnings in display_write_monitor_layout_pdu

* Use freerdp_abort_connect_context and freerdp_shall_disconnect_context

* Added and updates settings

* info assert/dynamic timezone

* mcs assert/log/flags

* Fixed and added assertions for wStream

* Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function

* Cleaned up PER, added parser logging

* Cleaned up BER, added parser logging

* log messages

* Modified Stream_CheckAndLogRequiredLengthEx

* Allow custom format and options
* Add Stream_CheckAndLogRequiredLengthExVa for prepared va_list

* Improved Stream_CheckAndLogRequiredLength

* Now have log level adjustable
* Added function equivalents for existing logger
* Added a backtrace in case of a failure is detected

* Fixed public API input checks
2022-04-19 14:29:17 +02:00
akallabeth
d3ae821477 Improved logging, compiler warning fixes
* Improved logging in TPKT, TPDU, MCS, PER
* Proper use of rdpSettings functions
* Fixed missing return values
* Refactored rdp_server_transition_to_state
2022-03-28 15:52:32 +02:00
Armin Novak
4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak
b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
akallabeth
6ee60ea15a Fixed various warnings 2021-11-30 08:20:19 +01:00
akallabeth
e0a531f728
Channel fixes (#7309)
* Added missing CHANNEL_NAME defines.

* Fixed FreeRDP_ChannelDefArray setter

* Fixed code duplication due to merge error

* Added public function freerdp_channels_from_mcs

* Fixed const correctness in mcs
2021-09-22 14:27:21 +02:00
Armin Novak
17f530a866 Transport opaque 2021-09-09 08:36:01 +02:00
akallabeth
6a5070722a Removed rdpMcs::settings 2021-09-09 08:36:01 +02:00
akallabeth
617293e0d3
Cleanups (#7239)
* Use freerdp_settings_* for shadow and sample server

* Added freerdp_peer_set_local_and_hostname

* Code cleanups and WINPR_ASSERT

* Code cleanups

* Use CHANNEL_NAME_LEN where appropriate
* Use temporary variables in loop instead of direct array access
2021-08-24 14:09:40 +02:00
akallabeth
e2fd9db0b5 Added const to function arguments 2021-02-17 11:29:56 +01:00
kubistika
afa213b5e5 libfreerdp: core: add checks in gcc_write_client_data_blocks 2021-01-24 14:07:17 +02:00
akallabeth
5409f4f043 Implemented 2.2.1.17.1 Persistent Key List PDU Data, added checks
* Implemented missing server side version of PDU (just skip data)
* Refactored read/write functions to properly check stream
  length/capacity and handle return values.
2020-11-20 09:39:25 +01:00
Armin Novak
318cb3dd47 Added tpkt header length plausibility checks. 2020-03-02 11:40:35 +01:00
Armin Novak
895cb8f944 Added macro freerdp_set_last_error_if_not
This macro replaces the multiple instances where the current
error state is checked before setting an optional error state.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2020-01-09 10:34:27 +01:00
Armin Novak
7d252cdc8e Added freerdp_set_last_error_ex function
This new function allows better logging of call locations
for errors. Additionally added freerdp_set_error_log macro
to record function, file and line the error was set.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2020-01-08 17:39:25 +01:00
Armin Novak
7c243da6e1 Remove symbols exported by accident. 2019-12-02 10:57:31 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
f51a9bafcc Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
dc3d536398 Changed length arguments and return to size_t 2018-01-17 08:14:06 +01:00
David Fort
41823080f9 Fix users of Stream_GetPosition() that returns size_t 2017-12-11 22:38:58 +01:00
Armin Novak
8292b4558f Fix TALOS issues
Fix the following issues identified by the CISCO TALOS project:
 * TALOS-2017-0336 CVE-2017-2834
 * TALOS-2017-0337 CVE-2017-2834
 * TALOS-2017-0338 CVE-2017-2836
 * TALOS-2017-0339 CVE-2017-2837
 * TALOS-2017-0340 CVE-2017-2838
 * TALOS-2017-0341 CVE-2017-2839
2017-07-20 09:28:47 +02:00
David Fort
17a4e95a5b Drop some annoying warning
Probably that some unused functions should be removed, but at least it makes
it compile with no warnings.
2017-05-12 13:54:16 +02:00
Armin Novak
b2c29158be Scanbuild warning, argument checks and leak fixes.
* Added Stream_GetRemainingCapacity to check remaining stream size
  before writes.
* Fixed shadow server memory leak.
* Fixed lots of scanbuild warnings
* Added missing argument checks in many functions
* Added missing static function declarations
2017-03-02 18:13:43 +01:00
Norbert Federa
f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00
Armin Novak
e79eee2bb1 Fixed Stream API misuse. 2016-02-25 20:01:12 +01:00
Martin Haimberger
951a2d2210 stream: check stream_new in winpr and libfreerdp
also fixed a few things
2015-05-29 04:46:50 -07:00
David FORT
a4a58aa373 Fix the error case in mcs_send_connect_response() 2015-04-01 17:55:01 +02:00
David FORT
5302bad2b7 Drop the limit on key size 2015-04-01 15:11:57 +02:00
Marc-André Moreau
0e57706de5 libfreerdp-core: cleanup connect error codes, fix Win32 NLA 2015-02-17 21:01:27 -05:00
Marc-André Moreau
9c7b7ab561 libfreerdp-core: make NLA event-driven 2015-02-15 16:04:59 -05:00
Vic Lee
0e7797ffca libfreerdp-core: server-side mcs message channel. 2014-10-29 00:49:27 +08:00
Marc-André Moreau
11ae267518 libfreerdp-core: expose new API to allow FreeRDS virtual channel hooking 2014-10-10 16:11:42 -04:00
Armin Novak
2f519d7f16 Replaced logging in libfreerdp with wlog defines. 2014-09-15 08:48:46 +02:00
Armin Novak
f4c133eaf8 Replaced custom logging mechanism with WLog wrapper. 2014-08-07 16:51:24 +02:00
Marc-André Moreau
af4a413287 Merge branch 'non_blocking_writes' of github.com:hardening/FreeRDP into non_blocking_writes 2014-05-22 14:01:44 -04:00
Hardening
0376dcd065 Fix OOM situation 2014-05-21 17:27:36 +02:00
Marc-André Moreau
ee282a931b freerdp: fix build warnings on Windows 2014-05-10 09:50:36 -04:00