Commit Graph

296 Commits

Author SHA1 Message Date
Armin Novak
85cff3a7dc [server,proxy] fix private/public library linking 2023-03-10 11:40:08 +01:00
Armin Novak
c23dc3ba9d [CMake] Fix use of BUILD_SHARED_LIBS
the option is named BUILD_SHARED_LIBS and not CMAKE_BUILD_SHARED_LIBS
2023-03-10 11:40:08 +01:00
akallabeth
273bb6a7a8 [build] use static libraries as intermediate 2023-03-01 08:18:34 +01:00
akallabeth
b4e9c8b39f [build] removed complex libraries
* remove obsolete complex libraries helper
* fix static linking
2023-03-01 08:18:34 +01:00
David Fort
b8814e723a fix some warning with the use of new crypto functions 2023-02-28 07:59:40 +01:00
Armin Novak
f0e9797b4c [build] require CMake >= 3.13
required for target_link_options
2023-02-27 11:18:02 +01:00
akallabeth
87e90903ab [server,proxy] use rdpPrivateKey and rdpCertificate 2023-02-16 10:06:17 +01:00
Armin Novak
a7dac52a42 [license] updated copyright headers 2023-02-12 20:17:11 +01:00
akallabeth
b869927407 [proxy,config] extract PEM from config file
* Read a PEM file if provided via config
* Base64 decode if the certificate/private key are provided in the
  config file
2023-02-12 20:17:11 +01:00
akallabeth
ab2de5d60c [proxy,filter] fixed uninitialized value in bitmap-filter 2023-02-12 20:17:11 +01:00
Martin Fleisz
4b9fb8fff9 proxy: Fix NLA to TLS fallback connection
Currently the proxy's TLS fallback if an NLA connection attempt failed
is broken. There are two issues with the current code that this PR
fixes:

- freerdp_reconnect is used which requires an already established
  connection to work correctly. This is not the case since the NLA
  connectin attempt failed. This resulted in a seemingly working TLS
  connection but i.e. channels where missing/not working.
- The fallback connection attempt just altered the NLA security setting
  in the instance's settings. However these settings have been already
  modified by the NLA connection attempt so we need to create a copy of
  the original connection settings before doing the first connect.

