Commit Graph

1472 Commits

Author SHA1 Message Date
Pavel Tsekov
c51c5df2ff * include/freerdp/codec/color.h:
(freerdp_color_convert_drawing_order_color_to_gdi_color): Declare new
function.
* libfreerdp/codec/color.c:
(freerdp_color_convert_drawing_order_color_to_gdi_color): Implement.
(freerdp_image_convert_8bpp): Properly use the ARGB32/ABGR32/RGB32/BGR32
macros when converting 8bpp data to 32bpp.
(freerdp_image_convert_32bpp): Fix CLRCONV_ALPHA and CLRCONV_INVERT
processing for 32bpp destination.
(freerdp_mono_image_convert): Use ARGB32/ABGR32 when converting to 32bpp
and CLRCONV_ALPHA is set.
* libfreerdp/core/orders.c: Color data from drawing orders is
interpreted in big endian mode.
* libfreerdp/core/update.c (update_read_palette): Likewise.
* libfreerdp/gdi/16bpp.c (gdi_get_color_16bpp): GDI colors are stored as
RGB now.
* libfreerdp/gdi/32bpp.c (gdi_get_color_32bpp): Likewise.
* libfreerdp/gdi/gdi.c:
Use freerdp_color_convert_drawing_order_color_to_gdi_color() to convert
from drawing order color representation to GDI color representation
troughout.
* libfreerdp/gdi/graphics.c (gdi_Glyph_BeginDraw): Likewise.
(gdi_Glyph_EndDraw): Likewise.
2014-08-07 00:58:58 +03:00
U-PAVEL\Pavel Tsekov
8a4f134fab Revert to 15d2b35574 2014-08-05 14:35:31 +03:00
Pavel Tsekov
8c3080f345 Fix 1bpp to 32bpp conversion with CLRCONV_ALPHA on
* libfreerdp/codec/color.c (freerdp_mono_image_convert): Use
ARGB32/ABGR32 when
using 32bpp framebuffer and CLRCONV_ALPHA is set.
2014-07-29 11:19:25 +03:00
Marc-André Moreau
15d2b35574 Merge pull request #1982 from bmiklautz/feat/read_pdu
Transport re-factor and clean up
2014-07-28 16:32:06 -04:00
Norbert Federa
cdcdec99bc OpenSSL thread safety
freerdp/winpr had the following issues:
* The non reentrant SSL_library_init() was called concurrently (crash)
* Missing code/api to set the eventually required OpenSSL static and dynamic locking callbacks
* Missing code/api to free the application-global or thread-local OpenSSL data and tables

This commit creates two new winpr functions:

BOOL winpr_InitializeSSL(DWORD flags):

Use the flag WINPR_SSL_INIT_ALREADY_INITIALIZED if you want to tell winpr that
your application has already initialized OpenSSL.
If required use the flag WINPR_SSL_INIT_ENABLE_LOCKING to tell winpr that it
should set the OpenSSL static and dynamic locking callbacks.
Otherwise just call it with the flag WINPR_SSL_INIT_DEFAULT.

The recommended way is that your application calls this function once before
any threads are created. However, in order to support lazy OpenSSL library
initialization winpr_InitializeSSL() can also safely be called multiple times
and concurrently because it uses the new InitOnceExecuteOnce() function to
guarantee that the initialization is only performed successfully once during
the life time of the calling process.

BOOL winpr_CleanupSSL(DWORD flags):

If you create a thread that uses SSL you should call this function before the
thread returns using the flag WINPR_SSL_CLEANUP_THREAD in order to clean up
the thread-local OpenSSL data and tables.
Call the function with the flag WINPR_SSL_CLEANUP_GLOBAL before terminating
your application.

Note: This commit only replaced the current occurences of the
SSL_load_error_strings(); SSL_library_init(); pairs in the freerdp source
with winpr_InitializeSSL(). None of the server or client applications has been
changed according to the recommended usage described above (TBDL).
2014-07-28 21:55:57 +02:00
Bernhard Miklautz
b17045ddd8 fix: typos and formating 2014-07-28 13:12:01 +02:00
Bernhard Miklautz
bdad9524dc refactor transport_read_pdu and check_fds
transport_check_fds and transport_read_pdu had almost the same
functionality: reading and validating one pdu at a time.

