Commit Graph

4279 Commits

Author SHA1 Message Date
akallabeth
b3a4b71717 Added RAIL compartmentinfo server to client message
(cherry picked from commit ad6dd99190)
2022-06-29 14:42:22 +02:00
Adrian Perez de Castro
436f212be3 Fix building with LibreSSL 2.7.0 or newer
With LibreSSL 2.7.0 (or newer versions) some more structs have made
opaque, which requires a few changes:

- BIO_meth_new() and related functions are now defined by LibreSSL, the
  versions from opensslcompat.{h,c} does not need to be used anymore.
- HMAC_CTX is now opaque, HMAC_CTX_new(), EVP_MD_CTX_new, and related
  functions should be used instead in winpr's hash.c.
2022-06-27 13:42:29 +02:00
Richard Dymond
a7664ea88a Add WTSChannelGetOptions 2022-06-08 16:52:58 +02:00
Pascal Nowack
6826d3626a core/server: Add APIs to get notified of DVC creation statuses
This allows server implementations to add handling for situations,
where the client side does not support them.
Particularly useful for the audio output channels (static channel as
fallback, when dynamic channel is not supported).
2022-06-08 16:19:31 +02:00
kubistika
601d01f7b4 core: server: add API to get peer accepted channel names
(cherry picked from commit 508ba9201f)
2022-06-03 08:06:53 +02:00
akallabeth
c5672a992a Unified neon source options
(cherry picked from commit bfdbe18029)
2022-05-04 09:41:01 +02:00
akallabeth
f1bf99f075 Only build RFX neon path with -DWITH_NEON=ON
(cherry picked from commit d18187c949)
2022-05-04 09:41:01 +02:00
Armin Novak
50bc2d59e8 Fixed #7158: detection of arm neon.
(cherry picked from commit 6e075a6a7d)
2022-04-28 08:02:01 +02:00
Armin Novak
fb50329a9d Fixed #7837: Overallocate zgfx output buffers
Some decoders require additional byte alignment to prevent out
of bound reads

(cherry picked from commit ce60606e19)
2022-04-27 18:45:36 +02:00
akarl
97957fcde0 Implement BIO_CTRL_GET_KTLS_SEND and BIO_CTRL_GET_KTLS_SEND
Openssl 3.0 requires to respond to this controls. According to there
documentation it should not need them, but in practice openssl's own source
is full of places where negative return values are not checked.

(cherry picked from commit 9d7c20ce8f)
2022-04-25 09:19:45 +02:00
akallabeth
9ab0667b54 Fix #7785: Missed GatewayHttpUseWebsockets initialization
In backport #6877 this was missed.
2022-04-07 12:25:24 +02:00
Armin Novak
a923f59c20 Fixed #7745: Progressive surface cleanup
(cherry picked from commit edcb8284e7)
2022-04-06 11:02:18 +02:00
Armin Novak
061edc109f Fixed backport compile problems 2022-04-06 10:22:06 +02:00
Armin Novak
c6bd48f926 Use GetComputerName instead of gethostname
(cherry picked from commit 82165d95a9)
2022-04-06 10:22:06 +02:00
Armin Novak
2008751c04 Replaced WINPR_ASSERT defines, use include 2022-03-28 12:08:51 +02:00
Armin Novak
6462eca724 Workaround for [MS-RDPBCGR] 2.2.9.2.3 Frame Marker Command (TS_FRAME_MARKER)
Connections with  windows 2016 and 2019 sometimes receive short
frame marker. Ignore these to prevent disconnects

(cherry picked from commit 91ef44ed35)
2022-03-09 16:19:34 +01:00
Armin Novak
79207e6700 rfx_process_message verbose error log
(cherry picked from commit c194a68b1b)
2022-03-08 15:35:54 +01:00
Armin Novak
631e71bebd Added more log messages for SurfaceCommand failures
(cherry picked from commit c6f2040912)
2022-03-08 15:35:54 +01:00
Armin Novak
1e9485e4d9 Fixed #7696: Abort freerdp_connect if manually canceled
If freerdp_abort_connect is called, set FREERDP_ERROR_CONNECT_CANCELLED
This way freerdp_reconnect can distinguish between network issues and
user interaction and abort a retry attempt.