The PR also introduces freerdp_reset_context which restores the initial
connection settings for the given instance.
2023-02-09 12:49:47 +01:00
akallabeth
17895714c2 [proxy,modules] fix missing link dependency
bitmap-filter requires freerdp functions to be linked
2023-01-27 16:01:33 +01:00
Armin Novak
4043658d04 [proxy,modules] add persist-bitmap-filter plugin
This plugin allows the proxy to filter persistent bitmap
capabilities and [MS-RDPEGFX] cache import offer
2023-01-26 09:30:17 +01:00
akallabeth
ee07a13130 [cleanup] fix compiler warnings 2023-01-26 09:30:17 +01:00
akallabeth
353d796476 [proxy,modules] update demo plugin 2023-01-26 09:30:17 +01:00
akallabeth
f26079edf2 [proxy] implement dynamic channel filter
* Allow modules to configure intercept channels
* Allow modules to rewrite packets
2023-01-26 09:30:17 +01:00
akallabeth
2067a480e9 [proxy] clean up channeltracker
Use getter/setter and unify stream allocation/reset
2023-01-26 09:30:17 +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
akallabeth
075506f6c8 [winpr,stream] use new Stream_CheckAndLogRequiredLength* 2023-01-25 14:27:32 +01:00
akallabeth
74530a7931 [format strings] ensure __LINE__ is of type size_t
__LINE__ is not particularily well defined (most fall back to int).
We want to ensure that all the uses in a format string match the format
specifier, so do an explicit cast
2023-01-25 14:27:32 +01:00
akallabeth
275741cc75 [core,utils] add drdynvc stringification functions 2023-01-12 22:54:25 +01:00
akallabeth
0234204130 [proxy,channel] make tracker opaque 2023-01-12 22:54:25 +01:00
akallabeth
08a2d61d6d [proxy] fix possible NULL crash on shutdown 2023-01-12 22:54:25 +01:00
Armin Novak
c7868e7a3f [proxy,rdpdr] added translation layer for rdpdr versions
rdpdr filesystem has 2 different versions and mstsc uses the older one
under certain conditions.
2023-01-10 11:49:38 +01:00
Armin Novak
f1e7cc0d48 [rdpdr] unify header read/write 2023-01-10 11:49:38 +01:00
Armin Novak
5a0b8fb688 [proxy,rdpdr] keep capability versions consistent 2023-01-10 11:49:38 +01:00
Armin Novak
22c47b7def [server,proxy] use cached channel id 2022-12-22 15:09:03 +01:00
Armin Novak
c4bbe09649 [server,proxy] rewritten Stream_CheckAndLogRequiredLengthRx
make it windows compatible
2022-12-22 15:09:03 +01:00
Armin Novak
b614a2da37 [server,proxy] improve rdpdr channel logging 2022-12-22 15:09:03 +01:00
Armin Novak
37454c7420 [utils] improve rdpdr packet dump 2022-12-22 15:09:03 +01:00
Armin Novak
318b55adc1 [rdpdr] filter empty device announce 2022-12-22 15:09:03 +01:00
Armin Novak
b988e8fba7 [server,proxy] fix rdpdr intercept mode 2022-12-22 15:09:03 +01:00
Armin Novak
5680a347d2 [server,proxy] fixed dump config elements 2022-12-22 15:09:03 +01:00
akallabeth
b56bef23dd [proxy] clean up config parser
* Use constant strings to identify sections, keys, bool, ...
2022-12-18 15:14:30 +01:00
akallabeth
76bd3ee8f8 [proxy] use proxy logging macros
use proxy logging macros so we know which session a message belongs to
2022-12-18 15:14:30 +01:00
Armin Novak
917e392f1e [client] fix connection active checks
* use freerdp_is_active_state for session active checks
* fix state transitions
2022-12-12 12:59:32 +01:00
David Fort
7041517ed6 proxy: prepare intercept mode for dynamic channels
This patch introduce the basic architecture to intercept content of dynamic
channel. When a dynamic channel is in intercept mode, we accumulate and reassemble
the current packet so that it can be passed for inspection.
2022-12-02 22:08:10 +01:00
David Fort
d59c0a49c3 proxy: fix channel shift between front and back
When some channels are filtered, some misalignement of channel ids could happen.
This patch keeps track of the back and front channel ids to correctly identify a
channel and send packets with the correct channel id.
2022-11-30 11:38:08 +01:00
Armin Novak
f775e16302 [server,proxy] added --buildconfig option
Add command line option to print out build configuration
2022-11-23 16:19:42 +01:00
akallabeth
c2bd2c8617 [server,proxy] fix const correctness
pf_context_create_client_context only creates a copy of the rdpSettings,
so just make the pointer const.
2022-11-22 15:30:31 +01:00
Martin Fleisz
1da0d63c78 proxy: Allow NLA when using proxy smartcard authentication
Previously smartcard authentication was only supported with TLS
connections so the proxy forced that security mode.

Since we now have a working NLA smartcard auth implementation we can
remove that code and leave the correct configuration to the proxy user.
2022-11-09 15:27:11 +01:00
Armin Novak
6a0df205b0 [proxy] add mouse ex and unicode event filters 2022-11-06 19:12:27 +01:00
Armin Novak
43ea3c0132 Fixed function prototype for proxy rdpdr 2022-10-10 15:29:45 +02:00
akallabeth
60720e7706 Improved streamdump file format 2022-10-07 10:38:03 +02:00
Martin Fleisz
a42a765cc3 proxy: Fix crash due to format specifier/type mismatch in debug logging
The cmd parameter (type int) has been logged using the %s format
specifier causing an access violation.

Fixed by using get_packet_type to convert cmd to a string.
2022-09-29 16:51:54 +02: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
Martin Fleisz
e4f476fce4 proxy: Fix handling of in drdynvc DATA_FIRST_PDU in proxy
During tests I sometimes received DATA_FIRST_PDUs that were not part of
a fragmented message but contained a complete PDU.

The documentation is not quite clear about if this is a possible
scenario or a protocol violation. However in the description of the Data
field it says:

If the sum of the DVC header size and the value specified by the Length
field is less than 1600 bytes, then the actual data length equals the
value specified by the Length field.

This hints that DATA_FIRST_PDU might also contain complete Data and does
not necessarily mean to be the first part of a fragmented PDU.
2022-09-29 14:45:30 +02:00
Martin Fleisz
fd96ed0acd proxy: Fix unicode flag parsing in proxy rdpdr client name request
Only the least significant bit is valid in the unicode flag UINT32. Some
clients send garbage data in the other bits which caused the proxy to
drop the connection which is wrong.
2022-09-08 17:39:02 +02:00
Martin Fleisz
f647296122 proxy: Fix smartcard emulation with clients with active rdpdr channel 2022-08-30 14:11:56 +02:00
Martin Fleisz
1ec228a177 proxy: Use closesocket instead of close 2022-07-21 15:59:43 +02:00