Commit Graph

2518 Commits

Author SHA1 Message Date
akallabeth 3fe9363592 [core,capabilities] abort on invalid protocolVersion
* TS_GENERAL_CAPABILITYSET::protocolVersion must be
  TS_CAPS_PROTOCOLVERSION(0x200) see [MS-RDPBCGR] 2.2.7.1.1
  General Capability Set (TS_GENERAL_CAPABILITYSET)
* Default value of FreeRDP_CapsProtocolVersion must be
  TS_CAPS_PROTOCOLVERSION(0x200)
2024-04-23 17:13:13 +02:00
akallabeth 71e78bedd7 [warnings] fixed sign and const
* fix various char/BYTE sign warnings
* fix various const warnings
* fix format string size_t
* remove unused CMake variables
2024-04-18 11:05:58 +02:00
akallabeth 0a0df77c39 [build,ipp] drop support for IPP
Intel Performance Primitives do not have a test setup in FreeRDP and
most likely no longer compile.
2024-04-16 12:44:38 +02:00
akallabeth 1e325dc2de [core,settings] add missing autoreconnect option
Split settings, there was a double use for AutoReconnectEnabled.
AutoReconnectEnabled is a setting responsible for client side
autoreconnection.
AutoReconnectPacketSupported is a flag set by the server to announce
support for AutoReconnectPacket allowing fast reconnect.
2024-04-11 11:19:18 +02:00
Armin Novak ea9e219867 [channels,rail] print handshakeEx flags 2024-03-20 10:00:57 +01:00
akallabeth 3bba61bdf4 [utils,encoded_types] fix read/write, add limits
* fix read and write limits of four byte signed integers
* add definitions for value range MIN and MAX
2024-03-18 08:41:17 +01:00
akallabeth 95cae82af6 [freerdp,api] check __clang__ at ALIGN64
while __GNUC__ is usually defined explicitely check for __clang__ too
2024-03-12 14:24:36 +01:00
akallabeth f764b0a854 [channels,location] implement client channel
* provide client side callbacks to implement platform specific location
  backend glue code
2024-03-11 13:22:12 +01:00
akallabeth 2dd80b1e80 [utils] implement write 4byte types
* freerdp_write_four_byte_signed_integer
* freerdp_write_four_byte_float
2024-03-11 13:22:12 +01:00
akallabeth 93eb4df524 [core,gateway] implement RDG and TSG policy
* use dynamic logger in RDG
* honor [MS-TSGU] 2.2.9.2.1.5.2 TSG_REDIRECTION_FLAGS
* honor [MS-TSGU] 2.2.10.16 HTTP_TUNNEL_AUTH_RESPONSE
  HTTP_TUNNEL_AUTH_RESPONSE_FIELD_REDIR_FLAGS flag
* add setting GatewayIgnoreRedirectionPolicy to ignore the gateway
  policy if desired
