Commit Graph

10058 Commits

Author SHA1 Message Date
Norbert Federa
42d2b69de3 Merge pull request #3379 from nfedera/fix-winpr-wtsapi
winpr/wtsapi: fixed race conditions and tests
2016-05-31 09:41:09 +02:00
akallabeth
345478bd8e Merge pull request #3376 from realjiangms/fix_client_gfx
channels/rdpgfx: Fix for gfx client
2016-05-31 09:37:31 +02:00
Bernhard Miklautz
9daf129c63 Merge pull request #3371 from realjiangms/fix_x11_shadow_race
Server/shadow: Protect X operations on shared subystem X11 display with X11 display lock
2016-05-30 19:25:20 +02:00
Norbert Federa
c6aeba6a67 winpr/wtsapi: fixed race conditions and tests 2016-05-30 17:54:59 +02:00
MartinHaimberger
69f738f4bc Merge pull request #3377 from nfedera/fix-channel-name-parsing
freerdp/core/gcc: channel name hardening
2016-05-30 14:59:34 +02:00
Norbert Federa
7a42a8dd5b freerdp/core/gcc: channel name hardening
According to [MS-RDPBCGR 2.2.1.3.4.1 Channel Definition Structure]
the channel name must be an 8-byte array containing a null-terminated
collection of seven ANSI characters that uniquely identify the channel.

We did not check if the transmitted name was null-terminated which
could have the usual severe effects on stabiliy and security since
the channel name is used in several functions expecting a null-
terminated string (strlen, printf, etc.)
2016-05-30 14:40:23 +02:00
Ondrej Holy
0e353cce2e winpr/ntlm: Fix endianness in NTLM authentication
This patch fixes NTLM authentication to work properly on a big endian
machines. Freerdp exited with the following error without recent commits:
[09:50:20:914] [13821:13822] [ERROR][com.freerdp.core.transport] - BIO_read returned an error: error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
[09:50:20:914] [13821:13822] [ERROR][com.freerdp.core] - freerdp_set_last_error ERRCONNECT_CONNECT_TRANSPORT_FAILED [0x2000D]
[09:50:20:914] [13821:13822] [ERROR][com.freerdp.client.x11] - Freerdp connect error exit status 1

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
95a1b53940 winpr/ntlm: Fix endianness in ntlm_av_pair_list
Data in ntlm_av_pair_list are accessed directly, which doesn't work on
big endian machines currently. The recieved data are stored as little
endian. Use conversion macros from endian.h to load and store the data
properly.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
8d468ea6b5 winpr/crt: Fix endianness in WCHAR case conversions
All WCHAR strings are stored as little endian after commit 12dfc5e9,
therefor CharUpperBuffW and CharLowerBuffW have to be changed appropriately
in order to fix NTLM authentication.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
f722dc5c28 winpr/crt: Fix endianness in unicode conversions
Unicode conversions doesn't work on big endian machines currently.
The strings are stored as little endian. Use conversion macros from
endian.h to load and store the data properly.

Let's use wide char strings always as little endian. It seems that
Windows API also always expects data to be little endian, so it
makes sense to require wide char strings as little endian also.

The patches fixes transformations between UTF8 and UTF16 only, which are
used by freerdp. UTF32 transformations are not used by freerdp.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
e326e43e66 codec/xcrush: Fix endianness in compression
Compression doesn't work on big endian machines currently. The recieved
data are stored as little endian. Use conversion macros from endian.h to
load and store the data properly.

The patch fixes following error (so -compression option is no more needed
on big endian machines):
[06:42:14:782] [13772:13773] [ERROR][com.freerdp.core] - Decompression failure!
[06:42:14:782] [13772:13773] [ERROR][com.freerdp.core.fastpath] - bulk_decompress() failed
[06:42:14:782] [13772:13773] [ERROR][com.freerdp.core.fastpath] - fastpath_recv_update_data() fail
[06:42:14:782] [13772:13773] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
250998efb8 winpr: Be sure data points to BYTE in endian.h
The conversion macros don't work properly if input data doesn't point
to BYTE. Cast the input data to BYTE to avoid unexpected behavior and
to simplify usage of the macros.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
11221e7e2c winpr: Fix Data_Read_UINT16
There is a bug which causes that higher byte and lower byte contain
first byte of data and second byte of data is lost. The patch fixes
it similarly as it is done in Stream_Read_UINT16.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
6d2ab9cc47 winpr: Fix 64-bit architecture detection
The current definitions wrongly assume the only 64-bit architecture is
x86_64. Use the __ILP64__, __LP64__ and __LLP64__ to correctly define
the size of a long and of pointer.