(cherry picked from commit a6b42ff6c9)
2022-03-07 15:24:08 +01:00
akallabeth
de805f8565 Decreased logging verbosity for INFO level
(cherry picked from commit e6b0373859)
2022-03-03 10:52:00 +01:00
akallabeth
b076803219 Added openH264 decoder frame flush
(cherry picked from commit 366ad75bb4)
2022-02-28 08:51:58 +01:00
Hiroshi Ota
e480e97ea0 Fix missing KBD_JAPANESE condition
(cherry picked from commit 18e8a67f75)
2022-02-14 09:21:41 +00:00
akallabeth
9299d2fce1
Fix #7586: Update size of tile cache if required. (#7603)
(cherry picked from commit e0660ba694)
2022-01-28 09:07:35 +01:00
Armin Novak
3dfe3e8b57 Fixed too eager assert.
(cherry picked from commit 2ed5a6912b)
2022-01-26 12:38:11 +01:00
Armin Novak
4b73d86880 Removed x264 related files from build 2022-01-26 12:10:47 +01:00
Armin Novak
f41a4656d8 Added missing include
(cherry picked from commit 4867dea562)
2022-01-26 10:48:26 +01:00
Armin Novak
4744643dc1 Fixed statement expressions and missing goto
(cherry picked from commit adcec5d928)
2022-01-26 10:48:26 +01:00
Armin Novak
4101fe3be7 Added code assertions, fixed loading order
(cherry picked from commit 92d56b77f5)
2022-01-26 10:48:26 +01:00
Ely Ronnen
7cc9a10e8e handling small input buffer case
(cherry picked from commit 5c2916aa59)
2022-01-26 10:48:26 +01:00
Ely Ronnen
27a955a780 import libmediandk.so dynamically
(cherry picked from commit 5fbaeea425)
2022-01-26 10:48:26 +01:00
Ely Ronnen
8adbb187be adding mediacodec h264 implementation using NDK
(cherry picked from commit afe6cc10bd)
2022-01-26 10:48:26 +01:00
David Runge
95b0759feb Guard avcodec_register_all() calls
{channels/tsmf/client/ffmpeg/tsmf,libfreerdp/codec/dsp}_ffmpeg.c:
Guard calls to `avcodec_register_all()` against use beyond
`AV_VERSION_INT(58, 10, 100)`, where upstream ffmpeg made it obsolete.

(cherry picked from commit 811d94c742)
2022-01-25 09:15:19 +01:00
Armin Novak
a87c2a28fe Fixed missing ffmpeg deprecation guard
(cherry picked from commit 3303a2feaf)
2022-01-24 11:56:47 +01:00
Armin Novak
bbeb3e08eb Added adjustable tcp connect timeout
(cherry picked from commit 2a91afb0cf)
2022-01-10 12:05:36 +01:00
akallabeth
bdcc13f96f Fixed size checks for locale detection.
Reported by George Zaytsev from Positive Technologies

(cherry picked from commit 8d5127cf06d57774a45f421afd551a39b849aedb)
2022-01-10 11:12:39 +01:00
Martin Fleisz
e4e3456e68 locale: Fix keyboard detection on MacOS
(cherry picked from commit 68dfa353b8)
2022-01-10 11:04:58 +01:00
Steve Pronovost
6b8558f3fa Fix protocol violation when uploading large ICON
When uploading large ICON (96x96), we end up growing the stream
mid-update. Stream_EnsureCapacity end up reallocating the stream
with a larger capacity to accomodate the large ICON size, but in
doing so, also updating the sealed length for the data currently in
the stream. This breaks the assumption between update_begin_paint
and update_end_paint where the sealed lenght is used to keep track
of the location where we need to update the orders counts after
we're done accumulating update. As a result of the growth and lost
of that location, the number of orders is written to the wrong
location and the resulting stream is invalid which result in a
protocol violation and a connection drop.