2024-03-07 16:18:41 +01:00
akallabeth 9268cee35e [server,shadow] shadow_subsystem_pointer_convert_alpha_pointer_data
the function uses implicit color formats. Replace this with the function
shadow_subsystem_pointer_convert_alpha_pointer_data_to_format with
explicit source color format.
Deprecate the old function.
2024-03-05 10:03:23 +01:00
akallabeth fe149f3f57 [server,shadow] deprecate shadow_capture_compare
the function uses implicit color format layout, so move to a version
with explicit format layout.
2024-03-05 10:03:23 +01:00
akallabeth 730d67c7e3 [server,shadow] add WINPR_RESTRICT to comparison
shadow_capture_compare_with_format and shadow_capture_compare always
operate on distinct memory areas. Allow better optimization of
operations with the WINPR_RESTRICT keyword
2024-03-05 10:03:23 +01:00
nin dc4bd6609b [server,shadow] add image format support for capture
when capturing bitmap data take the source image format into account on
copy and compare.
2024-03-05 10:03:23 +01:00
akallabeth 2de926e172 [core,transport] reserve space in rdpTransportIo
For better ABI compatibility reserve some extra space in this public
struct.
2024-02-22 15:18:30 +01:00
akallabeth d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth b8598728a6 [clang-tidy] clang-analyzer-core.uninitialized.Assign 2024-02-15 11:49:16 +01:00
akallabeth 0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth 0d68cb4f42 [build,attr] fix WINPR_ATTR_MALLOC
* do not use this attribute if the free function takes pointer to pointer
* audio_format_new must be freed by audio_formats_free
2024-02-12 10:23:27 +01:00
akallabeth 9a51830434 [codec,jpeg] use winpr image for jpeg 2024-02-07 10:04:08 +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 bb42d425ed [gcc,clang] add support for attribute(malloc)
Mark all malloc like functions and add their appropriate free function
to let the compiler complain on mismatches
2024-02-02 15:10:40 +01:00
Vic Lee 5559e59f40 [channels] Add synchronous static channel setting. 2024-02-01 15:06:23 +01:00
akallabeth 4add7836fa [server,shadow] wait for rdpegfx channel ready
we need to wait until the capability messages are exchanged before
starting to issue gfx commands
2024-01-29 19:26:18 +01:00
Vic Lee f2794daf38 [core,transport] make blocking mode available to transport IO interface. 2024-01-22 12:57:01 +01:00
Vic Lee 16206cb505 [channels,drdynvc] Add settings to enable synchronous dynamic channels. 2024-01-11 15:24:55 +01:00
akallabeth 59ed125eed [server,proxy] add TlsSecLevel option to config
To support legacy targets add the TlsSecLevel configuration option that
is equivalent to the /tls:seclevel option of the client implementations.
This allows automatic configuration of OpenSSL legacy providers if they
are available.
2024-01-09 15:53:22 +01:00
Vic Lee 33447dc16e [nla,transport] move public key retrieval to transport IO. 2024-01-03 08:40:39 +01:00
David Fort 6a31820363 [core] allow to specify the hostname used for AAD
The previous code was assuming that the host name used for doing AAD was
ServerHostname parameter. But when you connect directly to Azure hosts you most
likely connect by IP and use short name for the AAD host, so you need to be able
to give ServerHostname=<IP of host> and AadServerHostname=<shortname>.
2023-12-15 14:37:15 +01:00
Armin Novak 6f6c0248f0 [client,common] check for relative mouse events
Added freerdp_client_use_relative_mouse_events to tell the client if the
coordinates should be relative or absolute
2023-12-06 10:45:01 +01:00
Armin Novak c8b142a10f [core,gcc] added flag RNS_UD_CS_RELATIVE_MOUSE_INPUT 2023-12-06 10:45:01 +01:00
Armin Novak a65722166e [codecs] fix enum warning 2023-12-06 10:45:01 +01:00
Armin Novak 7b043aed39 [settings] add c++ guards 2023-12-06 10:45:01 +01:00
akallabeth 5ffaf12748 [enum types] add *_RESERVED = 0 entries
eliminate warnings with initializing a struct with = { 0 } due to enum
members that do not define the value 0
2023-11-24 18:19:03 +01:00
Armin Novak 4d50d59e7e [settings] renamed VirtualChannelCompressionFlags 2023-11-24 14:54:56 +01:00
Armin Novak 37bd7e0959 [settings] renamed VirtualChannelChunkSize
in [MS-RDPBCGR] it is named VCChunkSize
2023-11-24 14:54:56 +01:00
Armin Novak 3e9aad58f9 [common,settings] add documentation and missing API
* added freerdp_settings_are_valid for batch checks
* added missing settings function documentation
2023-11-24 14:54:56 +01:00
Armin Novak 1a5cea0023 [common,codecs] use an enum to define codecs 2023-11-24 14:54:56 +01:00
Armin Novak 704ee8bc4b [settings] add unused values and sign correct keys
* add -1 as unused enum entry
* change key parameter type from size_t to SSIZE_T
2023-11-24 14:54:56 +01:00
Armin Novak 593e2bf4a9 [api] fix compiler warnings
check #if defined(__GNUC__)
2023-11-24 14:54:56 +01:00
akallabeth cd4d77af86 [settings] add deprecation warnings
direct struct access to rdpSettings now produces warnings if not
explicitly deactiaved by defining FREERDP_SETTINGS_INTERNAL_USE
2023-11-24 14:54:56 +01:00
akallabeth 82eefe0bd1 [settings] auto generate key types from struct
* use enum types for settings getter/setter to have compiler check if
  keys are valid
* generate enum types from struct at compile time
* CMake option WITH_OPAQUE_SETTINGS to hide rdpStruct implementation
  from external projects
