Commit Graph

5021 Commits

Author SHA1 Message Date
Armin Novak
a14c75a3a2 [core,client] handle optional monitor layout PDU
The monitor layout PDU is optional. If that was not received assume it
will not be sent and continue in next state.
2022-12-12 12:59:32 +01:00
akallabeth
d3e9210985 [core] added freerdp_is_active_state
Since client and server use different states to indicate the connection
is activated, add this convenience function to determine that
2022-12-12 12:59:32 +01:00
Armin Novak
c22d3736a3 [client] refactor client activation timeout
Move the code to a function to make it more readable
2022-12-12 12:59:32 +01:00
Armin Novak
5f81005ecb [transport] remove polling loop
We no longer have a blocking polling loop in transport. Instead assume
there is more data after a packet was processed and let the transport
try again. If there is another packet ready, this repeats until only a
partly received (or no new data available) situation is reached.
2022-12-12 12:59:32 +01:00
akallabeth
2809e14064 [core,connection] fix missing logger argument 2022-12-09 20:30:23 +01:00
akallabeth
050a2d0e74 [codec] fixed region16_union_rect
* If source and destination are equal, free the buffer on destination to
  avoid compiler warnings.
* Remove assert that is not required
2022-12-09 16:40:54 +01:00
akallabeth
d4808dd3e1 Fixed various compiler warnings 2022-12-09 15:58:26 +01:00
akallabeth
7ab917dca8 Fixed Wsign-compare warnings 2022-12-09 15:58:26 +01:00
Armin Novak
bd7e2263ad fixed const and type cast warnings 2022-12-09 15:58:26 +01:00
akallabeth
0186a9b303 Fixed some warnings 2022-12-09 15:58:26 +01:00
akallabeth
7e1065a9b9 Fixed Wshadow warnings 2022-12-09 15:58:26 +01:00
akallabeth
3ddf99ad64 Fixed Wformat warnings 2022-12-09 15:58:26 +01:00
akallabeth
aaae70ff05 Fixed missing const casts 2022-12-09 15:58:26 +01:00
Armin Novak
53cb33be47 [core] Removed unused krb5 include 2022-12-09 12:36:12 +01:00
fifthdegree
ad87144ce5 Rename WITH_GSSAPI to WITH_KRB5
Change cmake variables to not be gssapi specific
2022-12-09 12:36:12 +01:00
akallabeth
cb5c98aab0 [core,client] Add PostFinalDisconnect callback
To have more fine granied control add a new callback.
Now you have the following callback pairs:
* PreConnect <--> PostFinalDisconnect
* PostConnect <--> PostDisconnect
2022-12-09 12:30:14 +01:00
akallabeth
895c22992c [core,client] fix channel error check
Do not only check for a channel error but also abort if one is detected.
2022-12-09 11:11:40 +01:00
Armin Novak
074f28073a [winpr,sspi] enable negotiate by default 2022-12-08 11:07:00 +01:00
Mihai Radu
2bc13d50a3 fix xcrush-divideByZero (when src ==dst) 2022-12-07 17:48:11 +01:00
akallabeth
d768796163 [codec,avc] chroma reverse filter cutoff threshold 2022-12-07 15:54:58 +01:00
akallabeth
860d002794 Fixed #8451: Disable chroma subsampling
[MS-RDPEGDI] 3.1.9.1.3 Chroma Subsampling and Super-Sampling is a
compression technique that blurs fonts. Disable this to have a cleaner
image for /bpp:32 connections
2022-12-07 14:48:54 +01:00
Armin Novak
a94ae65018 [core,info] fix rdp_write_extended_info_packet
DynamicDSTTimeZoneKeyName setting might be NULL, strnlen does not allow
NULL arguments.
2022-12-07 14:43:16 +01:00
Armin Novak
3e3ed445b4 [client,file] add rdgiskdcproxy to settings
Adds a new option FreeRDP_KerberosRdgIsKdc to manually set the KDC url
to the gateway server url
2022-12-06 14:07:53 +01:00
akallabeth
8d9faa761a [settings,caps] fix cursor chache and request size
* Set a reasonably large supported cursor cache size for clients
* Ensure the MaxRequestSize is large enough to hold a large pointer
  update