The current fix uses a new offsetOrder in the update object to
keep track of where update_end_paint needs to write the number
of orders contained. I think a better fix would be for
Stream_EnsureCapacity to preserve the sealead length of the
stream on growth, but this has a much more significant impact and
careful analysis needs to be done to ensure this doesn't violate
other assumption. Need to follow up with FreeRDP developer to get
their take on this one.
2021-12-17 11:47:45 +01:00
akallabeth
c54c846b59 Added stack trace on signal.
(cherry picked from commit cf49e4bfa8)
2021-11-29 07:50:02 +01:00
Theo Buehler
bfbef39759 Fix build for upcoming LibreSSL version
SSL will become opaque in LibreSSL 3.4.x, hence the code reaching inside
it will result in build breakage. This was done at the time for lack of
BIO_up_ref() support, which has been available since LibreSSL 2.7.0, so
adjust the relevant #ifdefs accordingly.

(cherry picked from commit ad0b6c377d)
2021-11-17 10:09:16 +01:00
akallabeth
4034026072 Fixed #7436: Datatype mismatch 2021-11-12 17:03:23 +01:00
akallabeth
2ddb22f7a4 Fixed #7436: Datatype mismatch to crypto_base64_decode 2021-11-12 12:12:04 +01:00
akallabeth
101fe1d877 Ignore redirection password in case of smartcard auth
(cherry picked from commit 11d1c0308b)
2021-11-05 14:57:11 +01:00
akallabeth
d39a7ba5c3
Stable 2.0 backports (#7366)
* Fixed typo in changelog

* Fix FIPS mode support and build with OpenSSL 3.0

FreeRDP fails to build with OpenSSL 3.0 because of usage of the `FIPS_mode`
and `FIPS_mode_set` functions, which were removed there. Just a note that
the FIPS mode is not supported by OpenSSL 1.1.* although the mentioned
functions are still there (see https://wiki.openssl.org/index.php/FIPS_modules).
Let's make FreeRDP build with OpenSSL 3.0 and fix the FIPS mode support.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1952937
(cherry picked from commit 26bf2816c3)

* winpr: avoid calling FIPS_mode() with OpenSSL 3.0

Fixes: 26bf2816c3
(cherry picked from commit 0c81c73c8d)

* winpr/crypto: Load legacy provider to fix rc4 with OpenSSL 3.0 (#7210)

* winpr/crypto: Exit cleanly when EVP_EncryptInit_ex fails

The `EVP_EncryptInit_ex` function may fail in certain configurations.
Consequently, FreeRDP segfaults in `EVP_CIPHER_CTX_set_key_length`.
Let's handle the `EVP_EncryptInit_ex` failures and exit cleanly in
such case.

* winpr/crypto: Load legacy provider to fix rc4 with OpenSSL 3.0

Currently, the `EVP_EncryptInit_ex` function fails for rc4 with OpenSSL 3.0.
This is becuase rc4 is provided by the legacy provider which is not loaded
by default. Let's explicitly load the legacy provider to make FreeRDP work
with OpenSSL 3.0.

Relates: https://github.com/openssl/openssl/issues/14392
Fixes: https://github.com/FreeRDP/FreeRDP/issues/6604
(cherry picked from commit 67f3fff2c8)

Conflicts:
	winpr/libwinpr/crypto/cipher.c

* Fix TestUnicodeConversion on big endian machines (#7219)

Wide character literals are stored in native byte order.
Use an array of bytes as a reference instead.

Fixes: https://github.com/FreeRDP/FreeRDP/issues/6968
(cherry picked from commit 5208a67ea7)

* Fixed async-input quit

* Fix data write on usb channel

* Bitmap update fix (#7349)

* Added checks for bitmap width and heigth values

Data received from the server might have invalid values for bitmap
with or height. Abort parsing if such a value is found.
Reported by Sunglin from the Knownsec 404 team & 0103 sec team

* Added checks for glyph width & height

* Fixed #7363: Length checks in ConvertUTF8toUTF16

(cherry picked from commit 623a77258a)

* Implemented missing TSG debug functions

(cherry picked from commit c06c463806)

* Refactored RPC gateway parser

Utilize wStream instead of custom binary parsing code, add proper
input validation.
Reported by Sunglin from the Knownsec 404 team & 0103 sec team

(cherry picked from commit f0b44da67c)

* Replaced chmod with safer fchmod

* Use fchmod so the file may not change underneath
* Add unit tests for SetFileAttributesA
* Add warning logs for unsupported flags

(cherry picked from commit c8571dd5fd)

* Updated changelog and version

* Added more explicit warning for deprecated command line

* Add exit codes for more errors

(cherry picked from commit aa4c3dfb8a)

* Updated changelog.

Co-authored-by: Ondrej Holy <oholy@redhat.com>
Co-authored-by: Mike Gilbert <floppym@gentoo.org>
Co-authored-by: Ondrej Holy <ondrejholy@users.noreply.github.com>
Co-authored-by: Ian Weir <mr.weir@me.com>
2021-10-21 08:30:50 +02:00
akallabeth
537a877627 Replace fopen and path functions with wrappers (#7043)
Functions like fopen, PathFileExists, PathMakePath need to call
the wide character versions on windows for utf-8 support.

(cherry picked from commit 6b36c6d417)
2021-07-27 11:57:33 +02:00
Armin Novak
c311a1c695 Fixed issues with planar codec buffer alignment
Align width and height to next multiple of 4 to avoid issues with
internal buffer sizes.

(cherry picked from commit c2049673be)
2021-06-02 13:44:47 +02:00
akallabeth
3c908de5a4 Added rdg_read_http_unicode_string error messages
Added log entries in case something in the packet is wrong

(cherry picked from commit 7c2855b4a8)
2021-05-25 15:30:50 +02:00
Pascal Nowack
6bd82d4efa codec/progressive: Allow the usage of multithreading for decoding
While decoding RemoteFX encoded frames is multithreaded, decoding
RemoteFX Progressive frames is not, although both codecs work
relatively similarly.
This is especially noticeable with frames, that have a resolution
larger than 1920x1080 pixels.

decompress_tile_first() and decompress_tile_upgrade() can both run in
different threads at the same time for different tiles without necessary
adjustments.

So, do exactly that using the ThreadPool that already exists in the
RFX_CONTEXT to decrease the decoding time and therefore increase the
performance.
On a 3K display (2880x1620 pixels) this makes out of a choppy
experience a fluid experience.

(cherry picked from commit e79fefe21c)
2021-05-25 15:30:50 +02:00
Pascal Nowack
228243b333 codec/progressive: Fix a memory leak
When checking whether tiles and updatedTileIndices are both non-NULL,
one of them might be NULL, while the other struct member might not
be NULL and progressive_surface_context_new() leaks then the non-NULL
struct member.

Fix this by freeing both struct members, when aborting in
progressive_surface_context_new().
free() will take no action on pointers that are NULL, so no additional
check is needed.

(cherry picked from commit 805dc60e14)
2021-05-25 15:30:50 +02:00
akallabeth
bca70a89e4 Fixed #6989: Use X509_STORE_set_default_paths
(cherry picked from commit b528ecde4f)
2021-05-25 15:30:50 +02:00
akallabeth
3c52a4e0d9 Removed duplicated escape
(cherry picked from commit 187946e965)
2021-05-25 15:30:50 +02:00