2023-11-24 14:54:56 +01:00
akallabeth 71a7ffa8d8 [settings] add freerdp_settings_append_string
this function appends a string to an existing values, takes care of
memory allocations.
2023-11-24 14:54:56 +01:00
akallabeth a9a879c59f [settings] remove freerdp_settings_take_string
this function is problematic as it allows mixing allocators.
2023-11-24 14:54:56 +01:00
akallabeth ecc21a2cfc [settings] add freerdp_settings_copy_item
convenience function to copy a value of opaque type from one settings
struct to another, cleaning up possible existing data first
2023-11-24 14:54:56 +01:00
Armin Novak 1807652975 [core,helpers] add new stringify functions
* freerdp_get_logon_error_info_type_ex
* freerdp_get_logon_error_info_data_ex
2023-11-20 18:00:42 +01:00
David Fort 061148f856 [nla] initial server-side remote credential guard support
Adds support for server-side remote credential guard in NLA. When enabled that allows
the remote user to connect without shipping credentials in TSCred packets. Instead
it will send his TGT encoded with a TGS from the remote server. This way the server
is able to populate that TGT in a local credential cache without knowing the user's
password.

The patch only treats the NLA part and does not contain the associated RDPEAR channel
that allows to have the complete interaction to retrieve new access tokens.
2023-11-20 16:17:00 +01:00
Martin Fleisz 954f6d69cf dvc: Add field for custom interface data 2023-11-15 14:53:55 +01:00
akallabeth 13b44b8b77 [ifdef] properly check for defined 2023-11-10 09:58:23 +01:00
Armin Novak 16c4ede603 [client,common] add custom line parser option
freerdp_client_settings_parse_command_line_arguments_ex allows supplying
user defined options to be parsed with the default ones from
client/common.
A callback must be implemented to handle the supplied arguments.
2023-11-07 14:11:51 +01:00
Armin Novak 98a4eb77ef [core] VirtualChannelChunkSize adjustments
* add CHANNEL_CHUNK_MAX_LENGTH
* remove duplicate definitions
* default to CHANNEL_CHUNK_MAX_LENGTH
2023-11-03 12:43:25 +01:00
Armin Novak d000d9e957 [channels] add <NAME>_CHANNEL_NAME for each
* made <NAME>_CHANNEL_NAME defines consistent, each channel now has a
  define for the library name.
* use these defines instead of string constants
2023-11-02 12:44:28 +01:00
Armin Novak e56fcb45cb [core,aad] move cJSON related parsing to core
hide cJSON parser from freerdp-client library, link privately
2023-11-02 11:30:55 +01:00
Pascal Nowack 687ed017d3 server: Add channel handling for mouse cursor channel ([MS-RDPEMSC])
The mouse cursor channel enables remoting of the mouse cursor (bitmap)
over a DVC. The main use case is UDP, as only virtual channels can be
transported via UDP in RDP.
2023-10-25 12:57:26 +02:00
Pascal Nowack 850afe68a0 channels/location: Fix Copyright date in header 2023-10-25 12:57:26 +02:00
Mariusz Bialonczyk c4c8571710 [cmdline] add `prevent-session-lock` cmdline argument and settings variable 2023-10-19 16:37:28 +02:00
akallabeth 9ebbefa5fe [settings] remove unused extensions
The extensions from the unstable API zone were unused, so remove them
2023-10-19 14:22:19 +02:00
akallabeth 4d99b4ff9b [settings] add ClipboardUseSelection 2023-10-19 14:22:19 +02:00
Pascal Nowack 5a4818b89d codec/audio: Fix order of wave format ids
The wave format ids in this file are sorted by their value in an
ascending order, except for the Opus value. So, fix this inconsistency.
2023-10-19 04:47:53 +02:00
Pascal Nowack cd69b8ea63 codec/audio: Add missing format id for Opus codec
Id taken from [0].

