Commit Graph

66 Commits

Author SHA1 Message Date
akallabeth
7ab917dca8 Fixed Wsign-compare warnings 2022-12-09 15:58:26 +01:00
akallabeth
4ccb38aa13 [core] Check return value of *_transition_to_state
The state transition might not be allowed, so abort if that fails.
2022-11-16 15:32:32 +01:00
Armin Novak
8210ee77db Fixed return of rdp_client_transition_to_state
Use BOOL to just indicate success/failure and actually check return
of functions called.
2022-11-11 11:51:27 +01:00
Armin Novak
71c3f8e4bb Removed blocking loop in rdp_recv_deactivate_all
The new state machine expects just a state change and will handle
the following transitions from there.
2022-11-11 11:51:27 +01:00
Armin Novak
ec019c8910 Fixed (TS_FONT_MAP_PDU)::mapFlags check 2022-11-11 11:51:27 +01:00
akallabeth
de8da433ec Unified client and server synchronize PDU checks 2022-11-11 11:51:27 +01:00
akallabeth
33827cb920 Updated RDP state machine
* More detailed states
* Better transition checks
* No more recursive calling of state machine functions
2022-11-11 11:51:27 +01:00
akallabeth
b8907711d9 Relaxed font map PDU parsing
Due to some old VBox sending invalid font map PDU do not abort
parsing if a short PDU is received. See #925 for details
2022-11-04 14:46:58 +01:00
akallabeth
dbbff452cd Added better logging for font map PDU
rdp_recv_font_map_pdu now logs some warnings if some expected values
are not found in the PDU
2022-11-04 14:46:58 +01:00
akallabeth
2ef506cff2 Better checks on activation received
Check for reactivation, remember resolution, ...
2022-11-04 14:46:58 +01:00
akallabeth
8d067b21e6 Improved protocol check for activation messages 2022-11-04 14:46:58 +01:00
akallabeth
c0e3624a10 Code cleanups
prefer use of settings getter
2022-11-04 14:46:58 +01:00
akallabeth
016d2fe689 Renamed rdp_recv_server_synchronize_pdu 2022-11-03 11:56:12 +01:00
akallabeth
1849632c43
Fixed format strings to match arguments (#8254)
* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
2022-09-29 14:55:27 +02:00
David Fort
8d9a43de01
core: various cleanups for persistant cache (#8191) 2022-09-12 10:21:42 +02:00
akallabeth
43b1f51984 Unified setting of finalize_sc_pdus 2022-06-23 14:19:50 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
Armin Novak
66e73f8b08 Fixed missing static for functions, fixed declaration of FreeRDPAreColorFormatsEqualNoAlpha 2022-06-21 10:28:34 +02:00
Marc-André Moreau
161617c4a4 Implement RDP persistent bitmap cache 2022-06-08 23:37:06 +02:00
Derek Foreman
a547f8c4b0 Fix monitorlayout PDU
commit ec699f6c75 moved the array
allocation into display_convert_rdp_monitor_to_monitor_def without
updating its only call site.

This leads to display_convert_rdp_monitor_to_monitor_def failing
because the array already exists.
2022-06-08 15:09:48 +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
Armin Novak
eebb0c59b0 Removed rdpRdp instance pointer 2022-03-29 12:13:37 +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
feb6d9ae5c
Set last error on activation timeout (#7502) 2021-12-17 17:28:41 +01:00
Armin Novak
72d6671d5f Improved bitmap chache input checks 2021-12-14 13:46:34 +01:00
Armin Novak
81a2f9e434 WINPR_ASSERT activation.c 2021-09-09 08:36:01 +02:00
akallabeth
00ac11524e Wrapped rpdRdp:state access in getter/setter
* Only access state via getter/setter
* Better state debuggind with log messages on state transition
2021-09-06 10:11:14 +02:00
akallabeth
8d82adb28a Fixed warnings 2021-06-17 10:35:22 +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
be714d2a13 Fixed tpkt header length checks.
TPKT header length and consumption of data was not consistently
checked. This adds checks after each packet processed and fixes
any inconsistencies found.
2020-03-02 11:40:35 +01:00
Norbert Federa
a48e7f8b47 core: fix endless loops waiting for activation
There are two loops polling the transport pdu receiver in non-blocking mode
when waiting for reaching CONNECTION_STATE_ACTIVE rdp state.

In case of an invalid pdu size in the tpkt header this leaded to an endless
loop, utilizing 100% of a cpu core.

Added a sleep and limited the max loop time to the tcp ack timout value.
2020-02-20 17:51:20 +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
kubistika
cd135ceacb libfreerdp/core: Export monitor layout PDU
* Move update notification related functions to new display.c: Not
related to `rdp.c`.
    * Rename `rdp_write_monitor_layout_pdu` to `display_write_monitor_layout_pdu`.
* Add internal `display_convert_rdp_monitor_to_monitor_def` instead of
doing the conversion inside `display_write_monitor_layout_pdu`.
2019-06-03 14:30:17 +03:00
Armin Novak
f65b94ed84 Yield in connection wait loops to reduce processor use.
Patch by Andrey Vasilkin on mailing list.
2019-01-18 13:03:36 +01:00
Armin Novak
991f051a63 Fixed stream release for transport_write 2018-10-17 14:55:55 +02:00
David Fort
f68888a978 Add a callback that allows to adjust monitors layout
This callback is useful in server mode when you want to adjust the monitor
layout just before the server monitor layout PDU is built and sent.
2017-01-19 18:05:44 +01:00
davewheel
121a234866 Add better handling of monitors
This patch makes FreeRDP announce the support for monitor layout PDU. It also
adds support for servers to announce the monitors layout.
2016-01-20 16:56:04 +01:00
Armin Novak
188fe4ed2b Removed rdp disconnect, using unified abortEvent instead. 2015-09-05 14:57:30 +02:00
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01:00
Marc-André Moreau
e5990fa60c libfreerdp-core: MCS cleanup, better handling of domain parameters 2014-02-13 17:06:33 -05:00
Marc-André Moreau
6dfdc286ec libfreerdp-core: disconnect client when accept fails 2013-12-08 14:43:11 -05:00
Marc-André Moreau
69128d8018 libfreerdp-core: improvements to the server-side activation/reactivation code 2013-07-19 21:52:28 -04:00
Marc-André Moreau
91103b76b3 libfreerdp-core: modify server-side confirm active pdu receiving logic 2013-07-19 18:24:56 -04:00
Marc-André Moreau
6cde25937d libfreerdp-core: wrap state transition actions 2013-07-18 17:15:10 -04:00
Marc-André Moreau
f27ab422e3 libfreerdp-core: expand comments for connection sequence, split in more steps server-side connection code 2013-07-18 15:18:59 -04:00
Bernhard Miklautz
72c6ecdd3b core: Don't sent persistent key list if deact/react
Client persistent key list should not be sent if deactivation-
reactivation sequence is in progress. See [MS-RDPBCGR] 2.2.1.17
for details.

fixes #1229
2013-06-13 20:27:10 +02:00
Marc-André Moreau
202614a1a4 libfreerdp-core: reduce reuse of same pdu buffers 2013-05-15 15:54:33 -04:00