2022-12-06 09:08:12 +01:00
akallabeth
ca5684c968 [settings,caps] Removed ColorPointerFlag
* The setting is obsolete and can be replaced by a constant
* Only check the receive function for proper value and print a warning
2022-12-06 09:08:12 +01:00
akallabeth
de175b7f38 [cache,pointer] ignore pointer cache index violations
If a pointer cache index is out of range for the corresponding size
announced by the capability but within range of the total cache size
only print a warning but do not abort.
2022-12-06 09:08:12 +01:00
akallabeth
6aa8253b6c [core,capabilities] Fix pointer cache size logic 2022-12-06 09:08:12 +01:00
akallabeth
f2545a2ad7 [core,capabilities] Always send PointerCacheSize
While the field is optional it can always be sent with a value of 0 to
have the same meaning as leaving it out.
2022-12-06 09:08:12 +01:00
akallabeth
6e82adea17 [cache,pointer] Fixed cache size checks
PointerCache and ColorPointerCache can be of different size
2022-12-06 09:08:12 +01:00
akallabeth
97fd183d39 [core,settings] Added ColorPointerCacheSize 2022-12-06 09:08:12 +01:00
Armin Novak
358ac53b66 [core,license] print a warning on invalid packet
* add stringify function for securityFlags
* print a error message on unexpected packet
2022-12-03 00:13:27 +01:00
Armin Novak
ff266e9575 furter added settings documentation 2022-12-02 15:25:08 +01:00
akallabeth
d898f04e41 [core,settings] Added settings function docs
* Document settings functions
* Make rdpSettings* checks more uniform
2022-12-02 15:25:08 +01:00
Armin Novak
6f2250ff4a [core] improve finalize flag log messages 2022-12-02 15:08:34 +01:00
akallabeth
4033698266 [core,credssp] Add additional checks
* Better state checks
* Improved log messages
* Assertions for debug builds
2022-12-02 15:08:09 +01:00
akallabeth
c1a9c19308 [settings] Fixed UTF16 helpers
Do not copy the already allocated buffer
2022-12-02 15:08:09 +01:00
Armin Novak
58bc1ee4c9 [smartcard] fix multi string conversion 2022-12-02 15:08:09 +01:00
Armin Novak
dc077eed78 [utils] fix smartcard string list conversion 2022-12-02 15:08:09 +01:00
akarl10
0623101b6a [rdg] fix FAILED detection and PAA string length 2022-12-01 16:36:38 +01:00
Armin Novak
97322c32ad [gateway] include '\0' in paa cookie string 2022-12-01 14:42:59 +01:00
Sergey Bronnikov
2ad1469612 Add fuzzer for certificate_data_set_pem()
Part of #6682
2022-11-30 20:06:21 +01:00
Armin Novak
41066ff36a [core,cert] improve argument checks
* Add input argument checks for exposed functions
* Assert internal function arguments
2022-11-30 13:06:07 +01:00
Armin Novak
31827485a8 [core,update] do not require EndPaint callback
Some RDP servers start sending graphics updates too early for us to
process. This triggered a bug that at that point the EndPaint callback
is not available, as the connection is not fully established.
2022-11-30 11:44:15 +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
David Fort
9db032f326 rdp: notify the Activate state as soon as it happens
Without the patch, we parse more packets and the calling code doesn't have the
opportunity to invoke PostConnect callback (make the connection not work in the proxy)
2022-11-30 08:41:22 +01:00
Armin Novak
ff2509bbc4 [core,client] relax sc flags state checks 2022-11-29 22:29:29 +01:00
Armin Novak
43571a3e34 [core,client] Added logging for finalize flags
Log an error if expected finalize flags did not match what we got.
2022-11-29 22:29:29 +01:00
akallabeth
66dad5deae fixed review issues
* Overallocation in unicode functions
* Removed useless statements
* Fixed loop indices
2022-11-28 10:42:36 +01:00
akallabeth
7bf8b46726 [smartcard] Use multistring convertion functions 2022-11-28 10:42:36 +01:00
akallabeth
5799fb2018 Replace ConvertFromUnicode and ConvertToUnicode
* Use new ConvertUtf8ToWChar, ConvertUtf8NToWChar,
  ConvertUtf8ToWCharAlloc and ConvertUtf8NToWCharAlloc
* Use new ConvertWCharToUtf8, ConvertWCharNToUtf8,
  ConvertWCharToUtf8Alloc and ConvertWCharNToUtf8Alloc
