Commit Graph

17117 Commits

Author SHA1 Message Date
Armin Novak
8989386d01 [winpr,stream] fix c++ warings for Stream_Write_UINT64 2023-04-14 08:44:14 +02:00
Armin Novak
a13701f69c [winpr,assert] eliminate c++ warnings
Eliminate cast warnings when used in C++ code
2023-04-14 08:44:14 +02:00
Pascal Nowack
8362b3707e pointer: Rename position to hotspot position in Color Pointer Update
The attributes xPos and yPos for a Color Pointer Update are confusing,
as they may be confused with the xPos and yPos of the pointer bitmap on
the actual screen.
Rename these attributes to what they actually represent, and that is the
hotspot position.
xPos and yPos are still members of the hotspot. However, hotSpotX and
hotSpotY are much more clearer.
In addition to that, the Large Pointer Update uses the same names for
the hotspot coordinates.
2023-04-14 08:31:20 +02:00
Armin Novak
ba7840f8ad [server,proxy] fix rdpdr rewrite
do not touch the stream if no rewrite is done.
2023-04-14 08:02:49 +02:00
Armin Novak
abe49dfd3d [core,settings] fix missing return path 2023-04-13 14:41:16 +02:00
Armin Novak
3c3c996974 [client,common] do not insist on 32bpp for rfx/gfx 2023-04-13 14:35:51 +02:00
Armin Novak
391f5e0ddb [settings] add freerdp_supported_color_depths_string 2023-04-13 14:35:51 +02:00
Armin Novak
fcdd3a1e75 [core,gcc] SupportedColorDepths and HighColorDepth
Split these, now independent from ColorDepth
2023-04-13 14:35:51 +02:00
Armin Novak
39767c5423 [settings] add supported color depths setting 2023-04-13 14:35:51 +02:00
Armin Novak
7a283a140a [client,sdl] improve mouse scroll speed 2023-04-13 13:20:38 +02:00
Pascal Nowack
43f0fbdc12 core/autodetect: Allow overriding connect-time autodetection handling
Currently, FreeRDP-based server implementations can do connect-time
autodetection.
However, without having any control over it.

In order to be able to override the default connect-time autodetection
handling, introduce three new states for the state machine of the
connection sequence and two new callbacks for the autodetect handling.

These are:
- CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_BEGIN
- CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_IN_PROGRESS
- CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_END

- OnConnectTimeAutoDetectBegin()
- OnConnectTimeAutoDetectProgress()

The END state is pretty simple: When the autodetection is finished and
the autodetect state is FREERDP_AUTODETECT_STATE_COMPLETE, transition
into the next state of the connection sequence.

The BEGIN state is entered, when capability-wise network autodetection
is available.
In this state, the OnConnectTimeAutoDetectBegin callback is called, the
server implementation may initialize any related handling here.
If the server implementation determines, that no further handling is
required, it can end the autodetection phase by returning
FREERDP_AUTODETECT_STATE_COMPLETE.
If not, and an autodetection request is sent, it returns
FREERDP_AUTODETECT_STATE_REQUEST.
The state machine of the connection sequence will then switch into the
IN_PROGRESS state.

In the IN_PROGRESS state, any incoming PDU is handled first, then the
OnConnectTimeAutoDetectProgress callback is called.
Like in the BEGIN state, the return value will determine, whether the
state machine of the connection sequence goes into the END state or goes
into (or rather stays) in the IN_PROGRESS state.
2023-04-13 09:58:52 +02:00
Pascal Nowack
91ff145ae8 core/autodetect: Rework server side API to be closer to documentation
The current state of the autodetect API for the server side does not
include all allowed scenarios where the network autodetection can be
used.
This for example includes the connect-time autodetection, as the
related calls are hidden inside FreeRDP, and not exposed as public API.
In order to avoid duplicate send methods, check the state of the
connection sequence.
If the connection sequence is not yet done, use the connect-time request
types.
Otherwise, use the continuous request types.

