Commit Graph

17166 Commits

Author SHA1 Message Date
akallabeth
516668d02b [fclose] ensure no invalid pointers are passed.
fclose has undefined behaviour for NULL pointers, so check for these.
2023-04-28 07:39:35 +02:00
akallabeth
09aa4e63a9 [winpr,utils] fix COMMAND_LINE_VALUE_PRESENT
the flag was set unconditionally, only set it if there actually is a
value present
2023-04-28 07:39:35 +02:00
fifthdegree
6abd9165e6 Only accept hostname for kdc-url
For compatibility with windows
2023-04-27 16:31:30 +02:00
fifthdegree
9368317a9f Plug some leaks in krb5glue_mit.c 2023-04-27 16:31:30 +02:00
fifthdegree
b1c4cb493f Set KDC URL in a way compatible with Windows 2023-04-27 16:31:30 +02:00
fifthdegree
201b743f20 Set pkinit_kdc_hostname when known
Since Windows doesn't use id-pkinit-san in its certificates, it is
necessary to manually configure which hosts are valid KDCs. In the case
where a kdcUrl (or hostname) is provided to us, we can do that
configuration ourselves.
2023-04-27 16:31:30 +02:00
David Fort
7b0b273ec1 mcs: drop a server-side warning on FreeRDP_ChannelDefArray::len
Server side we often see "FreeRDP_ChannelDefArray::len expected to be >= 31,
but have XXX", where XXX is lower than 31.

This patche fixes that, the old code was setting the size of ChannelDefArray to the
number of ChannelCount, which is usually not what we want. We want to keep it to 31
and have ChannelCount indicate how many of these channels are used.
2023-04-27 08:37:11 +02:00
Armin Novak
fad46c4455 [server,proxy] add additional PEM headers
there are some more PEM formats in use, add the headers
2023-04-26 09:55:26 +02:00
David Fort
0b16fcef18 rail: add missing server-side calls
This patch adds support for text_scale and caret_blink messages on the server-side.
2023-04-25 07:27:37 +02:00
Armin Novak
e0aec72d71 [pkg-config] unify exec_prefix 2023-04-24 22:01:15 +02:00
Armin Novak
f674b209ff [pkg-config] unify libdir 2023-04-24 22:01:15 +02:00
Armin Novak
4d3d1bfe4d [core,autodetect] revert to [MS-RDPBCGR] states
remove 'convenience' states in main RDP state machine for autodetect
2023-04-24 14:18:20 +02:00
Armin Novak
f357f1d418 [core,license] allow empty cert info 2023-04-24 13:03:40 +02:00
Richard Markiewicz
13e52cfae2 [channels,settings] add a setting to ignore invalid devices 2023-04-24 11:29:05 +02:00
Bernhard Miklautz
d1069b3bc1 new: use prefix in pkg-config files for libdir 2023-04-24 11:19:01 +02:00
Bernhard Miklautz
ddc9e5835f new: export plugin paths in pkg-config and cmake package
To simplify building external channels and other plugins related
paths are now exported in the pkg-config file and the cmake package.
The paths can be used to install channels/plugins/extensions in
the configured search paths.

For pkg-config the following variables are now available:
* datadir
* plugindir
* proxy_plugindir
* extensiondir

They can be queried like: `pkg-config freerdp3 --variable plugindir`

The cmake package has three new variables that can be used:
* FreeRDP_PLUGIN_DIR
* FreeRDP_PROXY_PLUGIN_DIR
* FreeRDP_EXTENSION_DIR

Note: Depending on the build the directories are not necessarily created.
2023-04-24 11:19:01 +02:00
akallabeth
ecc32eaf2e [core,info] unify string read, log unexpected
* unify reading of domain and username strings with all the checks
* add handling of (undocumented) padding in [MS-RDPBCGR]
  2.2.10.1.1.2 Logon Info Version 2 (TS_LOGON_INFO_VERSION_2)
  occurring with windows 11