* Use new Stream UTF16 to/from UTF8 read/write functions
* Use new settings UTF16 to/from UTF8 read/write functions
2022-11-28 10:42:36 +01:00
akallabeth
2ac2f43503 [freerdp,settings] Add UTF16 helper functions
This new function allows get or set settings as WCHAR
string directly. Converts the string automatically from/to utf-8
internally
2022-11-28 10:42:36 +01:00
akallabeth
1304af4748 [core,rdp] Refactor rdp security encryption
Unify rc4 encryption key handling, use common free and reset functions
2022-11-25 12:35:14 +01:00
akallabeth
c8956513d6 [core,rdp] Add a check for broken RDP security
RDP security is rarely used nowadays, but there have been reports about
situations where the encryption key is missing.
Add this check to properly terminate the connection in case of such an
unexpected event.
2022-11-25 12:35:14 +01:00
Armin Novak
c5e425242a [settings] Typo in GatewayHttpExtAuthSspiNtlm 2022-11-23 11:19:21 +01:00
Armin Novak
7b95014157 [winpr,crypto] Split crypto header renamed
* Renamed custom winpr crypto function header
* Added compatiblity header
2022-11-23 09:39:56 +01:00
akarl10
108e52192e [rdg] fix PAA Rdg-Auth-Scheme header 2022-11-22 15:58:33 +01:00
akallabeth
af64cccae2 [core,settings] Ensure collection is empty
In freerdp_static_channel_collection_add delete the old entry before
adding a new one.
2022-11-22 15:30:31 +01:00
akallabeth
68bd3b63ae [server] Fix rdp_peer_handle_state_demand_active
* Return type is state_run_t
* Fix use, check for success
2022-11-22 15:30:31 +01:00
akallabeth
febc4b3073 [gdi,gfx] Fixed possible memory leaks
* WINPR_ASSERT all callbacks required to be set
* Unify cache slot creation/destruction
* Destroy cache slot before setting it
2022-11-22 15:30:31 +01:00
akallabeth
7faf13a811 [core,capabilities] fix pointer cache size read 2022-11-22 15:30:31 +01:00
akallabeth
296fe9cfdb [core,pointer] improve logging 2022-11-22 15:30:31 +01:00
akallabeth
94072dc64a [core,client] Fix transitions, improve logging 2022-11-22 15:30:31 +01:00
akallabeth
9a000632be Revert "Added license settings handling"
This reverts commit 58d7e1a2be.
2022-11-22 15:30:31 +01:00
akallabeth
7a037d80df [gdi,gfx] Fix width and height on reset
Since gdi->width and height are signed, use the MAX(0,gdi->width)
2022-11-22 15:30:31 +01:00
akallabeth
4284d67088 [core,state] fix state transitions, added logging 2022-11-22 15:30:31 +01:00
akallabeth
9dcf2c7e39 [nla] Advance input stream position
In nla_decode_ts_request the input stream position was not advanced.
This lead to issues when testing proper input data processing in the
client receive state callback
2022-11-22 15:30:31 +01:00
Armin Novak
f5e4ca6f6a [core] Log data not processed in event loop 2022-11-22 15:30:31 +01:00
Armin Novak
ab5858376a [core] fixed CONNECTION_STATE_MCS_CREATE_REQUEST parsing 2022-11-22 15:30:31 +01:00
akallabeth
13a58bd346 [crypto] Added sha3 define guards
sha3 is only supported with OpenSSL 1.1.1a or later
2022-11-22 12:09:39 +01:00
Armin Novak
d03f230426 [winpr,crypto] Split headers
Split windows API emulation from custom functions
Including both might yield issues with OpenSSL headers
2022-11-21 13:27:08 +01:00
akarl10
3a10bcd36a [ntlm]: use rfc5929 binding hash algorithm
rfc5929 mandates some specific hashes for the binding algorithm
2022-11-21 13:27:08 +01:00
Armin Novak
eb2782b3af [core,nego] Fixed a broken format string 2022-11-21 10:51:19 +01:00
Armin Novak
f81b3b05d2 Fixed -Wtautological-value-range-compare 2022-11-21 10:12:31 +01:00
Armin Novak
7c5652c15a Fixed -Wmissing-prototypes 2022-11-21 10:12:31 +01:00
Armin Novak
a40ade5abc Fixed -Wincompatible-pointer-types 2022-11-21 10:12:31 +01:00
Armin Novak
0a8eaf753e Fixed -Wunused-but-set-variable 2022-11-21 10:12:31 +01:00
Armin Novak
b56b09840a Fixed -Wshadow 2022-11-21 10:12:31 +01:00
Armin Novak
31c1700c0c Fixed -Wunused-variable 2022-11-21 10:12:31 +01:00
Armin Novak
8de60f9472 Fixed -Wextra-semi-stmt 2022-11-21 10:12:31 +01:00
Armin Novak
dacebc62a3 Use Stream_CheckAndLogRequiredLength, fix WLog TAG
* Log stream length requirement violations
* Use proper defines for WLog tags
2022-11-21 09:57:27 +01:00
Martin Fleisz
eb7adaec46 core: Preserve user provided credentials when being redirected
This PR fixes an issue where user credentials were lost when connecting
to a farm that redirects the client.

