Commit Graph

3560 Commits

Author SHA1 Message Date
akallabeth
3cd3f9a126
[core,gateway] add NULL checks in send function 2024-07-16 15:45:27 +02:00
David Fort
bbb6adc9c4 [core] also recognize mth:// routing token
With Azure you also have some routing token of the form mth://xxxxxxx, so accept
these as token.
2024-07-09 11:07:06 +02:00
akallabeth
17d195b7a6
[core,capabilities] fix CapsProtocolVersion
if the wrong version 0x0000 is sent (older FreeRDP based servers)
correct the value to TS_CAPS_PROTOCOLVERSION (0x0200) along with a
warning message.
2024-07-06 12:48:11 +02:00
Armin Novak
7a245a5949
[core,gateway] fix reading TSG strings
The [MS-TSGU] 2.2.9.2.1.6 TSG_PACKET_QUARENC_RESPONSE::certChainLen
represents the number of WCHAR not the size in bytes.
2024-07-03 15:37:44 +02:00
akallabeth
438cf4b333
[core,gateway] fix freerdp_tls_new call 2024-07-02 11:48:54 +02:00
akallabeth
7b7bea276c
Merge pull request #10327 from mfleisz/fix/auth-last-error
core: Fix handling of logon errors during nla_client_begin
2024-07-01 17:16:38 +02:00
Martin Fleisz
d8cd7c2f38 core: Fix handling of logon errors during nla_client_begin
Under certain circumstances `InitializeSecurityContext` returns an error
if a wrong password was provided. This PR checks the returned status
code and correctly sets the last error code. This allows a client
application to ask the user again for credentials.

A scenario where this happens is when a user tries to connect with a wrong
password and both machines are joined to the same domain.
2024-07-01 14:54:53 +02:00
akallabeth
ab39072ce9
[core,tcp] fix memory leak 2024-07-01 11:07:39 +02:00
akallabeth
562fa8a03d
[core,tcp] Improve IPv4 or IPv6 connect
* Fix +ipv6 option, now fall back to IPv4 if no IPv6 entry found
* Add new option ForceIPvX to fail connect if no such entry is found
2024-06-28 09:07:33 +02:00
akallabeth
431a96fe85
[core,gateway] properly log location 2024-06-27 08:46:48 +02:00
akallabeth
1de8f5a7aa
[core,gateway] pass rdpContext
* pass rdpContext to freerdp_tls_new
* check freerdp_shall_disconnect_context in http_response_recv
2024-06-27 08:42:08 +02:00
akallabeth
559e770982
[gateway,http] implement proper timeouts
Implement request timeouts in http_response_recv, use TcpConnectTimeout
as default
2024-06-26 22:53:09 +02:00
akallabeth
3c4c827358
[winpr,timezone] Fix GetDynamicTimeZoneInformation
* Improve logging, use single function to dump data.
* Use GetDynamicTimeZoneInformation as man getter,
  GetTimeZoneInformation only retrieves a subset.
2024-06-26 20:59:43 +02:00
akallabeth
9b89d8fa23
[core,timezone] improve timezone logging
* Unify logging to single function
* Add helpers to format magic numbers as strings
2024-06-26 20:37:41 +02:00
akallabeth
370975cbd4
Merge pull request #10288 from akallabeth/http_read_timeout
[core,gateway] use TcpConnectTimeout for read as well
2024-06-25 09:17:06 +02:00
Armin Novak
0810e7d944 [core,settings] enable SupportDynamicTimeZone
FreeRDP based clients & servers support it. If a remote does not support
it it is not send/received.
2024-06-24 14:38:39 +03:00
Armin Novak
c4fe6e78e5
[core,tcp] return errno ETIMEDOUT on timeout
BIO_C_WAIT_READ and BIO_C_WAIT_WRITE now set errno = ETIMEDOUT
if a timeout occurred.
2024-06-24 10:45:12 +02:00
Armin Novak
8df1a9a52a
[core,tcp] replace macros with inline functions 2024-06-24 10:43:24 +02:00
akallabeth
66f31e5bb9
[core,gateway] use TcpConnectTimeout for read as well
http_response_recv might never receive an answer, so do wait for input
and fail if the timeout is exceeded.
2024-06-24 10:38:52 +02:00
akallabeth
e3809650bb
[core,keyboard] Prefer FreeRDP_KeyboardCodePage
if FreeRDP_KeyboardCodePage is set use the default keyboard layout for
the codepage instead of the autodetected one.
2024-06-20 10:27:50 +02:00
akallabeth
95ed12530f
[core,nego] unify protocol to string
use a generic function to stringify SelectedProtocol and
RequestedProtocols variables.
2024-06-18 20:49:50 +02:00
akallabeth
52b6381a73
[core,gateway] filter out empty IPs from JSON 2024-06-11 17:37:35 +02:00
akallabeth
82ce4f2228
[core,arm] Add all RDSTLS IP to TargetNetAddresses 2024-06-11 17:37:33 +02:00
akallabeth
3c70feb943
[core,rdstls] set last error on authentication response 2024-06-11 17:37:30 +02:00
akallabeth
7aa72a7507
[core,settings] unify configuration paths
* Add new function freerdp_settings_get_config_path to get current
  user configuration directory