The patch is needed for platforms such as ppc64, or s360x, otherwise
you can see following warnings:
warning: cast from pointer to integer of different size

The patch is modification of debian downstream patch:
http://anonscm.debian.org/cgit/collab-maint/freerdp.git/tree/debian/patches/1004_64-bit-architectures.patch

Original author is Aurelien Jarno probably.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Bernhard Miklautz
ca03b510ac Merge pull request #3375 from nfedera/fix-sizet-format-segfaults
fix segfaults casused by size_t format specifier
2016-05-30 13:00:32 +02:00
zihao.jiang
e7d9e91864 channels/rdpgfx: Make freerdp_client_codecs_prepare calls codec reset. It fix broken h264 client from #3328. Also it doesn't make sense that we don't need width and height for codec initialization while we need them for codec reset 2016-05-30 02:00:05 +08:00
Norbert Federa
e8c4910e2e fix segfaults casused by size_t format specifier
win32/msvc cc does not recognize the %z format specifier which caused
invalid references and segfaults on win32.
Until FreeRDP gets format specifier macros we'll cast size_t to
unsigned long and use the %lu specifier.

Also simplified winpr_backtrace_symbols() a little bit and fixed it
to allocate the correct amount of bytes for the return buffer.
2016-05-27 15:55:28 +02:00
Hardening
00dd6f8c51 Merge pull request #3372 from nfedera/fix-winpr-test-library
winpr/library: fix win32 test and some cleanup
2016-05-27 14:53:12 +02:00
Norbert Federa
d2b2a921f1 winpr/library: fix win32 test and some cleanup
On Windows we seem to have to load the TestLibrary[AB] test libraries
from in same folder the test executable runs.

Also removed the empty RemoveDllDirectory, SetDefaultDllDirectories,
AddDllDirectory tests and the redundant FreeLibrary test.

TestLibrary now works and succeeds on Win32.

sadasd
2016-05-27 14:34:41 +02:00
Hardening
9f37f46b66 Merge pull request #3374 from nfedera/fix-winpr-path
winpr/path: fix PathCchFindExtensionA and more
2016-05-27 11:19:50 +02:00
Norbert Federa
a45ac8dad8 winpr/path: fix PathCchFindExtensionA and more
- PathCchFindExtensionA had an off-by-one error when verifying the
  required null termination
- TestPathCchFindExtension used unicode strings when testing the
  *A (ASCII) functions
- The PathAllocCombineW implementation (which is still buggy has
  hell) used strlen to calculate the lenght of unicode strings

TestPath now succeeds on WIN32
2016-05-26 18:36:02 +02:00
Hardening
ef1ddff042 Merge pull request #3373 from nfedera/fix-winpr-test-pipe
winpr/pipe: fix CreateNamedPipe test
2016-05-26 14:07:48 +02:00
Norbert Federa
9370d98575 winpr/pipe: fix CreateNamedPipe test
GetLastError() was not always checked for ERROR_PIPE_CONNECTED which
indicates success if ConnectNamePipe returns FALSE.

TestPipe now also succeeds on Win32
2016-05-26 13:52:30 +02:00
zihao.jiang
42279834bb Server/shadow: Protect X operations on shared subystem X11 display with X11 display lock 2016-05-26 00:20:37 +08:00
Bernhard Miklautz
17c125d986 Merge pull request #3369 from realjiangms/fix_mouseback_2796
Server/shadow: Fix issue 2796. Mouse cursor draw back issue
2016-05-25 17:25:07 +02:00
zihao.jiang
9f4465ebbc Server/shadow: Fix issue 2796. Mouse cursor draw back issue 2016-05-25 23:08:36 +08:00
Bernhard Miklautz
8aec19d116 Merge pull request #3370 from nfedera/fix-winpr-test-thread-createprocess
winpr/thread: fix TestThreadCreateProcess
2016-05-25 16:39:22 +02:00
Norbert Federa
1b231f9dd9 winpr/thread: fix TestThreadCreateProcess
On WIN32 TestThread now works and is expected to succeed
2016-05-25 15:47:58 +02:00
MartinHaimberger
9bfe3a6765 Merge pull request #3365 from nfedera/fix-winpr-synch-tests
winpr/synch: fix tests
2016-05-25 11:08:31 +02:00
Norbert Federa
aded51f38f winpr/synch: fix tests
TestSynchTimerQueue:
- fixed race condition