2023-04-24 10:59:17 +02:00
Armin Novak
9005e1edfb [channels,printer] fix printer_save_default_config 2023-04-24 10:58:01 +02:00
Armin Novak
afc29ce777 [crypto,cert] fix cert_write_server_certificate_v2 2023-04-24 10:58:01 +02:00
Armin Novak
91b0f6d444 [crypto,cert] remove too strict assert 2023-04-24 10:58:01 +02:00
Armin Novak
41eb024d98 [channels,audin] add missing include 2023-04-24 10:58:01 +02:00
Armin Novak
c1cd48cb3c [server,proxy] allow PEM in config file
CertificateContent and PrivateKeyContent now have two valid formats:
It can be in format PEM (multiple lines) or a single line base64 encoded
PEM.
The first format is preferrable in case the pf_config* API is used to
set the certificate/key,  the latter in case an actual config file is in
use where multiline configuration data can not be directly entered.
2023-04-24 10:57:22 +02:00
Andrey Af
58cdc9e82b rdpdr_server_drive_close_file_callback remaining length fixed 2023-04-24 09:33:26 +02:00
akallabeth
c0dc193a39 [winpr,input] use enum for keyboard types
* move type definition to WinPR as used there too.
* supported keyboard types are defined in
  [MS-RDPBCGR] 2.2.1.3.2 Client Core Data (TS_UD_CS_CORE)]
  use a enum instead of magic numbers to make code more readable.
2023-04-21 12:31:51 +02:00
akallabeth
1318b813d6 [winpr,input] fix apple keyboard mapping
GetVirtualKeyCodeFromKeycode and GetVirtualKeyCodeFromKeycode used
an invalid index offset. this commit corrects that, but is API breaking.
2023-04-21 12:31:51 +02:00
Pascal Nowack
bb967d1533 winpr/input: Add actual evdev keyboard handling
WinPR provides APIs to convert between keycodes between virtual
keycodes.
These keycodes can currently be evdev keycodes or Apple keycodes.
The evdev handling, however, handles XKB keycodes and not evdev ones.
The main difference between these is that XKB keycodes are shifted by
the value 8, compared to evdev keycodes.

In order to fix this situation, rename the evdev keycodes to XKB ones,
and introduce additionally a new keycode evdev, including its handling
for this keycode type.
2023-04-21 12:31:51 +02:00
Martin Fleisz
73911425d4 gateway: Do not encrypt message during RPC NTLM auth
Commit 2de7a4c249 introduced major changes
in the gateway authentication code. One of these changes was to decouple
NTLM specific authentication from the gateway code.

However with these changes, gateway authenciation with the old RPC code
stopped working and returned an authentication error. The problem is
that currently `credssp_auth_encrypt` encrypts the given message along
creating a signature.

The old code prevented encryption of the message by specifying
`SECBUFFER_READONLY` on the message buffer. The native Windows SSPI then
leaves this buffer as-is and gateway authentication works again.

This fix only applies to Windows platforms using the native SSPI API.
Interestingly this works on other platforms using the WinPR SSPI so
there seems to be a difference between the implementations (but that's a
topic for another PR).
2023-04-21 08:15:00 +02:00
Pascal Nowack
4be3950fd8 rdpecam/server: Remove wrong assertion
Some PDUs, like the Activate Device Request only contain the header.
As a result, the size of the rest of the PDU is 0.
The assertion for the PDU size in device_server_packet_new only
considers the size of the body of the PDU.
When that value is 0, the assertion is hit and the server implementation
crashes.