* Add CMake option WITH_FULL_CONFIG_PATH (default OFF): If defined, use
  <appdata>/Vendor/Product as config directory, otherwise use
  <appdata>/vendor (lowercase, only if vendor equal to product)
2024-06-06 11:31:22 +02:00
akallabeth
ab3ee12360
Merge pull request #10259 from akallabeth/rdstls-result-code
Rdstls result code
2024-06-05 23:39:30 +02:00
akallabeth
66e4188514
[core,rdstls] fix result code
the rdstls result codes are specific to rdstls and not shared with
NTSTATUS et al.
2024-06-05 23:13:57 +02:00
Armin Novak
7eeaabad8b
[core,childsession] initialize variables 2024-06-05 15:57:46 +02:00
Armin Novak
036228a294
[core,proxy] fix missing return check 2024-06-05 15:23:53 +02:00
Armin Novak
b9e434be48
[core,peer] check return of setsockopt 2024-06-05 15:23:53 +02:00
Armin Novak
8d783d5189
[covertity] fix various warnings 2024-06-05 09:19:59 +02:00
akallabeth
f422ea2e56
[core,gcc] check for channelMaxCount violations 2024-06-03 16:53:31 +02:00
akallabeth
a69dd9ad36
[sspi,krb] check for empty kdcUrl 2024-06-03 12:28:49 +02:00
Armin Novak
496dcff1cf
[core,codecs] fix API function names
* deprecate codecs_new and codecs_free
* add new freerdp_client_codecs_new and freerdp_client_codecs_free
2024-05-29 14:34:18 +02:00
akallabeth
ef4e6ee2c9
[common,settings] add GfxSuspendFrameAck 2024-05-24 11:51:56 +02:00
akallabeth
e253d78053
Merge pull request #10208 from akallabeth/image_copy_improve
Image copy improve, bugfixes
2024-05-24 09:01:00 +02:00
akallabeth
776a7b727f
[core,gcc] clear multitransport
if the client does not send a multitransport capability clear the flags.
2024-05-23 14:48:41 +02:00
David Fort
3147df8486 [core] fix clientInfo with both dynamicTimeZone and reconnect cookie
The ClientInfo packet was wrongly forged when we had dynamic timezone and a
reconnect cookie (reserved fields written twice).
2024-05-23 12:32:10 +02:00
akallabeth
5ca17aa8f3
[core,streamdump] use dynamic logger
* Decrease logging verbosity of streamdump
* Fix namespace of logger
* Use dynamic preallocated logger
2024-05-21 11:41:59 +02:00
akallabeth
8d5c5dc2ef
[core,caps] Allow invalid TS_GENERAL_CAPABILITYSET::protocolVersion
some FreeRDP versions did send an invalid value of 0x0000 instead of the
required 0x200. Log this kind of violation but continue.
2024-05-20 15:13:12 +02:00
akallabeth
470ef43da2
[core,streamdump] implement nodelay
allow records to be played without delay making them faster than
originally recorded
2024-05-17 10:36:22 +02:00
akallabeth
d545509f72
[settings] add TransportDumpReplayNodelay 2024-05-17 10:10:02 +02:00
akallabeth
3ced20ec5b
[core,streamdump] reset stream if packet discarded
* in stream_dump_replay_transport_read function discard previously
  read data if it was discarded.
* stream_dump_register_read_handlers needs to set
  freerdp_io_callback_set_event as otherwise we would block indefinitely
  waiting for the first data read to occur.
2024-05-17 10:04:07 +02:00
Ondrej Holy
9aca06e0b7
[core,gateway] always return in case of error
Currently, the `arm_handle_bad_request` function returns `FALSE` when the
`cJSON_ParseWithLength` function fails to parse the message, but only when
the `cJSON_GetErrorPtr` returns a valid pointer. It would be better to
return regardless of the `cJSON_GetErrorPtr` return value.
2024-05-16 11:56:03 +02:00
akallabeth
aaded541d9
[core,client] replace cJSON with WinPR wrapper
use the new WinPR JSON wrapper API
2024-05-14 20:45:31 +02:00
akallabeth
1efefceb5c
[core,settings] refactor /network
* add CONNECTION_TYPE_INVALID
* default to CONNECTION_TYPE_AUTODETECT
* allow /network:invalid and /network:0 to disable
2024-05-14 11:18:29 +02:00
akallabeth
a1d8754f1f
[core,autodetect] abort on unexpected message. 2024-05-14 11:07:50 +02:00
Armin Novak
47ac961cb9 [core,settings] initialize DynamicDSTTimeZoneKeyName 2024-05-08 10:08:08 +02:00
Armin Novak
e9bfd585ae [core,capabilities] ensure ImeFileName is '\0' terminated 2024-04-25 10:27:58 +02:00
Armin Novak
e37acf08b5 [core,redirection] free redirection::TargetNetAddresses
during some testcases the packet can be received on already allocated
TargetNetAddresses. So clean up the field before reusing it.
2024-04-25 10:27:58 +02:00