The Bandwidth Measure Payload PDU is a little special case, as it is
only allowed to be sent during the connection sequence.
To ensure this, add an assertion in its sending method.

Also fix the handling for the Network Characteristics Sync PDU:
Previously, after parsing the PDU data, the read data was just sent
again to the client, which is wrong.
To fix this issue, introduce a callback for this client-to-server PDU,
so that the actual server implementation can hook up its own handling
for this PDU.
Depending on the situation, the server side may want to discard or use
the retrieved data here.

Moreover, decouple the send-handling for the Network Characteristics
Result PDU from the local autodetect variables.
Currently, these variables are shared between the send and receive
methods.
This leads to access problems, where the server side, wants to use a
different thread to send the autodetect PDU, as the receive handler may
receive an autodetect PDU and overwrite these values with possible
nonsense values.
This is especially the case with RTT response PDUs, as the written
netCharAverageRTT and netCharBaseRTT values are only correct, when only
one RTTRequest happens at a time and no stray RTTResponses are received.
2023-04-13 09:58:52 +02:00
Armin Novak
f8e8764ea8 [core,settings] unify identity from settings 2023-04-11 11:37:09 +02:00
Armin Novak
9b498efa79 [core,nla] unify identity creation 2023-04-11 11:37:09 +02:00
Armin Novak
4408521421 [winpr,sspi] match SEC_WINNT_AUTH_IDENTITY integer
windows defines them with ULONG which does not match UINT32, so keep
these types proper
2023-04-11 11:37:09 +02:00
Armin Novak
e2f85fc329 [core,nla] ensure the identity is created with unicode 2023-04-11 11:37:09 +02:00
Armin Novak
13c025e04c [winpr,sspi] remove sspi_SetAuthIdentityWithUnicodePassword
the function is useless as we always use the SetAuthIdentityW API now
2023-04-11 11:37:09 +02:00
Armin Novak
91056dc96c [client,common] fix file clipboard locking 2023-04-11 11:34:19 +02:00
Armin Novak
aac0c0d01d [core,gateway] fix expected size for rts_read_auth_verifier_no_checks 2023-04-11 11:31:57 +02:00
Armin Novak
c638c51484 [core,gateway] fix expected length rts_read_auth_verifier_with_stub 2023-04-11 11:31:57 +02:00
Armin Novak
adc6b60bcf [core,gateway] silence rts_read_common_pdu_header
rts_read_common_pdu_header is used to determine if the packet was read
successfully. In that case it might fail but there should be no logging
done to not spam it with unnecessary warnings.
2023-04-11 11:31:57 +02:00
akallabeth
6a35f11faa [core,gateway] fix warnings with static stream 2023-04-11 11:30:41 +02:00
akallabeth
f3b7c1b84d [core,gateway] log http status codes 2023-04-11 11:21:27 +02:00
akallabeth
0f1b0cac76 [core,gateway] add http_status_string_format 2023-04-11 11:21:27 +02:00
akallabeth
8eec678710 [core,gateway] add http_status_string 2023-04-11 11:21:27 +02:00
akallabeth
7739815a90 [codec,h264] add getter/setter for h264 options 2023-04-11 10:58:03 +02:00
akallabeth
983c820f16 [codecs] make h264 and planar opaque 2023-04-11 10:58:03 +02:00
Joan Torres
1f58b64f68 [core,redirection] Fix sending redirection certificate
TargetCertificate option is set in TARGET_CERTIFICATE_CONTAINER format.

Exposed ELEMENT_TYPE_CERTIFICATE and ENCODING_TYPE_ASN1_DER1 to allow
building it externally in the mentioned format.
2023-04-11 10:29:16 +02:00
Rubycat
207d886a90 Unique kerberos ccaches for parallel connections.
The "MEMORY" ccache is shared in a process.
If a client uses it to make parallel connections,
the same ccache may be used for several clients with distinct
credentials.
To prevent such sharing we create a unique, dedicated ccache when
necessary with krb5_cc_new_unique.