Now transport_read_pdu reads one pdu from the transport layer and verifies
that the pdu data is valid - as before.
transport_read_pdu also ensures that the stream is sealed and
rewound when the pdu is received completely.
transport_check_fds just uses transport_read_pdu and does *not* do
the verification a second time based on the stream.

Besides the clean up this fixes the following problems:

* transport_read always read 4 bytes. Fast-path input synchronize pdus
  are only 3 bytes long. In this case on byte got lost in the stream
	buffer which lead to "de-synchronization" of server and
	client.

* Size check in tpdu_read_connection_confirm - already read bytes
  weren't taken into account.
2014-07-24 16:34:59 +02:00
Bernhard Miklautz
47dd22ba87 transport refactor
rename transport_read to transport_read_pdu. This name is more
descriptive what the function actually does.
2014-07-24 16:34:59 +02:00
Bernhard Miklautz
2bb0659fb4 core: improve fast-path multifragment handling
* make sure fast-path packages are not fragmented if no
  multifragment support was announced
* handle special server side case where the multifragment size
  received from the client is smaller than one maximum fast-path
  PDU size
2014-07-24 16:29:46 +02:00
Daniel Bungert
625f7c3c22 Add arguments for managing tls ciphers & netmon
This adds 2 arguments:
    /tls-ciphers                List of permitted openssl ciphers - see ciphers(1)
    /tls-ciphers-netmon         Use tls ciphers that netmon can parse

With KB2919355, client/server negotiate the use of
TLS cipher TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
which works fine except that netmon can't parse it.
By adding commandline /tls-ciphers-netmon, we restrict
the available ciphers to a list that netmon can
deal with.  Also adds /tls-ciphers, which
accepts a string arg, for further customization.
2014-07-17 06:59:06 -06:00
Norbert Federa
8482eed323 core: addd missing PlaySound server callback 2014-07-16 15:38:10 +02:00
Vic Lee
8df60ecbe4 tls: fix some error handling. 2014-07-15 11:36:35 +08:00
Vic Lee
29cb8680ce server: allow partial channel read (fix rdpsnd). 2014-07-14 20:00:38 +08:00
Marc-André Moreau
4d3ea77972 Merge pull request #1917 from SBoyNumber1/BitmapCacheV3OnAndroid
Added detect of uncompressed data in CACHE_BITMAP_REV3_ORDER. According ...
2014-07-11 16:35:11 -04:00
Marc-André Moreau
61b35e2e8f Merge pull request #1948 from jbd1986/fix-french-canadian
I am making several changes to clean up French Canadian keyboard defs.
2014-07-11 16:34:43 -04:00
Bernhard Miklautz
c99d4648ff Merge pull request #1950 from hardening/kill_select
kill the last remaining select() in libfreerdp
2014-07-11 16:41:31 +02:00
Bernhard Miklautz
39d78ba707 Merge pull request #1954 from nfedera/fix-2014-07-10-01
transport_read: ensure stream buf size >= pdu size
2014-07-11 15:08:10 +02:00
Armin Novak
ad3255354d Added WITH_LIBRARY_VERSIONING, allowing to build shared libraries without
SOVERSION information. (required by Android)
2014-07-11 11:53:58 +02:00
Hardening
3fce288c66 Fix unclean SSL disconnection
This patch prevent an infinite loop when the remote peer disconnect
the socket without cleanly closing the SSL connection.
2014-07-10 23:35:11 +02:00
Norbert Federa
c206a35c12 transport_read: ensure stream buf size >= pdu size
Without this check a simple nc < /dev/urandom server:3389 could
kill the server instantly.
2014-07-10 12:09:48 +02:00
Bernhard Miklautz
6a49bcfe40 winpr: always build "monolitic"
winpr is now always build as single library.
The build option MONOLITHIC_BUILD doesn't influence this behavior anymore.

The only exception is winpr-makecert-tool which is still build as extra
library.