To fix this issue, simply remove this assertion. Since the allocation
size is always at least the header size, there won't ever be an attempt
to create a stream with a size of 0.
2023-04-19 22:20:04 +02:00
akallabeth
dd57de8e19 [client,sdl] add function to context 2023-04-19 11:04:13 +02:00
akallabeth
0627baa939 [client,sdl] move functions to proper place 2023-04-19 11:04:13 +02:00
akallabeth
01293f4c3f [client,sdl] migrate sdl_kbd to class 2023-04-19 11:04:13 +02:00
akallabeth
63606b3c7c [client,sdl] migrate display channel to class 2023-04-19 11:04:13 +02:00
akallabeth
05a2291861 [client,sdl] split sdl_freerdp.hpp 2023-04-19 11:04:13 +02:00
Armin Novak
26ee0590d6 [client,sdl] use CriticalSectionLock
use c++ RAII to lock critical sections
2023-04-19 11:04:13 +02:00
Armin Novak
86470103c4 [client,sdl] rename c++ headers to hpp 2023-04-19 11:04:13 +02:00
akallabeth
c35b41c05d [client,sdl] rename update trigger helper class 2023-04-19 11:04:13 +02:00
Armin Novak
f5453aa952 [client,sdl] standalone build
* move to c++
* build out of tree
2023-04-19 11:04:13 +02:00
Armin Novak
8994d4a213 [core,license] fix length checks
check the correct stream.
2023-04-19 10:51:33 +02:00
Marc-André Moreau
32264b90cc add WITH_UNICODE_BUILTIN option to use built-in UTF conversion functions 2023-04-18 16:51:08 -04:00
Joan Torres
3bcbdeb9fc [core,rdstls] Avoid Stream_SafeSeek on pdu parsing 2023-04-18 20:14:36 +02:00
akallabeth
4d663682bc [server,proxy] ensure PEM length is strlen(pem) + 1
The decoded base64 data might contain PEM with/without/with multiple
'\0' at the end of the string. We do not want to drag this through our
code so ensure the length matches the string length including '\0'
2023-04-17 17:59:06 +02:00
akallabeth
7f2714a341 [client,cliprdr] fix missing include 2023-04-17 16:44:46 +02:00
Pascal Nowack
7fce527cff client/X11: Fix IO errors during server to client file transfer
When receiving a file list, xfreerdp3 rebuilds the content of the FUSE
filesystem.
Since fetching uri-lists can happen during a paste action too, xfreerdp3
caches the content of the last fetched mime type.
However, uri-lists exists in different variations, e.g. nautilus uses a
different mime type, than gnome-terminal does.
Furthermore, FormatLists can also contain other formats in addition to
file lists.
Fetching those contents during a paste operation leads to IO errors in
the paste operation.

In order to fix those errors, cache every mimetype in two hash tables:
One for the raw (unconverted) data, and one for the converted data.
When a content request is received, xfreerdp3 can with the already
cached converted data, directly serve the data.
If the content is not available as cached data, but its source data was
already fetched, use that source data to create the converted data.
Then serve the converted data.
Only if no cached converted data or cached raw data is available, issue
a new FormatDataRequest.
2023-04-17 08:33:53 +02:00
akallabeth
4c0b169774 [winpr,wtypes] fix BOOL definition for APPLE
* Add TargetConditionals.h include to ensure the symbols are defined
* Check for symbol existence and value != 0
2023-04-14 16:08:19 +02:00
akallabeth
48bbb08793 [server,proxy] remove too strict assert 2023-04-14 15:54:26 +02:00
akallabeth
c3f6b665cc [server,proxy] improve error message for invalid base64
If the certificate or private key are supplied as base64 encoded string
inform what happened before aborting.
2023-04-14 15:54:26 +02:00
Armin Novak
eb20b4ad5f [server,mac] fix missing includes, API changes 2023-04-14 15:50:50 +02:00
Armin Novak
54bd41e99c [winpr,collections] fix c++ warings for PubSub 2023-04-14 08:44:14 +02:00
Armin Novak
639ac20ed9 [winpr,stream] fix c++ warings for Stream_Write_UINT8 2023-04-14 08:44:14 +02:00
Armin Novak
8989386d01 [winpr,stream] fix c++ warings for Stream_Write_UINT64 2023-04-14 08:44:14 +02:00