Commit Graph

134 Commits

Author SHA1 Message Date
akallabeth bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
David Fort 13d56dbfb2
core: fix warning (#7906) 2022-05-16 15:29:07 +02:00
David Fort 97c65d9701
Console mode fix (#7902)
* core: correctly handle console mode server-side

In server-side we were not interpreting redirected session flag to compute a
console mode flag. In the proxy that was leading client connecting with /admin to front
to not connect with /admin on the back server.

* nla: fix the printinng of the package name
2022-05-16 09:05: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 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
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
Armin Novak e5ce4b49e7 Added logging in gcc_write_client_monitor_data 2021-12-17 10:06:54 +01:00
akallabeth 2d9416e499 gcc core data cleanup 2021-12-16 12:54:53 +01:00
Armin Novak bb0eeeb264 Use stack string buffer for ClientHostname and ID 2021-12-15 13:36:15 +01:00
Armin Novak be0433a1fb Use freerdp_settings_set_pointer_len instead of calloc 2021-10-18 14:48:27 +02:00
akallabeth 3ccb96d52f Fixed #7350: Warnings with Stream_StaticInit
* Properly initialize the stream buffer
* Add Stream_StaticConstInit accepting a const buffer
* Modify API to return a pointer to the stream initialized
2021-10-14 12:11:16 +02:00
akallabeth 7b7e2d6f32 Prefer constant division over multiplication for length checks 2021-09-21 08:55:22 +02:00
akallabeth c1e38b24a6 Replaced manual settings value allocation with setter 2021-09-20 10:59:59 +02:00
Armin Novak 673fb46836 Fixed uninitialized warnings 2021-09-10 08:16:25 +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
Armin Novak 610396e197 Fixed compilation warnings
Try to get the number of warnings down
2021-08-02 10:28:06 +02:00
Armin Novak 09111c9270 libfreerdp: Fixed warnings, added assertions 2021-06-18 11:32:16 +02:00
akallabeth 43311130a2 Fixed CodeQL warnings 2021-02-19 11:19:49 +01:00
akallabeth e2fd9db0b5 Added const to function arguments 2021-02-17 11:29:56 +01:00
Martin Fleisz 79fb38da84 core: Remove connection type manipulation in gcc_write_client_core_data
Removes the changes to connection type in gcc_write_client_core_data and
adds some checks if network detection is enabled when receiving network
detection requests.
2021-02-04 10:43:51 +01:00
kubistika afa213b5e5 libfreerdp: core: add checks in gcc_write_client_data_blocks 2021-01-24 14:07:17 +02:00
akallabeth ddfd0cdccf Use substreams to parse gcc_read_server_data_blocks 2020-04-02 17:39:43 +02:00
Martin Fleisz 7ef8b10fec core: Always send CS_MULTITRANSPORT PDU to server
This PDU is required by Microsoft servers in order for bandwidth
management to work correctly. Even if we do not support multi-transport
for now we should just send a PDU with flags set to 0 to enable correct
handing of bandwidth measurement PDUs.
2020-01-23 15:16:14 +01:00
Armin Novak 323491dab1 Support for RDP protocol version 10.7
* Adds support for 10.7 protocol version
* Uses it as client default

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2019-12-19 09:54:11 +01:00
Ondrej Holy 0531624826 Tell the server that smartcard is redirected
There were server-side changes on Windows 2012 and newer regarding
smartcards, namely the Smart Card Service start and stop behavior:
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh849637(v%3Dws.11)#smart-card-service-start-and-stop-behavior

Some people see "No valid certificates were found on this smart card",
when the Smart Card Service is not running and has to use various
workarounds to start the service manually, e.g.:
http://blogs.danosaab.com/2016/12/using-smart-card-with-remote-desktop-connection-on-mac-osx/
http://www.edugeek.net/forums/windows-server-2012/161255-smart-card-service-issue-windows-server-2012r2-terminal-services-hyperv.html

I've been looking at RDP specifications and found that
REDIRECTED_SMARTCARD should be probably specified in TS_UD_CS_CLUSTER
block flags when the smartcard is redirected, but it is not currently:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/d68c629f-36a1-4a40-afd0-8b3e56d29aac

This might be the reason, why the Smart Card Service is not
autostarted for some people. Let's try to set this flag and see what
will happens...

https://github.com/FreeRDP/FreeRDP/issues/4743
Signed-off-by: Armin Novak <armin.novak@thincast.com>
2019-12-18 12:22:11 +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 d1b7b4630b Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Mariusz Zaborski 4974af1f77 There is only one primary monitor do not look for more. 2018-12-13 14:16:50 +01:00
Armin Novak e7724cb8c4 Fixed a compiler warning for iterator type 2018-12-07 15:22:28 +01:00
Armin Novak 138eb13fea Updated RDP_VERSION definitions. 2018-11-14 10:14:48 +01:00
Armin Novak 423d54d752 Fixed signedness casts. 2018-10-25 14:08:20 +02:00
David Fort 41823080f9 Fix users of Stream_GetPosition() that returns size_t 2017-12-11 22:38:58 +01:00
Armin Novak 377bfeb227 Fix #3378: 31 static channels are supported. 2017-11-23 16:18:44 +01:00
Armin Novak bd7e4cd35a Fixed uninitialized variables. 2017-11-15 15:56:25 +01:00
David Fort f90fe19fc7 multimon: correctly set the primary monitor
According to the spec the primary monitor is supposed to be in (0,0) and other monitors
to be given relative to this one.
2017-10-17 14:07:23 +02:00
David Fort ddca8f3a3b Check return value of malloc 2017-09-26 13:56:08 +02: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
Armin Novak 09d43a66f4 Fixed tests and dead store warnings. 2017-03-28 16:49:56 +02:00
David Fort 59dafc2573 Added the spec reference for the 16 monitors limit 2017-02-21 15:03:00 +01:00
David Fort 837491ba24 Limit the number of client announced monitors
The specs says that only 16 are allowed, so let's make that limitation a
reality.
2017-02-21 11:02:12 +01:00
David Fort 4e0003533e Parses the SupportStatusInfoPdu early capability and send it to clients if supported 2017-02-09 11:50:46 +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
Norbert Federa 7befab856c Support for OpenSSL 1.1.0 2016-11-24 17:50:09 +01:00
Armin Novak f5fff7658a Made some functions static. 2016-10-06 13:43:12 +02:00
Norbert Federa 7a42a8dd5b freerdp/core/gcc: channel name hardening
According to [MS-RDPBCGR 2.2.1.3.4.1 Channel Definition Structure]
the channel name must be an 8-byte array containing a null-terminated
collection of seven ANSI characters that uniquely identify the channel.

We did not check if the transmitted name was null-terminated which
could have the usual severe effects on stabiliy and security since
the channel name is used in several functions expecting a null-
terminated string (strlen, printf, etc.)
2016-05-30 14:40:23 +02:00
Norbert Federa ef4b29e5b3 ConvertFromUnicode fixes and misc hardening
- Added missing ConvertFromUnicode checks
- If ConvertToUnicode allocates memory, guarantee the null termination
  similar to ConvertFromUnicode's implementation
- Fixed some TestUnicodeConversion.c CTest return values
- Added some CTests for ConvertFromUnicode and ConvertToUnicode
- Misc code and protocol hardening fixes in the surrounding code regions
  that have been touched
2016-03-03 16:56:19 +01:00