[0]: https://learn.microsoft.com/en-us/windows/win32/medfound/audio-subtype-guids
2023-10-18 11:51:47 +02:00
akallabeth 535c4ef639 [warnings] deactivate GCC extension for IFCALLRESULT 2023-10-17 11:07:11 +02:00
Pascal Nowack aac8945fe9 server: Add channel handling for location channel ([MS-RDPEL])
With the location channel, an RDP server can redirect the location of
the user from the client side to the server side.
The PDUs are almost the same as in the documentation, except for the
encoded types, these ones are here already parsed.
Optional values are accessed via pointers. If the pointer of a value is
NULL, then that value was not supplied by the client side.
2023-10-17 10:18:08 +02:00
Pascal Nowack 5ec5be7ac4 utils: Add helper functions to parse encoded types into regular ones
Some virtual channels, like the location channel use encoded types to
lower the bandwidth usage.
Add common helper functions, so that each virtual channel doesn't have
to reimplement the parser functions again and again.
2023-10-17 10:18:08 +02:00
Armin Novak 53b65ff7bd [documentation] fix Wdocumentation warnings 2023-10-16 15:10:13 +02:00
Armin Novak 2373db233e [server,audin] fix Wdocumentation-unknown-command 2023-10-16 15:10:13 +02:00
Armin Novak fe28f9ed9c [keyword,restrict] do not use for shift operations
shifting operations are done on a in/out buffer, so the restrict keyword
is not appropriate for that.
2023-10-16 15:10:13 +02:00
Armin Novak 138d3df028 [core,gcc] parse CS_UNUSED1 message
parse message to avoid log entries server side for this kind of PDU
2023-10-13 16:05:27 +02:00
akallabeth 4df4404faa [core,input] add qoe event handling 2023-10-13 16:05:27 +02:00
akallabeth 20e15ac326 [core] added relative mouse event support 2023-10-13 16:05:27 +02:00
akallabeth 1f7bc15bb1 [settings] add HasQoeEvent 2023-10-13 16:05:27 +02:00
akallabeth 910e3b9fb4 [settings] added new setting for HasRelativeMouseEvent 2023-10-13 16:05:27 +02:00
akallabeth 002b27f2e5 [core] add RDP_VERSION_10_12 2023-10-13 16:05:27 +02:00
akallabeth a41360e3b0 [codec,rfx] added missing RFX encoder API calls 2023-10-07 21:26:27 +02:00
David Fort 3c18a9980f [client,win32] implement connection to child session
Under windows you can connect to a child session by requesting a named pipe to
the local server, and then do some RDP on this named pipe.
The protocol is like for /vmconnect with CredSSP, then Nego and then the "normal"
workflow for a connection. For CredSSP we force the usage of NTLM for the Negociate
SSPI, and the credentials are empty.
2023-09-27 11:57:49 +02:00
akallabeth 86acc8d31a [warnings] fixed reserved-identifer warnings 2023-09-25 08:39:01 +02:00
akallabeth 635626be12 [client,common] avd related keys to rdp file parser 2023-09-21 10:30:09 +02:00
akallabeth bd595d363d [arm] add retry callback for transport
If the connection is blocked due to some VM requiring spinup time before
being ready to use call the newly created callback RetryDialog.
2023-09-14 12:02:26 +02:00
ichaoX 48a55aa95b [client,common] fix freerdp_client_pen_cancel_all
* fix freerdp_client_pen_cancel_all
* fix FreeRDPPenEventType
2023-09-13 15:57:59 +02:00
akallabeth 9a9db5b7f3 [codec,progressive] expose progressive simple
server implementations might require serializing messages to a simple
tile, so expose this function.
2023-09-05 11:40:09 +02:00
David Fort 8a39859612 [arm] various improvements
This patch moves the ARM configuration before starting the connection process, so
that we can do some provisioning of the FreeRDP settings with the items retrieved
from Azure.
Most notably that allows us to connect directly using RDSTLS security.
2023-09-04 10:24:56 +02:00
David Fort 361da15eed [crypto] extend base64 to output crLf when encoding
Some windows APIs do put \r\n every 64 characters of the output of a
base64 encoded blob. The extended version of crypto_base64_encode allows
to do the same.
2023-09-04 10:24:56 +02:00
akallabeth b4ce44c290 [settings] add freerdp_settings_take_string
this function can take an allocated value, set the settings string to it
and free it up once replaced by something else.
2023-09-02 07:56:21 +02:00
akallabeth bb5345c60e [freerdp,api] add FREERDP_ENTRY_POINT
C requires prototypes or compilers will complain about them missing. Our
library entry points do not have such, therefore add the macro
FREERDP_ENTRY_POINT which declares the function prototype automatically
before the function.
2023-08-25 14:36:05 +02:00
akallabeth b608be19e4 [codec,color] WINPR_RESTRICT for copy operations 2023-08-25 14:13:30 +02:00
akallabeth 3dcd702676 [primitives,yuv] use WINPR_RESTRICT 2023-08-25 14:13:30 +02:00
Marc-André Moreau 30c31d64e8 WinSCard dynamic API loading with /winscard-module cli argument 2023-08-23 12:26:27 +02:00
Armin Novak dd9757d686 [server] add exerimental and unmaintained warnings 2023-08-21 15:42:10 +02:00
2fly2 553d964d8c Fix the issue of incorrect macro definition IFCALLRESULT 2023-08-21 13:03:56 +02:00
akallabeth 22fffdd5ea [freerdp,api] log NULL IFCALL/IFCALLRET calls 2023-08-04 12:59:11 +02:00
akallabeth afbe16c850 [api] remove obsolete define 2023-08-01 08:58:06 +02:00
Armin Novak 62da5c7e8e [channels,rdpgfx] make internal server thread optional 2023-07-31 20:18:48 +02:00
Armin Novak aa2c48840a [client,sdl] fix high dpi detection
* convert dpi value to percentage used by RDP
* fix detection of current monitor resolution for SDL windows
2023-07-31 13:41:26 +02:00
Dan Holliday 8c584c29dd Started to add support for multi-monitor. 2023-07-31 13:41:26 +02:00
Armin Novak 0afa2e88b5 [crypto,cert] imrove logged warnings for certificates 2023-07-31 08:32:43 +02:00
Armin Novak e61880d077 [standard] replace __FUNCTION__ with __func__ 2023-07-27 20:02:43 +02:00
akallabeth 14d0ec9335 [core] move http status to string to utils
freerdp_http_status_string and freerdp_http_status_string_format are now
exposed as public API functions to work with http status codes
2023-07-21 14:53:19 +02:00
Armin Novak 3d1bb4e1d9 [client,common] allow forcing default callbacks
All clients can implement their own callbacks for
certificate/credential/smartcard/... but there is a common (default)
implementation for all clients.
with the new setting FreeRDP_UseCommonStdioCallbacks it is now possible
to force these over the client implementation provided ones
2023-07-20 14:25:08 +02:00
akallabeth 734117351d [aad,avc] unify callbacks to GetAccessToken
The AAD and AVD authentication mechanisms both need an OAuth2 token.
They only differ in the provided arguments, so unify the callbacks into
a single one with variable argument lists.
2023-07-20 14:20:28 +02:00
fifthdegree d309fcd6e8 Restructure Azure AD related stuff
- Move responsibility for obtaining access tokens to clients
- Add function for getting access tokens for AVD
- Get correct server hostname during AVD setup
- Add utility function for doing http requests
2023-07-20 14:20:28 +02:00
Pascal Nowack d7d3055b5f X11/cliprdr: Rework server to client clipboard handling
The purpose of clipboard data locking is to make the other peer
retaining the current file list until a pending paste operation is done,
even though the clipboard selection changed.
As it may be difficult to determine, when a lock is needed, imitate the
same behaviour as mstsc:
When the server side supports clipboard data locking, always attempt to
lock the file list on the server regardless of what is advertised in a
FormatList PDU.
The Lock Clipboard Data PDU can even be already sent, before the
Format List Response PDU is sent.
This is also what mstsc, does: First, lock the new (potential) file
list, then unlock the file list, when the pending paste operation is
done.
So, rework the current clipboard implementation in that direction.

Since the implementation for timeouts for old file lists is a bit hard,
for now always force unlock pending locks, when the selection changes.
However, timeouts for old file lists can still be added in the future.

The reworked clipboard handling is done with the help of three hash
tables:

1. The inode table: This hash table manages all inodes for each file.
   The keys in this table are the inodes themselves, while the values
   the files and directories and their attributes (file size, last write
   time, etc.).
2. The clipdata table: This table manages the locks for each file list.
   The keys in this table represent the clip data id and the values the
   clip data entries, which have a reference to the clip data dir, a
   directory containing the whole selection, and some helper attributes,
   like the clip data id itself.
3. The request table: Every file size or file range request is managed
   here. When a FileContentsRequest is made, its stream id with the
   respective details are added to this table. When a response is
   received, these details can then be easily looked up here.
2023-07-20 11:36:11 +02:00