This obsoletes complex_libraries for winpr.
2014-07-10 11:10:58 +02:00
Hardening
6223460557 kill the last remaining select() in libfreerdp 2014-07-09 11:28:41 +02:00
Justin DeFields
00b01f1b4e I am making several changes to cleanup French Canadian, with the end result being: ca,fr -> Canadian French ca,fr-legacy -> Canadian English ca,eng -> Canadian English. Currently ca,fr isn't defined, ca,fr-legacy thinks it's Canadian French and it isn't anyway because the value is wrong for that definition, and ca,eng is US. 2014-07-08 16:51:50 -04:00
Marc-André Moreau
ee8c0906f0 libfreerdp-codec: fix strict aliasing warnings in ncrush code 2014-07-08 15:59:23 -04:00
Marc-André Moreau
c492017fa1 libfreerdp-codec: fix build bot warnings 2014-07-08 15:48:29 -04:00
Marc-André Moreau
ac7d23b9a3 libfreerdp-gdi: migrate to _aligned_malloc/_aligned_free 2014-07-08 15:07:19 -04:00
Marc-André Moreau
c16000e67b Merge branch 'master' of github.com:FreeRDP/FreeRDP into egfx 2014-07-08 12:29:30 -04:00
Marc-André Moreau
1a32c2e33e Merge branch 'egfx' of github.com:vworkspace/FreeRDP into egfx 2014-07-08 12:20:30 -04:00
Marc-André Moreau
31b6459484 libfreerdp-codec: don't use posix_memalign 2014-07-08 12:18:41 -04:00
Marc-André Moreau
a0dad3fa87 Merge branch 'master' of https://github.com/dpoe/FreeRDP into egfx 2014-07-08 12:13:11 -04:00
Marc-André Moreau
2f26ed58e5 libfreerdp-codec: reduce ClearCodec memory usage 2014-07-08 11:37:27 -04:00
Bernhard Miklautz
199d53bb00 Merge pull request #1942 from hardening/kill_select
Use poll() instead of select() when available
2014-07-08 16:36:04 +02:00
Marc-André Moreau
465ecb02a1 libfreerdp-codec: fix ClearCodec short vbar cache hit 2014-07-07 16:50:19 -04:00
Marc-André Moreau
44edb3025f libfreerdp-codec: improve ClearCodec error checking 2014-07-07 15:48:56 -04:00
Marc-André Moreau
7489675ab9 libfreerdp-codec: fix ClearCodec RLEX decoding 2014-07-07 14:16:05 -04:00
Marc-André Moreau
9474784070 libfreerdp-codec: ClearCodec fix error codes and wrapping around of cursors 2014-07-07 12:17:37 -04:00
Hardening
fd7b8170dc Fix invalid timeout
timeout was set to 1000ms while in the old code it was 1000us. As 1ms
seems too small set it to 10ms.
2014-07-07 10:44:57 +02:00
Marc-André Moreau
0ed7d3e6be libfreerdp-codec: fix some ClearCodec flag checking 2014-07-05 16:29:28 -04:00
Marc-André Moreau
cd78e87525 Merge branch 'egfx' of github.com:vworkspace/FreeRDP into egfx 2014-07-05 15:35:37 -04:00
Mike McDonald
bcec880d29 Merge branch 'egfx' of https://github.com/awakecoding/FreeRDP into egfx 2014-07-05 06:52:27 -04:00
Mike McDonald
a539e8c20e Updated coefficients for YUV to RGB conversion to match Microsoft, updated clip function, and added an initial implementation for upconverting 4:2:0 to 4:4:4. 2014-07-05 06:51:57 -04:00
Hardening
bf53f044bd Fix missing include 2014-07-04 15:18:50 +02:00
Mike McDonald
07351ddff4 Fixed issue with last merge. 2014-07-04 03:52:05 -04:00
Mike McDonald
0ddd52a7db Merged branch 'egfx' of github.com:awakecoding/FreeRDP into egfx 2014-07-04 03:16:55 -04:00
Mike McDonald
0a13972c7d Added #ifdef WITH_OPENH264 ... #endif to appropriate places in the code. 2014-07-04 03:06:50 -04:00
Marc-André Moreau
92d143ad40 libfreerdp-codec: handle long vbar length mismatch 2014-07-03 16:09:53 -04:00
Marc-André Moreau
5c5386fe04 channels/rdpgfx: add egfx command line options and settings 2014-07-03 14:35:03 -04:00
Marc-André Moreau
bde954107d Merge branch 'egfx' of github.com:vworkspace/FreeRDP into egfx
Conflicts:
	client/X11/xf_gfx.c
2014-07-03 12:03:39 -04:00
Hardening
7238bedd26 Link utils against winsocks 2014-07-03 17:53:02 +02:00
Marc-André Moreau
2f5011a438 libfreerdp-codec: reduce number of variables 2014-07-03 11:49:06 -04:00