We should destroy the ccaches we created, to avoid leaks.

The struct KRB_CREDENTIALS is extended to express the ccache ownership.
2023-04-07 11:21:12 +02:00
Rubycat
cec88e53bd don't log an error when running GetCurrentThread from non winpr thread
Since 7c4a774e4e
this can legitimately happen in WaitForMultipleObjectsEx and is not
actually an error.
2023-04-07 11:03:56 +02:00
akallabeth
1a951a7ebc [core,credssp] simplified name cache 2023-04-06 16:15:45 +02:00
akallabeth
182f15e475 [core] add logger to rdpContext
Add a dynamic logger for rdpContext
2023-04-06 12:11:46 +02:00
akallabeth
efcacda24c [winpr,sspi] do not abort on empty password
sspi_SetAuthIdentityA might be called with empty passwords, do not abort
under these conditions.
2023-04-06 12:11:46 +02:00
Armin Novak
f66110c611 [codec,rfx] refactor API
* Hide implementation details
* Add missing getter/setter
2023-04-05 20:41:42 +02:00
Armin Novak
a86218c761 [codec,rfx] fix numTile update
ensure there are enough tiles allocated before setting
2023-04-05 20:41:42 +02:00
Armin Novak
2285d912eb [codec,rfx] add more assertions 2023-04-05 20:41:42 +02:00
Armin Novak
fcf3d0517e [codec,rfx] clean up free functions
* automatically set message->freeRects internally
2023-04-05 20:41:42 +02:00
Armin Novak
77f4d96fef [codec,rfx] use dynamic logger 2023-04-05 20:41:42 +02:00
Armin Novak
2bc5ac3638 [codec,rfx] assert arguments 2023-04-05 20:41:42 +02:00
Armin Novak
e94661ef71 [codec,rfx] fix rfx encoding 2023-04-05 20:41:42 +02:00
weoses
eb10a060a5 [android] Add UI setting - "Use back button as Alt-f4" 2023-04-05 15:11:29 +02:00
Armin Novak
9f1bcc07b6 [client,windows] use CredUI flag CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 2023-04-05 11:42:06 +02:00
Armin Novak
1e63d8c493 [utils,passphrase] use CredUI on windows 2023-04-05 11:42:06 +02:00
Armin Novak
659baa905c [utils] fix windows console read
On windows freerdp_interruptible_getc did not work at all. Fix this so
that reading characters works. This still does not hide input for
passwords or is actually interruptible, but at least it reads the data
correctly.
2023-04-05 11:42:06 +02:00
Armin Novak
dc84e93fe5 [utils] fix windows console read
On windows freerdp_interruptible_getc did not work at all. Fix this so
that reading characters works. This still does not hide input for
passwords or is actually interruptible, but at least it reads the data
correctly.
2023-04-05 11:42:06 +02:00
Armin Novak
f4462f69e1 [core,credssp] fix logging with unicode
convert argument to proper type before logging
2023-04-05 11:40:22 +02:00
Armin Novak
2d1c56888d [core,gateway] log win32 error code of fault PDU 2023-04-05 10:02:27 +02:00
Armin Novak
947bc7fe04 [winpr] added Win32ErrorCode2Tag 2023-04-05 10:02:27 +02:00
Armin Novak
14fd94a38c [core,gateway] fix http_request_write
ensure the stream is big enough to hold the data
2023-04-05 08:56:33 +02:00
akallabeth
767818e97e [client,cmdline] fix gateway option parser
Options like /gateway:type:http,no-websockets,port:1234 were not
properly parsed. The `type:http,no-websockets` must be considered as
separate options with weak dependency.
Thanks to @akarl10 for pointing out this problem.
2023-04-04 09:06:05 +02:00