TestSynchWaitableTimerAPC:
- Use WaitForSingleObjectEx since the thread must be in an alterable state

TestSynch is now expected to succeed on WIN32
2016-05-24 22:33:27 +02:00
akallabeth
53de4b81a6 Merge pull request #3363 from nfedera/fix-mutex-implementation
winpr/synch: fix mutex implementation
2016-05-24 15:41:45 +02:00
Norbert Federa
386d290015 winpr/synch: fix mutex implementation
- Mutex is recursive on Windows; as a consequence we have to use
  the pthread PTHREAD_MUTEX_RECURSIVE type
- Adapt MutexCloseHandle accordingly
- ReleaseMutex returned TRUE even if pthread_mutex_unlock failed
- Fixed and improved the TestSynchMutex ctest
2016-05-24 15:10:57 +02:00
akallabeth
cf127ebfb9 Merge pull request #3357 from realjiangms/fix_rdpsnd_race
shadow/rdpsnd: Fix race condition in rdpsnd channel server.
2016-05-23 16:21:49 +02:00
Martin Fleisz
a722fbf15b Merge pull request #3359 from bmiklautz/eventfd_leak
winpr/event: fix file descriptor leak
2016-05-23 13:38:18 +02:00
akallabeth
21e351582f Merge pull request #3349 from byteboon/master
kerberos authentication fix
2016-05-23 13:22:33 +02:00
Bernhard Miklautz
5d030534db winpr/event: fix file descriptor leak
SetEventFileDescriptor overrides the internal file descriptor of the
event but didn't close it. Now if the descriptor is closed if it isn't
marked as attached.
2016-05-23 13:04:44 +02:00
zihao.jiang
444b678e71 shadow/rdpsnd: Fix race condition in rdpsnd channel server. The output buffer and format parameters are not protected. This cause some data inconsistence if rdpsnd has own thread 2016-05-22 22:13:32 +08:00
Hardening
aeabb95531 Merge pull request #3356 from rinov/master
Update mf_mountain_lion.c
2016-05-19 23:39:49 +02:00
rinov
c42edd9260 Update mf_mountain_lion.c
Remove duplicate return statement in mf_mlion_stop_getting_screen_updates()
This change is no impact anywhere.
2016-05-20 01:17:49 +09:00
Norbert Federa
ca53e8bca1 Merge pull request #3353 from bmiklautz/no_shared_libs
build: fix builds with -DBUILD_SHARED_LIBS=OFF
2016-05-18 17:30:25 +02:00
Bernhard Miklautz
41298d69a9 build: fix builds with -DBUILD_SHARED_LIBS=OFF
When no shared libs are built is required to export all generated
archive files otherwise programs linking against
freerdp-client/freerdp-server might miss symbols.

Fixes #3350
2016-05-18 17:13:45 +02:00
byteboon
158be3a9f0 fixed kerberos authentication
Details: cbSecurityTrailer was assumed to be a fixed length for all signatures, however for Kerberos authentication the signature may generate smaller than this value
2016-05-16 09:53:38 -07:00
Hardening
4e66df7228 Merge pull request #3333 from akallabeth/memleak_fixes
Memleak fixes
2016-05-13 11:32:48 +02:00
Bernhard Miklautz
9e3695fb52 Merge pull request #3340 from rjcorrig/kb3153731
winpr: KB3153731: May 2016 DST update for Azerbaijan, Chile, Haiti and Morocco
2016-05-13 09:41:42 +02:00
Marc-André Moreau
1b97593642 Merge pull request #3341 from awakecoding/xcrush_fix
proper xcrush context reset fix
2016-05-12 14:38:23 -04:00
Marc-André Moreau
a75d89d615 libfreerdp-codec: make proper xcrush context reset fix 2016-05-12 14:24:53 -04:00
Robert Corrigan
73e13b0b29 KB3153731: May 2016 DST update for Azerbaijan, Chile, Haiti and Morocco 2016-05-12 13:24:21 -04:00
Martin Fleisz
eadc9e1297 Merge pull request #3335 from bmiklautz/wfreerdp_naming
wfreerdp: fix name build without client interface
2016-05-12 17:48:40 +02:00
Marc-André Moreau
ed326f6662 Merge pull request #3339 from awakecoding/xcrush_fix
libfreerdp-codec: fix xcrush decompression, revert remote control fix
2016-05-12 09:41:57 -04:00
Marc-André Moreau
892531d492 libfreerdp-codec: fix xcrush decompression, revert remote control fix 2016-05-12 09:22:24 -04:00