Commit Graph

3681 Commits

Author SHA1 Message Date
akallabeth
f81ff8c495 [coverity] 1543141 Dereference null return value 2024-04-12 12:41:42 +02:00
akallabeth
7bf76ab67f [coverity] 1543039 Use of 32-bit time_t 2024-04-12 12:41:42 +02:00
akallabeth
f0cc78fe1a [coverity] 1047683 Unchecked return value from library 2024-04-12 12:41:42 +02:00
akallabeth
1466d70dbc [coverity] null checks 2024-04-12 09:45:09 +02:00
akallabeth
2477b37128 [warnings,types] fix BOOL assingments 2024-04-12 09:45:09 +02:00
akallabeth
5862537471 [coverity] 1543139 Resource leak 2024-04-12 09:45:09 +02:00
akallabeth
dc488c5e23 [coverity] 1543148 Resource leak 2024-04-12 09:45:09 +02:00
akallabeth
285bea320d [coverity] 1543217 Resource leak 2024-04-12 09:45:09 +02:00
akallabeth
8d9244cb3d [coverity] 1543259 Resource leak 2024-04-12 09:45:09 +02:00
akallabeth
d3eb93f2ec [coverity] 1543248 Resource leak 2024-04-12 09:45:09 +02:00
akallabeth
cf5df96c14 [coverity] 1543228 Out-of-bounds read 2024-04-12 09:45:09 +02:00
akallabeth
da85ec371c [coverity] 1543065 Resource leak 2024-04-12 09:45:09 +02:00
akallabeth
18b4c59d17 [coverity] 1543107 Resource leak 2024-04-11 12:04:07 +02:00
akallabeth
2fefc29249 [coverity] 1543164 Free of address-of expression 2024-04-11 12:04:07 +02:00
akallabeth
1affbd0655 [coverity] 1543285 Resource leak 2024-04-11 12:04:07 +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
akallabeth
0905796cd7 [core,gateway[ fix use after free 2024-04-06 09:17:17 +02:00
Ilya Shipitsin
309509808c libfreerdp/core/gateway/rdg.c: handle malloc failure 2024-04-05 09:59:12 +02:00
Armin Novak
1b7e0ffb97 [core,smartcard] allow userhint to match UPN
the username might match the UPN of the smartcard certificate. If not
fall back to compare to userHint
2024-04-04 14:05:39 +02:00
akallabeth
82dc655979 [core,gateway] improve warning for bad request
In case of E_PROXY_ORCHESTRATION_LB_SESSIONHOST_DEALLOCATED print a
warning with the message body or a generic fallback should that not be
provided.
2024-03-26 09:19:45 +01:00
akallabeth
0106d34636 [core,gatewya] fix function argument type 2024-03-20 08:39:15 +01:00
akallabeth
67eb2fce54 [core,gateway] respect abortEvent
in RDG read functions check for rdpContext::abortEvent and terminate
blocking functions if set.
2024-03-20 08:39:15 +01:00
David Fort
64b42be79e [win32,chilsession] fix path computation in 32 bits
The path was not adjusted correctly (wrong WCHAR pointer computation).
2024-03-19 10:18:28 +01:00
akallabeth
01aef769d6 [core,license] fix incompatible WCHAR pointer 2024-03-18 13:27:32 +01:00
akallabeth
70a8b185be [core,gateway] log http response status & reason
only log headers with debug level and body with trace level.
normal operation does not require this information and will flood the
console.
2024-03-12 17:07:37 +01:00
akallabeth
e31acc048e [core,client] prevent double channel close
reset clientDataCount on close.
2024-03-12 14:24:36 +01:00
akallabeth
fd46a43934 [core,update] reset invalid regions after BeginPaint
Do not touch invalid regions before BeginPaint was called. This fixes
issue #9953 as the sdl client is waiting in BeginPaint for the screen
updates of EndPaint to be actually drawn.
2024-03-11 12:15:52 +01:00
David Fort
a4cc020b75 [win32,childsession] Fix invalid pipe path with 32 bits builds
When compiled as x86 (32 bits) the path returned by WinStationCreateChildSessionTransport
is sometime missing the beginning of the pipe path.
2024-03-11 11:24:24 +01:00
David Fort
b5713c46a7 [win32] various fix for childSession
WAIT_TIMEOUT was not correctly handled in non blocking mode. Also there was a
segfault when freeing the transport (double free).
2024-03-09 11:29:08 +01:00
akallabeth
ef8c9e48e8 [core,utils] unify channel reloading
Add the wrapper function utils_reload_channels that unifies the channel
cleanup and channel initialization sequence required on connect,
redirect and gateway policy apply
2024-03-07 16:18:41 +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
6a7c375831 [crypto,cert] add better logging of certificate read
add missing log entries for possible failures due to invalid data
received. This allows better debugging if a server sends garbage or the
crypto routines have direct RSA routine access disabled.
2024-03-07 14:59:32 +01:00
akallabeth
3b108f1839 [core,proxy] ignore empty variable
fixes #9928: ignore a defined but empty proxy environment variable
2024-03-04 14:28:38 +01:00
David Fort
aebe9742e0 [client,win32] Child session fixes
It seems like WaitFor[Single|Multiple]Object calls aren't reliable on pipes, especially
on the pipe opened for childSession access. The object can be marked as signaled even if
no data is available, making the connection laggy and unresponsive (nearly unusable in some
cases).
This patch works around that by using ReadFileEx() with overlapped instead of simple
ReadFile() and use asynchronous reads.
2024-03-01 09:46:53 +01:00
akallabeth
9a7d30d174 [clang,tidy] fix a few warnings 2024-02-27 14:15:43 +01:00
akallabeth
4b2d877bf3 [core,transport] document and fix transport_attach
* [transport_default_attach] Only attach provided socket once the
  function can no longer fail
* [transport_attach] document behaviour
2024-02-23 11:02:06 +01:00
Rubycat
3c2c6cc1d5 don't close freerdp_peer underlying socket twice
freerdp_peer->Disconnect calls BIO_free which then calls close on the
underlying file descriptor.

Then when freerdp_peer_free is called, the file descriptor is closed
again.

This is problematic if the file descriptor is recycled in between:

thread 1: freerdp_peer_new(42);
thread 1: freerdp_peer->Disconnect() closes 42
thread 2: opens a file with fd 42
thread 1: freerdp_peer_free closes 42
thread 2: uses closed file descriptor 42
2024-02-23 11:02:06 +01:00
akallabeth
acedd305d3 fixed unused-but-set-variable warnings 2024-02-22 12:31:50 +01:00
akallabeth
05e555feb7 fixed unused-variable warnings 2024-02-22 12:31:50 +01:00
akallabeth
d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth
b894199f72 [winpr,collections] add generic string clone functions
The ArrayList, HashTable, ... New functions require
void* (*fkt)(const void* ptr) type functions. Provide a generic wrapper
for CHAR and WCHAR strdup to eliminate warnings. Also export a
corresponding free function to avoid issues with runtime
differences.
2024-02-15 11:49:16 +01:00
akallabeth
d0dc657412 [build] delete unused static functions 2024-02-15 11:49:16 +01:00
akallabeth
0e44b2c674 [clang-tidy] clang-analyzer-unix.Malloc 2024-02-15 11:49:16 +01:00
akallabeth
b8598728a6 [clang-tidy] clang-analyzer-core.uninitialized.Assign 2024-02-15 11:49:16 +01:00
akallabeth
81d2c1f057 [clang-tidy] clang-analyzer-core.NullDereference 2024-02-15 11:49:16 +01:00
akallabeth
f69e1fe697 [clang-tidy] readability-duplicate-include 2024-02-15 11:49:16 +01:00
akallabeth
0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth
207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
Martin Fleisz
2e5d4fbe06 gateway: Do not fail if unprocessed padding bytes are detected
Sometimes the RPC PDUs have unprocessed data (padding bytes) at their
end. In that case do not fail but just log a warning with the correct
amount of remaining bytes.
2024-02-14 16:25:41 +01:00
akallabeth
2fffcd64b9 [winpr] use winpr_strerror instead of strerror
use the wrapper from WinPR to use the best implementation available.
2024-02-06 15:45:47 +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
Isaac Klein
763462d0a9 include null byte in Authorization Request PDU
The RDS AAD Auth PDUs have no packet headers to indicate length.
Instead, these packets are zero-terminated strings. Somehow, Windows
accepts Authentication Request PDUs without a terminating null byte
during regular connections, but not through WVD websocket gateways.
2024-02-04 13:00:48 +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
e067e9dc6d [core,peer] fix typo 2024-01-29 11:52:22 +01:00
akallabeth
cefe847683 [core,gateway] use FREERDP_USER_AGENT define
Define FREERDP_USER_AGENT in version.h to be used by gateway http user
agent
2024-01-29 08:46:29 +01:00
Vic Lee
f2794daf38 [core,transport] make blocking mode available to transport IO interface. 2024-01-22 12:57:01 +01:00
akallabeth
575d42312a [code] improve error checks on free 2024-01-19 09:57:41 +01:00
Armin Novak
db73c562a2 [core,gcc] split update of RDP encryption from gcc
* Update EncryptionLevel and EncryptionMethods before writing GCC data
* Use const rdpSettings* in all GCC write functions
2024-01-19 06:51:30 +01:00
akallabeth
a842350177 [core,license] improve logging of failures
* ensure every failure path writes an appropriate log message
* fix compiler warnings (integer sizes, ...)
2024-01-15 13:13:42 +01:00
akallabeth
c303e4e8b9 [core,security] ensure length, log failures 2024-01-15 13:13:42 +01:00
akallabeth
55f200f1b5 [core,tpkt] log too large tpkt stream length 2024-01-15 13:13:42 +01:00
Vic Lee
16206cb505 [channels,drdynvc] Add settings to enable synchronous dynamic channels. 2024-01-11 15:24:55 +01:00
akallabeth
0e828bd657 [core,peer] properly handle out of sequence PDU
If the peer state machine is in state
CONNECTION_STATE_CAPABILITIES_EXCHANGE_MONITOR_LAYOUT properly check for
available data. If a PDU was received in this state it is an out of
sequence PDU (that might happen during deactivation/reactivation) and
must be parsed.
2024-01-10 08:27:14 +01:00
akallabeth
a612463c96 [core,peer] improve logging
log unhandled data in peer_recv_callback as warning if the loop
terminates.
2024-01-10 08:27:14 +01:00
akallabeth
2e42d8ac2b [core,connection] add more logging
log peer->ClientCapabilities execution failures
2024-01-10 08:27:14 +01:00
akallabeth
af9e74273d [common,assist] improve test to cover full parsing 2024-01-09 15:18:37 +01:00
akallabeth
c2f4ad80a5 [common,settings] fix TargetNetAddresses usage
* use a common function to allocate both, TargetNetAddresses and
  TargetNetPorts
* unify handling, utilize helper functions as much as possible
2024-01-09 15:18:37 +01:00
Vic Lee
33447dc16e [nla,transport] move public key retrieval to transport IO. 2024-01-03 08:40:39 +01:00
Armin Novak
bb8c08f06e [build,mingw] rename variable interface
interface is a reserved keyword with mingw, breaking compilation.
2023-12-21 07:11:12 +01:00
Armin Novak
6c26980585 [core,server] lock FreeRDP_WTSVirtualChannelWrite
* FreeRDP_WTSVirtualChannelWrite might be called from different threads,
  so lock the function execution to keep split packets in order
* unify DVC and SVC channel creation/deletion to avoid duplicate code
2023-12-20 11:26:54 +01:00
Armin Novak
b02d4a81b5 [core,update] reset invalid regions at BeginPaint
The client must handle graphics updates in EndPaint.
If we already reached BeginPaint again reset the invalidated regions
as they are already processed and start anew. Fixes #9672
2023-12-20 09:28:53 +01:00
Armin Novak
0af308c1b5 [core,test] adjust TestConnect timeouts
when run on qemu systems for alternate architectures we need to lower
our speed expectations and increase the failure timeouts
2023-12-20 09:03:58 +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
678b392e89 [warnings] fixed -Wformat 2023-12-13 13:24:22 +01:00
Armin Novak
d6b7cfc1c2 [warnings] fixed -Wpointer-sign 2023-12-13 13:24:22 +01:00
Armin Novak
5638b5061c [core] fixed -Wenum-int-mismatch 2023-12-13 13:24:22 +01:00
Armin Novak
adb5e5715b [cache,glyph] print warning if enabled
glyph-cache is buggy, warn if enabled.
2023-12-12 19:36:54 +01:00
Armin Novak
468106033f [core,capabilities] disable surface command
if the remote end does not support fastpath disable surface commands.
2023-12-06 20:14:02 +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
195d665af6 [core,caps] added rdp_input_flag_string 2023-12-06 10:45:01 +01:00
Armin Novak
c7fec578a7 [core,input] fix function argument sign 2023-12-06 10:45:01 +01:00
Armin Novak
a7200699f4 [core,gateway] do not pack RPC_FAULT_CODES 2023-11-30 12:43:03 +01:00
Stefan Heinzel
52606929fb 5726 add vsock support for client and server 2023-11-29 15:12:51 +01:00
David Fort
079731068c [core] fix freezing connection to childSession
When connecting to child session(or a VM), we have CredSSP/Nego/ActivationSequence
instead of Nego/CredSSP/ActivationSequence. Before the patch, we were not applying
flags read in the NegoResponse to the settings and that was leading to FreeRDP
thinking that the remote server was not supporting EXTENDED_CLIENT_DATA_SUPPORTED.
That was later preventing some GCC blocks to be sent, and make the server unhappy
and freeze the connection.
2023-11-28 13:28:08 +01:00
akallabeth
1b31852d32 [git] remove .gitignore
we do no longer allow in source builds, so remove all the .gitignore
files just hiding generated files
2023-11-28 12:14:55 +01:00
Armin Novak
492cbc8e6f [opaque_settings] reorder internal includes
order is important for internals, as the deprecation warnings are
deactivated for this use case
2023-11-24 21:23:38 +01:00
akallabeth
737cd9b8f6 [warnings] Wshadow, uninitialized variables 2023-11-24 18:19:03 +01:00
akallabeth
c78e466be1 [warnings] fixes Wunused-variable 2023-11-24 18:19:03 +01:00
akallabeth
6b9245849c [warnings] type casts 2023-11-24 18:19:03 +01:00
akallabeth
dd2d110870 [warnings] fix -Wcast-qual 2023-11-24 18:19:03 +01:00
akallabeth
ceb7bd1d41 [warnings] fixed clang build warnings 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
6e6559c41a [settings] fix type mismatch warnings 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
1163cc4d5c [core] add internal settings.h include 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
3ca26384ee [core] only move state on demand active
rdp_client_connect_demand_active returns STATE_RUN_ACTIVE if we received
it, some other return otherwise
2023-11-21 13:54:29 +01:00
akallabeth
0ee61dcb62 [core,connection] improve parsing of demand active
Split up parsing, so we don´t have to reread the data.
2023-11-21 13:54:29 +01:00
akallabeth
e3a84921de [core,gateway] fix TSG_PACKET_TYPE_QUARENC_RESPONSE
parsing of TSG_PACKET_TYPE_QUARENC_RESPONSE was incomplete, fix that
2023-11-20 18:00:42 +01:00
Armin Novak
e451b4cad1 [core,gateway] rpc use generated session id 2023-11-20 18:00:42 +01:00
Armin Novak
7d02a97a88 [core,gateway] change type of GUID arguments
use const GUID* for GUID strings and format the string internally
2023-11-20 18:00:42 +01:00
Armin Novak
e62e1dbbaf [core,gateway] add RDG-Correlation-Id
implement [MS-TSGU] 2.2.3.2.2 RDG-Correlation-Id
2023-11-20 18:00:42 +01:00
Armin Novak
148e61606a [core,gateway] silence reading of rts signature
sometimes we just try to read the signature and do not want errors
logged.
2023-11-20 18:00:42 +01:00
Armin Novak
99f3a9c0e6 [core,gateway] add rts_recv_ping_pdu 2023-11-20 18:00:42 +01:00
Armin Novak
f367465485 [core,gateway] improve rpc logging 2023-11-20 18:00:42 +01:00
Armin Novak
9fcde2db74 [core,gateway] removed duplicate vc_state_str 2023-11-20 18:00:42 +01:00
Armin Novak
8990ffefca [core,gateway] rpc dynamic logger 2023-11-20 18:00:42 +01:00
Armin Novak
36647567ac [core,gateway] fix parsing of RTS PDU
* [MS-RPCH] 2.2.4.51 FlowControlAckWithDestination RTS PDU
2023-11-20 18:00:42 +01:00
Armin Novak
814ab2a212 [core,gateway] use dynamic logger in tsg 2023-11-20 18:00:42 +01:00
Armin Novak
6e7a35f8bc [core,gateway] log rts_recv_out_of_sequence_pdu 2023-11-20 18:00:42 +01:00
Armin Novak
a0db106306 [core,gateway] add vc state logging 2023-11-20 18:00:42 +01:00
Armin Novak
fac9fa5f90 [core,gateway] add rpc stringify functions 2023-11-20 18:00:42 +01:00
Armin Novak
60ceff95c5 [fflush] remove of unnecessary fflush 2023-11-20 18:00:42 +01:00
Armin Novak
cf76e70e85 [core,gateway] fix rts_read_auth_verifier_with_stub
check offset against fragment size, not remaining size
2023-11-20 18:00:42 +01:00
Armin Novak
65d3c6fe9b [core,gateway] update tsg parsing 2023-11-20 18:00:42 +01:00
Armin Novak
135c4cc78c [core,gateway] try to parse remaining RPC PDU
if not all bytes have been parsed, try parsing again
2023-11-20 18:00:42 +01:00
Armin Novak
230563b337 [core,gateway] log incomplete parsed RPC PDU 2023-11-20 18:00:42 +01:00
Armin Novak
d36adb2654 [core,gateway] fix RTS_PDU_PING handling
ping messages might occur before connection is fully established, so
reply to incoming ping. Fixes #9505
2023-11-20 18:00:42 +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
Armin Novak
957ec80443 [core,gatewayay] improve rpc error logging 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
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
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
David Fort
60ea534ccd [core] fix marshalling of DynamicTimeZone
The field is an UTF16 field, the length was announced as the length of the
UTF8 string.
2023-10-24 12:42:10 +02:00
akallabeth
0b018057b5 [core,input] use time() instead of timespec_get
android only supports the latter with API >= 29
2023-10-19 16:37:28 +02:00
Mariusz Bialonczyk
1d1171489f [tools] update-settings-tests, update-rdpSettings, clang-format 2023-10-19 16:37:28 +02:00
Mariusz Bialonczyk
550ba7fe34 [libfreerdp] final freerdp_prevent_session_lock() implementation
Injects fake mouse movement when idle
2023-10-19 16:37:28 +02:00
Mariusz Bialonczyk
90f82bf418 [input] call input_update_last_event() when desired 2023-10-19 16:37:28 +02:00
Mariusz Bialonczyk
21f7bd37cf [input] input_update_last_event() and variables 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
David VERON
63e1863c9a fixes rdp_read_info_null_string api
Removed buggy "isNullTerminated" parameter, as RDP specs tells
that cbLen includes the nullTerminator if there is one.
2023-10-16 15:18:52 +02:00
Armin Novak
c91a250623 [warnings] add WINPR_FORMAT_ARG
with WINPR_FORMAT_ARG format strings are marked for MSVC to avoid
warnings
2023-10-16 15:10:13 +02:00
Armin Novak
53b65ff7bd [documentation] fix Wdocumentation warnings 2023-10-16 15:10:13 +02:00
Armin Novak
07543a6042 [warnings] fix various warnings
* missing const in casts
* missing static for functions
* missing WINPR_ATTR_FORMAT_ARG for printf like functions
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
80122c1784 [core,aad] cast constants to DWORD 2023-10-10 22:59:53 +02:00
David Fort
a8c5926154 [server,drdynvc] use a hashtable for dynamic channels instead of an arrayList
This speeds up all operations around dynamic channels.
2023-10-09 10:47:34 +02:00
David Fort
ff303a9bda [core,nla] Inject received TSCredentials in the peer's settings
The RDP client sends TSCredentials so that the server can reuse these credentials. This
patch stores these values in the peer's rdpSettings in the corresponding fields.
It handles TSPasswordCreds for user/domain/password connection but also TSSmartCardCreds
when the users has connected with a smartcard.
2023-10-04 09:22:49 +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
David Fort
0638c382f9 [core,nla] correctly print the value of earlyUserAuth
The log was printing the previous value instead of the value that is set.
2023-09-27 11:57:49 +02:00
akallabeth
86acc8d31a [warnings] fixed reserved-identifer warnings 2023-09-25 08:39:01 +02:00
akallabeth
0595f2f7fe [core,gateway] fix tautological check in arm 2023-09-21 10:57:43 +02:00
akallabeth
635626be12 [client,common] avd related keys to rdp file parser 2023-09-21 10:30:09 +02:00
akallabeth
7746c8f4ae [core,orders] fix #9402 polyline order processing 2023-09-21 10:00:19 +02:00
akallabeth
1d25242eac [core,transport] fix evaluation of nla errors
if there is no rdpNla fall back to default error password expired.
2023-09-21 10:00:19 +02:00
akallabeth
e5ad90627b [gateway,arm] fix abort condition for retries 2023-09-20 09:29:45 +02:00
akallabeth
c1db0029d9 [core,update] fix possible leak on gdi reset 2023-09-20 09:29:45 +02:00
Armin Novak
6399635abf [core] fix leaks reported in #9400 2023-09-19 09:35:52 +02:00
David Fort
190ecf640f [drdynvc] improvements of server-side DRDYNVC
This patch prepares the reading of the dynamic channel version so that next we
can take in account this to take advantage of advanced features in last versions
(compressions or priorities).
The patch also implement notifying the VCM event when the dynamic channel becomes ready
so that users of FreeRDP can just do calls to WTSVirtualChannelManagerGetDrdynvcState
when the channel event is set (no blind calls).
2023-09-18 13:05:44 +02:00
Armin Novak
4152ce5dee [gateway,arm] fix input string length check 2023-09-15 11:24:21 +02:00
akallabeth
be7f2979ee [gateway,http] const correct HttpResponse 2023-09-14 17:38:08 +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
akallabeth
ab111b07bc [gateway,http] add a '\0' terminator to body read
ensure that every string read by the http functions is '\0' terminated.
2023-09-14 12:02:26 +02:00
akallabeth
13648c84af [gateway,arm] restructure AVD handling
* Split handling into smaller functions
* Move bad request retry out of request function to avoid memory growth
2023-09-14 12:02:26 +02:00
Eduard Mielieshkin
87529fe5ac changed the log messages 2023-09-14 12:02:26 +02:00
Eduard Mielieshkin
a785fd9c4a formatted using clang-format 2023-09-14 12:02:26 +02:00
Eduard Mielieshkin
4dcf35c0cb PoC: waiting until an AVD instance is up 2023-09-14 12:02:26 +02:00
David Fort
1afaaa82d3 [core,arm] Various fixes and adjustements for #9363
Treat the case where the publicIpAddress is there but empty.
Don't try RDSTLS if the password has not been been provided.
When RDSTLS is what we will do, disengage all the other security kinds.
2023-09-14 09:00:46 +02:00
Armin Novak
5f8f69512b [core,orders] fix reading order number field
the field for delta rectangles/points/... are only transmitted if they
changed from the previous order of the same type. So keep the original
value and update only if a new one is read.
2023-09-04 12:24:57 +02:00
Armin Novak
12e6bbe13b [core,orders] log order fields not in packet 2023-09-04 11:32:35 +02:00
Armin Novak
1a1f422d79 [core,orders] unify delta point buffer allocation 2023-09-04 11:32:35 +02:00
Armin Novak
36b58c0688 [core,orders] abort if required filed is not found 2023-09-04 11:32:35 +02:00
Armin Novak
618102b28f [core,orders] update log message 2023-09-04 11:32:35 +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
akallabeth
ce41d514ab [core,info] fix rdp_read_info_string
* Use proper freerdp_set_string* functions to set string
* In case of failure clean up existing string values
2023-09-02 07:56:21 +02:00
akallabeth
2102fa907a [core,connection] use dynamic logger rdp->log
for state transition logging use dynamic logger instead.
2023-09-02 07:56:21 +02:00
akallabeth
54021b50b0 [core,peer] fix initial state transitions
update initial state transitions according to [MS-RDPBCGR]
the diagram is misleading, some of the text below ambigious, but
1.3.1.1 Connection Sequence phase 10 description lists the dependencies
of server initiated messages.
2023-09-02 07:56:21 +02:00
akallabeth
4461219497 [core,rdp] make monitor layout PDU optional
the PDU might arrive or not, do not get stuck if not.
2023-09-02 07:56:21 +02:00
Armin Novak
1bbed81041 [core,orders] fix checks for multi opaque rect 2023-08-28 13:07:28 +02:00
akallabeth
60dd48e698 [api] fix integer overflow warnings 2023-08-25 14:36:05 +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
4e824b243f [winpr] add WINPR_ATTR_FORMAT_ARG
this macro declares the function argument (pos,arg) to be a printf
style format string and enables compiler checks for that.
2023-08-25 12:56:36 +02:00
akallabeth
9cee9b3c08 [c standard] use WINPR_FALLTHROUGH
use the macro to silence intentional switch fallthrough locations
2023-08-25 12:56:36 +02:00
akallabeth
0a90e9214e [core,aad] fix type mismatch warning 2023-08-25 12:56:36 +02:00
akallabeth
feb5ab52cb [core,rdp] add log messages for unexpected data 2023-08-25 08:42:31 +02:00
akallabeth
d3ba8ebf00 [core,update] log BeginPaint/EndPaint failure 2023-08-23 14:27:51 +02:00
akallabeth
023c2dba6e [core,autodetect] log unknown message types 2023-08-23 14:27:51 +02:00
akallabeth
769ffbd8a0 [core,fastpat] add logging for failures 2023-08-23 14:27:51 +02:00
akallabeth
74b1d5da89 [core,redirection] add logging
add log messages for all possible failure causes
2023-08-23 14:27:51 +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
65a05fc490 [core,server] set freed pointer NULL
Fixes #9271: after freeing the memory reset it to NULL to signal it was
already handled.
2023-08-21 13:35:36 +02:00
2fly2
bce9f1cbe6 [core,settings] default disable ThinClient setting
fixes show black window when connect transparent app in
windows server 2012r2
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
e51a5b33fb [core,orders] fix undefined variable, unify log strings 2023-08-03 13:54:03 +02:00
ehdgks0627
2496037f03 Standardize failure messages for order functions 2023-08-03 13:54:03 +02:00
ehdgks0627
105ce6c56b Update error message when update_read* function failed 2023-08-03 13:54:03 +02:00
Armin Novak
0cd36c1526 [build] fix Wmissing-prototypes 2023-08-01 08:37:58 +02:00
Joan Torres
a332db7cf5 [libfreerdp] fix endianness issues
There were some fields sent without considering endianness, making the
clients fail when parsing those fields.

Use Data_Write_XXX functions so the endiannes won't affect the byte order
and the clients will read properly the fields.
2023-08-01 07:56:16 +02:00
Richard Markiewicz
f59c98eebe [core,info] Fix rdp_info_read_string conversion check 2023-08-01 07:15:59 +02:00
Armin Novak
ef5c0e78ab [build] use define WINPR_FALLTHROUGH
with c17 compatible compilers annotate with [[fallthrough]]
2023-07-31 23:46:53 +02:00
Armin Novak
e7c2a75e1e [gateway,rpc] return FREERDP_ERROR_CONNECT_ACCESS_DENIED
unify http and rpc gateway return codes
2023-07-31 16:51:14 +02:00
Armin Novak
c656bb9d1d [core,gateway] ensure '\0' termination of http response 2023-07-31 16:51:14 +02:00
Armin Novak
de6aaded94 [core,gateway] improve http_response_print
print out all response data.
2023-07-31 08:46:57 +02:00
Armin Novak
8be9a3a5dd [core,gateway] unify http response logging 2023-07-31 08:32:43 +02:00
Armin Novak
03b78dd57b [aad] print http status response message 2023-07-28 16:42:23 +02:00
Armin Novak
cd7cb514a8 [core,gateway] unify http response logging 2023-07-28 16:42:23 +02:00
Armin Novak
0bdb62e9b5 [libfreerdp] fix integere narrow warnings 2023-07-28 15:48:32 +02:00
ehdgks0627
d04ba8d6ef Correct typos and formatting errors in format strings
In several files, fixed typos in format strings that were causing unexpected output and formatting issues.
2023-07-28 15:34:46 +02:00
Armin Novak
077aff0217 [core] fix cast warnings 2023-07-28 13:42:12 +02:00
Armin Novak
9d5e95c60b [core] fix unary minus warnings 2023-07-28 13:42:12 +02:00
Armin Novak
76169c26cd [core,caps] fix warnings 2023-07-27 20:02:43 +02:00
Armin Novak
6c01433f6a [core,smartcardlogon] fix warnings 2023-07-27 20:02:43 +02:00
Armin Novak
e61880d077 [standard] replace __FUNCTION__ with __func__ 2023-07-27 20:02:43 +02:00
Martin Fleisz
bb9c32ed72 gateway: Allow authentication using a NULL (current user) identity 2023-07-26 16:35:36 +02:00
fifthdegree
8330aa1ac4 Log aad authentication_result as hex and string 2023-07-26 09:44:17 +02:00
Armin Novak
a5ea634516 [core] fix cJSON compat
* only export used symbols, provide prototypes when required
* clean up some length checks
2023-07-24 09:54:49 +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
dev
80c7818f99 fix warning 2023-07-21 09:14:54 +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
a0d38914d6 [core,aad] refactor use of cJSON
* link cJSON public to FreeRDP
* export compatibility functions for older versions of cJSON
2023-07-20 14:20:28 +02:00
akallabeth
5d8e21927c [warnings] fix compiler warnings 2023-07-20 14:20:28 +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
4d7d136d1a core/server: Remove invalid cast
The context of wMessage is already a pointer, so the cast into UINT_PTR
is wrong here.
Additionally, casts from void pointers are superfluous.
2023-07-20 11:36:11 +02:00
Armin Novak
6d9d118593 [core,nego] remove AUTHZ_RESULT from nego header 2023-07-13 09:25:45 +02:00
Armin Novak
555fa2c98a [core,nla] print name of error code in log 2023-07-13 09:25:45 +02:00
Armin Novak
10e010329c [client,file] add WebAuthN rdp file parsing support 2023-07-10 10:45:28 +02:00
akallabeth
e18918356f [core,rdp] set logger context 2023-07-06 15:51:56 +02:00
Martin Fleisz
a5aad5159c core: Fix issues in settings copy code
This code fixes an issue where some settings were lost when copying
settings around. I.e. the device count was first set but then calling
`freerdp_settings_set_pointer_len` caused the device count to be reset
to 0 because we passed `NULL` for the data value.

This means the count got lost upon the first copy and further copies
also resulted in losing the array data (because the count was set to 0).

This PR fixes this issue by first resetting the array and afterwards
setting the correct count value.
2023-07-06 14:26:38 +02:00
akallabeth
4c862892b4 [core,gateway] clean up websocket transport 2023-07-05 13:18:54 +02:00
akarl10
76abdcdabf [core,gateway] cleanup http response 2023-07-05 10:43:27 +02:00
akallabeth
18185e9dbc [test] disable TestConnect on windows
build directories are different and the test logic can not find the
binaries necessary to launch
2023-07-05 08:46:00 +02:00
akallabeth
d9b03b45ed [test] add executable suffix for TestConnect 2023-07-05 08:46:00 +02:00
Michael Saxl
a5a60c888b [core,transport] free wst transport after use 2023-07-04 20:33:13 +02:00
Martin Fleisz
622a2a8df0 misc: More int to BOOL conversion fixes
This is a follow up to #9129.

This PR fixes some problematic `int` to `BOOL` conversions that might
cause overflows when checking for bit flags.
2023-07-04 09:45:20 +02:00
Martin Fleisz
37f9d5b494 core: Fix flag check to enable/disable RDSTLS security
On some platforms (i.e. Mac) the BOOL type might be narrower than the
`RedirectionFlags` type leading to an overflow when just assigning the
logical AND result to the setting. This fix makes sure that the value is
correctly set to either `TRUE` or `FALSE`.
2023-07-04 09:17:05 +02:00
akallabeth
a01f3ec5ab [client,common] allow adding a named keyboard pipe
This allows starting FreeRDP clients with a named pipe that will type in
text written to the named pipe as keyboard input
2023-07-03 13:21:43 +02:00
Michael Saxl
132ce797db [core,gateway,wst] fix use after free in wst_connect 2023-07-03 10:00:12 +02:00
akallabeth
e03b6596c6 [build] fix unused but set variable warnings 2023-06-29 18:34:51 +02:00
akallabeth
851f9cce2d [core,nla] fix unused variable warning 2023-06-29 18:34:51 +02:00
akallabeth
5dcd9fcb8a [core,gateway] eliminate intermediate buffer 2023-06-29 18:34:51 +02:00
Armin Novak
66cb8c68d4 [core,nego] change nego_set_routing_token argument
Use void* instead of BYTE* as the real type is unknown and warnings can
be avoided
2023-06-29 14:46:41 +02:00
akallabeth
37d9c891b4 [core,gateway] fix return value checks 2023-06-29 14:30:09 +02:00
akallabeth
b9ec4ef60d [core,info] fix stream read check
read into variable of wrong type, fixed that.
2023-06-29 14:30:09 +02:00
Armin Novak
de7fea7347 [core,gcc] gcc_read_client_data_blocks update checks
* Update checks for stream consumed
* Update log messages, use stringified version of block type
2023-06-29 08:09:53 +02:00
akarl10
8d707adcb2 [core,gateway] make http authentication work again for websocket transport 2023-06-28 11:40:22 +02:00
akarl10
7f19fab76e [core,gateway] only encode a cookie line if there is a cookie 2023-06-28 10:47:47 +02:00
akallabeth
3f78b3c379 [build] fix unused compiler warnings 2023-06-28 09:45:09 +02:00
Armin Novak
4d807a0bf0 [core,gateway] fix check for authentication 2023-06-27 21:15:08 +02:00
Armin Novak
ea66b23631 [core,gateway] fix various issues with arm transport
* fix possible leaks
* split big functions
* fix missing NULL checks
2023-06-27 21:15:08 +02:00
akallabeth
ca47058e8c [core,gateway] use custom copy for listdictionary 2023-06-27 21:15:08 +02:00