During a redirect the connection settings were overriden by the settings
stored in `rdp->originalSettings`. However these settings miss any
credentials the user provides during the connection phase, thus causing
another authentication prompt to appear.
2022-11-18 14:01:13 +01:00
akarl10
b1583d56c0 [rdg] implementation of http_extauth_sspi_ntlm 2022-11-16 20:28:53 +01:00
Armin Novak
f42f8c32fd [core,test] Fix TestConnect use after free 2022-11-16 16:03:21 +01:00
Armin Novak
fd7a952e70 [core,transport] only return ioEvent if we use it
transport_get_event_handles only returns the ioEvent handle in its
list if transport_io_callback_set_event was called at least once.
2022-11-16 15:32:32 +01:00
akallabeth
d83f70bc32 [core,transport] event handle for transportIO
With the latest client changes the internal event loop requires a handle
to wait on. Add a new function to (re)set the newly added transport event handle.
2022-11-16 15:32:32 +01:00
akallabeth
4ccb38aa13 [core] Check return value of *_transition_to_state
The state transition might not be allowed, so abort if that fails.
2022-11-16 15:32:32 +01:00
David Fort
4461144031 autodetect: prepare for multi-transport
Autodetect packets can be transported either in TCP TPKT packets or be contained
in multi-transport subheaders (transported on UDP). These changes do the appropriate
modifications so that in further developments we can take the transport type in account
when treating / writing these packets.
2022-11-16 11:50:46 +01:00
Richard E. Silverman
2c39bb41a8 fix use of return code from list_provider_keys()
list_provider_keys() returns a Boolean, true == success. But
smartcard_hw_enumerateCerts() expects the return value on success to
be ERROR_SUCCESS == 0, and so inverts success/failure.
2022-11-16 11:50:15 +01:00
Armin Novak
4ddef3e141 [capabilities] properly set RemoteFxOnly
The check was inverted, setting the flag properly now
2022-11-16 11:02:10 +01:00
akallabeth
bc31bae2b5 [core] Unify RDP state machine
Up to this commit the client and server state machine handling used
different return values for state machine changes.
This is fixed with this commit:
* Use common enum return values
* Use common helper functions
2022-11-15 09:57:46 +01:00
akallabeth
8760cecbc7 [rdg] Unified rpcFallback resource cleanup
Since the cleanup routines are always the same unify these in
rdg_connect.
2022-11-14 09:47:13 +01:00
akarl10
355c7ec72a rdg: Fallback to rpc if http status is not sent
It seems MS RDG 2016+ does not send a http status code if
something with the request or configuration is not ok. It is worth
retrying with rpc in that case
2022-11-14 09:47:13 +01:00
akallabeth
5b90d0bc1d Added missing length checks in zgfx_decompress_segment 2022-11-14 09:28:22 +01:00
Martin Fleisz
0629bb9c20 codec: Fix broken logging in progressive codec 2022-11-14 09:27:41 +01:00
akallabeth
4ef72bbe14 Cleanup of client RDP state machine
* Use enum for most common return types
* Add success/failed check functions
* Add a function creating a string from the return value
2022-11-11 11:51:27 +01:00
akallabeth
872f52c014 [core] properly pass redirection return code
If a redirection packet is receivet pass the appropriate return
code through the call stack to let the client take action
2022-11-11 11:51:27 +01:00
Armin Novak
98cf410144 Fixed missing state machine rerun trigger
When changing the peer state return 1 to indicate a rerun is
required.
2022-11-11 11:51:27 +01:00
Armin Novak
12f0e996c0 [server] Fix state transition return value
When transitioning from CONNECTION_STATE_FINALIZATION_FONT_LIST to
CONNECTION_STATE_ACTIVE we must return a value > 0 so that the
state machine can properly initialize the new state.
2022-11-11 11:51:27 +01:00
Armin Novak
367ecf3c0b Properly handle demand active state
The demand active state might be called when receiving data from the
client during initial connection phase or might be triggered server
side after sending a deactivate all pdu
2022-11-11 11:51:27 +01:00
Armin Novak
8210ee77db Fixed return of rdp_client_transition_to_state
Use BOOL to just indicate success/failure and actually check return
of functions called.
2022-11-11 11:51:27 +01:00