Commit Graph

56 Commits

Author SHA1 Message Date
akallabeth
eaf0bd8a69
[server,proxy] automatic intercept for drdynvc
* By default no special treatment for drdynvc
* If any of the configuration options requires drdynvc intercept do that
  independently of the intercept/passthrough lists
2024-07-25 11:19:20 +02:00
akallabeth
0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth
ba8cf8cf21 [build] fix Wmismatched-deallocator warnings
With custom malloc function attributes the fail path in the _New
functions produces warnings due to allocator mismatches. Silence them.
2024-02-05 08:16:55 +01:00
akallabeth
6eb4ff6212 [server,proxy] fix pf_context_copy_settings
possible memory leaks in failure case fixed
2023-11-24 14:54:56 +01:00
Armin Novak
6e6559c41a [settings] fix type mismatch warnings 2023-11-24 14:54:56 +01:00
akallabeth
1f236ade7a [server] make settings opaque 2023-11-24 14:54:56 +01:00
akallabeth
7df03ed5b4 [server,proxy] fix function pointer warning 2023-09-25 08:39:01 +02:00
akallabeth
6ff4db76bd [server,proxy] fix function pointer type warning 2023-09-25 08:39:01 +02:00
akallabeth
5a7a1c159d [casts] remove fnObject* function pointer casts
use proper types that match the function pointer definition to avoid
surprises if the code should be refactored
2023-09-20 21:11:30 +02:00
akallabeth
1fc0d5b4b1 [winpr] remove casts for winpr_RAND calls 2023-06-21 09:57:52 +02:00
akallabeth
87e90903ab [server,proxy] use rdpPrivateKey and rdpCertificate 2023-02-16 10:06: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
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
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
Armin Novak
b672bda85e Removed RdpKeyFile and RdpKeyContent settings
They are a duplicate of PrivateKeyFile and PrivateKeyContent
2022-07-06 12:01:23 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
David Fort
aff8fdac26 proxy: correctly handle dynamic channel fragmentation
This big patch fixes fragmentation handling in the dynamic channel. We used to
have a single state to handle fragmentation at the main dynamic channel level, but
in fact packets can be fragmented per sub channel. So we have to maintain a fragmentation
state per sub channel, this involve treating dynamic and static channels differentely
(so the size of the patch that has to implement state tracking per dynamic channels).
2022-06-17 08:38:57 +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
David Fort
63d0d3e4cf proxy: rework proxy channel treatments for statefull drdynvc
The rework introduce a stateful dynamic channel treatment, so that we can take early decisions
for data packet (dropping all the current packet or pass it), but also reassemble important
packets like channel creation.
2022-04-15 09:06:09 +02:00
David Fort
46eb50df2c proxy: improve channel treatment
This PR introduces per channel context so that we can speed up operations like
retrieving the channel name from its id, or knowing what shall be done for a
packet (no config ACL recomputation at each packet).
2022-02-04 08:44:22 +00:00
akallabeth
724c6f8192
Proxy cleanups (#7568)
* Fixed C++ issues with proxy context

* Added freerdp_settings_get_string_writable

* Define WITH_PROXY_EMULATE_SMARTCARD in config.h
2022-01-20 11:12:36 +01:00
Armin Novak
4e6e5be654 Added proxy intercept channels
* New configuration to intercept certain channels
* Added rdpdr intercept implementation
2022-01-11 12:34:43 +01:00
akallabeth
695e38398d Refactored proxy
* Removed unnecessary global data lists
* Improved error handling
* Do not initialize channel code in passthrough mode
2021-09-20 10:59:59 +02:00
Armin Novak
4463e5eda9 Added config dump function, improved resource cleanup 2021-09-09 08:53:20 +02:00
Armin Novak
5a2231172c Updated copyright for proxy 2021-09-09 08:53:20 +02:00
Armin Novak
976c3c2ab9 Refactored proxy and proxy-modules:
* Split out proxy headers and moved to public API to allow external
  modules to be built.
* Split proxy into proxy library and proxy binary. The library
  can be used by other applications and provides a simple API
* Improved channel passthrough, now all channels including dynamic
  channels work.
* Extended module API to hook more events, improved module samples
* Cleaned up proxy code, removed global static variables used,
  added WINPR_ASSERT
2021-09-09 08:53:20 +02:00
akallabeth
242f1734ec Fixed dpkg-buildpackage warnings 2021-06-30 11:57:23 +02:00
Armin Novak
cb642699c8 Modified HashTable API to be opaque
* Reuse wObject function pointers
* Add missing getters/setters
* Clean up return types, const correctness of arguments
2021-06-16 11:46:42 +02:00
akallabeth
e3445eefab Fixed progressive decoding without subbanddiff 2020-12-15 14:47:05 +01:00
Kobi Mizrachi
0bf225ec60 server: proxy: capture: send sid in SessionInfo 2020-06-22 12:37:53 +02:00
Kobi Mizrachi
9de59051f6 server: proxy: refactor 2020-05-19 14:42:26 +03:00
Kobi Mizrachi
079871ac65 server: proxy: support static vc passthrough 2020-02-26 11:47:01 +01:00
Kobi Mizrachi
92c3f76809 server: proxy: disconnect all active sessions on shutdown 2020-01-21 12:08:39 +01:00
Kobi Mizrachi
b2fad50cd3 server: proxy: rewrite modules API
* Add support for C++ plugins.
* Seperate between a "module" and a "plugin": a module is a shared
library that exposes a function called "proxy_module_entry_point". This
function gets a parameter to `proxyPluginsManager*`, which can be used to
register plugins.
* Refine the API of the modules infrastructure:
 * use proxyData* instead of rdpContext* when firing a hook or calling a filter.
 * use clearer names.
* Instead of having to specify a path for each module to be loaded in
the configuration, the proxy now loads modules from specificed
directory, using the CMAKE variable PROXY_PLUGINDIR.
* Add an option to specify required plugins: plugins that the proxy
wouldn't start without having them fully loaded.
2020-01-14 07:58:47 +01:00
Kobi Mizrachi
47ca28b5c3 server: proxy: fix leak in pf_context_copy_settings 2020-01-13 13:41:44 +01:00
Kobi Mizrachi
ca2e578acc server: proxy: add a unique id to each session and improve logs 2020-01-08 11:59:34 +01:00
Mati Shabtay
97606edeee proxy: Implement RAIL support in proxy 2019-12-12 11:10:44 +01:00
kubistika
09648834a0 server: proxy: fix sync issue in gfx opening 2019-11-12 12:45:01 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
kubistika
4d175f6008 server: proxy: refactor pf_context_create_client_context 2019-09-30 10:08:28 +02:00
kubistika
8a75e8f54e server: proxy: refactor 2019-09-09 17:42:18 +03:00
kubistika
f5d32f4617 server: proxy: refactor usage of pf_context_copy_settings 2019-09-09 17:35:07 +03:00
kubistika
32fff644da server: proxy: improve modules api 2019-08-23 11:58:08 +02:00
kubistika
ef306fbff6 server: proxy: pf_context.c: Fix nla crash
Because the proxy uses freerdp_settings_copy to do re-negotiation after
first connection to remote server, all redirection information
(RedirectionPassword, RedirectionDomain, etc.) pointers were duplicated
(to both client and server settings structs). Then, at disconnection, a
double-free occured.
2019-08-14 19:39:34 +02:00
kubistika
e9e1c5d748 server: proxy: naming refactor 2019-07-16 16:20:06 +03:00
kubistika
70ca028453 server: proxy: remove unnecessary files 2019-07-16 16:12:12 +03:00
kubistika
1b4371ed22 server: proxy: use freerdp_settings_copy 2019-07-16 13:47:35 +02:00
kubistika
8a115f2020 server/proxy: Refactor pdata_set_connection_info
Connection info must be set after the proxy's client connection
established, because if the client didn't provide credentials in .rdp
file, we don't know its username yet.
2019-06-26 14:25:07 +02:00
kubistika
255fab201a server/proxy: Fix rdpgfx and events leak 2019-06-26 14:25:07 +02:00
David Fort
5d1fc68629
Merge pull request #5405 from m4ntis/proxy/filters-api
Proxy: Filters API
2019-06-03 15:45:24 +02:00