Commit Graph

2308 Commits

Author SHA1 Message Date
David FORT
85c350f5da Fix for #2657 2015-05-27 15:13:43 +02:00
Marc-André Moreau
a2e0746f15 Merge pull request #2653 from bmiklautz/lzcnt
winpr: add intrin.h
2015-05-27 09:00:22 -04:00
Bernhard Miklautz
f9c7e03044 winpr: add intrin.h
Exposing lzcnt in crt.h might causes compiler errors (redefinition) with
recent versions of gcc (>=4.9) when winpr is included in other projects.
As lzcnt isn't part of crt according to MSDN and also shouldn't be
exported by default it was moved to intrin.h.

The related test was also moved to the top level directory of winpr.
2015-05-26 16:41:29 +02:00
Mariusz Zaborski
951dbd88de In c file the name is channelId. 2015-05-26 16:12:41 +02:00
Hardening
58b1995619 Merge pull request #2654 from oshogbo/typos
Typo
2015-05-26 16:10:41 +02:00
Marc-André Moreau
36cb1e6dc9 Merge pull request #2639 from awakecoding/master
WLog, server-side rdpdr, remote assistance, byteswap, etc
2015-05-22 14:30:11 -04:00
Marc-André Moreau
35e26020aa freerdp: patch multiple leaks and OOM errors 2015-05-22 14:14:57 -04:00
Bernhard Miklautz
7a1485a2e4 Merge pull request #2638 from kwitaszczyk/master
Assign peer to settings when a new RDP module is being initialized.
2015-05-22 13:36:00 +02:00
Marc-André Moreau
5526348079 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-05-21 13:29:59 -04:00
Konrad Witaszczyk
8797eef9b9 Assign peer to settings when a new RDP module is being initialized. 2015-05-21 16:54:19 +02:00
Bernhard Miklautz
e6891b7a78 Merge pull request #2637 from nfedera/fix-shadow_client_context_cleanup
shadow/client context cleanup and unused vars fix
2015-05-21 16:21:09 +02:00
Marc-André Moreau
b9c1cddc2e Merge pull request #2583 from bceverly/OpenBSD-cleanup
Two minor source code changes to remove warnings
2015-05-21 10:17:54 -04:00
Norbert Federa
535a4352a7 shadow/client context cleanup and unused vars fix 2015-05-21 16:05:05 +02:00
Norbert Federa
cd0a8e0506 Merge pull request #2630 from hardening/new_2616
Add checks for some XXX_New and XXX_Add functions
2015-05-21 16:04:26 +02:00
Hardening
58602c7d2e Merge pull request #2632 from akallabeth/client_bandwidth_measurement_callback
Added client bandwidth measurement result callback.
2015-05-20 21:19:20 +02:00
David FORT
29d372480a Take in account nfedera's review 2015-05-20 19:19:50 +02:00
Marc-André Moreau
7e1dbd505b Merge branch 'awakecoding' of https://github.com/vworkspace/FreeRDP
Conflicts:
	channels/rdpdr/server/rdpdr_main.c
2015-05-20 11:40:48 -04:00
Armin Novak
e239c10fb9 Added client bandwidth measurement result callback. 2015-05-20 16:18:55 +02:00
Marc-André Moreau
29d14773c8 Merge branch 'master' of github.com:FreeRDP/FreeRDP
Conflicts:
	client/Windows/wf_client.c
	libfreerdp/common/assistance.c
2015-05-20 10:12:24 -04:00
Marc-André Moreau
05bc27e96d Merge pull request #2633 from clivest/progressive_codec_new_surface_fix
Fix rounding error in progressive codec surface new
2015-05-20 09:41:18 -04:00
Clive Stevens
5528b152ec Fix two cases of leaked regions in gdi/gfx 2015-05-20 12:35:24 +01:00
Clive Stevens
63ecb59681 Fix rounding error in progressive codec
The grid is composed of 64x64 blocks and should not be smaller
than the surface. If width or height were not a multiple of 64
the previous rounding resulted in a grid smaller than the surface.
2015-05-20 12:26:58 +01:00
Hardening
f8120919af Add checks for some XXX_New and XXX_Add functions
Based on PR #2616
2015-05-18 11:28:00 +02:00
Norbert Federa
51b697d4c8 transport/mfreerdp: fix async transport
- handle WAIT_TIMEOUT result as error in async transport thread
  if an INFINITE timeout was specified in WaitForMultipleObjects
- fix mfreerdp's async transport handling to not use
  freerdp_get_event_handles/freerdp_check_event_handles if async
  transport is activated
2015-05-14 21:57:16 +02:00
Norbert Federa
35c11c721e gdi: fix nullification of instance->context->cache 2015-05-14 20:33:21 +02:00
Norbert Federa
e99b84ef02 transport: fixed multiple errors in async thread 2015-05-11 21:55:58 +02:00
MartinHaimberger
e3236c2317 Merge pull request #2605 from nfedera/fix-2015-05-08-01
fixed multiple missing gdi return value checks
2015-05-11 16:59:32 +02:00
Norbert Federa
1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Norbert Federa
71a4349928 fixed multiple missing gdi return value checks
mainly gdi_Create* functions
2015-05-08 21:39:23 +02:00
David FORT
acf13da91c Return FALSE under Win32 2015-05-08 10:07:29 +02:00
David FORT
21d9ffcb8f Test the number of listening handles 2015-05-08 10:05:39 +02:00
David FORT
fca4374919 Add the ability to have listener from an existing socket 2015-05-08 10:00:38 +02:00
Marc-André Moreau
30dd40e10a wfreerdp: fix and improve remote assistance 2015-05-07 14:20:49 -04:00
Marc-André Moreau
87bb3aa6e0 wfreerdp: fix build 2015-05-07 13:35:39 -04:00
Hardening
a88adcbb7e Merge pull request #2601 from nfedera/fix-2015-05-07-01
Fix some unchecked create calls
2015-05-07 19:06:59 +02:00
Norbert Federa
509230f6b1 Merge pull request #2598 from clivest/stream_leak_fix
Fix two cases of stream resource leak
2015-05-07 18:24:47 +02:00
David FORT
c330a3715e Fix empty window title
When the size of a RAIL string was 0, we were reporting an OOM error.
2015-05-07 15:08:00 +02:00
Norbert Federa
f9f59cd29b Fix unchecked CreateDirectory calls 2015-05-07 13:28:13 +02:00
Marc-André Moreau
6b1fefea40 freerdp: fix remote assistance mode, add multi-address connection 2015-05-06 16:32:45 -04:00
Clive Stevens
2e41c5425b Fix whitespace 2015-05-06 15:54:23 +01:00
Clive Stevens
b06e50479e Fix two cases of potentially leaked streams 2015-05-06 15:23:37 +01:00
Martin Fleisz
063c1bc806 Merge pull request #2592 from nfedera/fix-2015-05-05-01
Fix unchecked CreateThread calls and misc fixes
2015-05-06 10:16:26 +02:00
Bryan Everly
3b44bade4d Removed unnecessary include file. 2015-05-05 12:35:18 -04:00
Bryan Everly
9865854f3c Simplified random byte stream generation code to use SSL RAND_bytes() and also eliminated two more compiler warnings. 2015-05-05 12:33:44 -04:00
Marc-André Moreau
1de81c30a4 Merge pull request #2587 from floppym/armfix
Remove the ARM_FP_ABI option
2015-05-05 10:56:12 -04:00
Norbert Federa
25fc866a58 Fix unchecked CreateThread calls and misc fixes 2015-05-05 13:55:48 +02:00
Bryan Everly
6485e94395 Freed memory buffer that was allocated in previous commit. 2015-05-04 13:14:00 -04:00
Bryan Everly
f7db1aea9a Fixed stream leak in modified code 2015-05-04 09:53:15 -04:00
Bryan Everly
a7e77dfced Fixed unchecked malloc() error 2015-05-02 12:06:18 -04:00
Mike Gilbert
2355b54f85 Remove the ARM_FP_ABI option
It's unclear why this option would be necessary, and it causes problems
when people do not match it to their toolchain and CFLAGS.

To set the float abi, either use a toolchain with an appropriate default
or set the float-abi option in the CFLAGS environment variable.

This should resolve #2586.
2015-05-01 17:35:21 -04:00
Bryan Everly
df9ae5e31b Changed the xf_tsmf.c code to test for zero visible rectangles for all platforms. Modified arc4random() change to actually have a skeletal implementation in winpr for BCryptGenRandom() on all platforms. 2015-04-30 10:12:37 -04:00
Norbert Federa
ef1fd12b15 Fix unchecked CreateEvent calls and misc fixes
1)
Added missing checks for CreateEvent which also required the
following related changes:

- changed freerdp_context_new API to BOOL
- changed freerdp_peer_context_new API to BOOL
- changed pRdpClientNew callback to BOOL
- changed pContextNew callback to BOOL
- changed psPeerAccepted callback to BOOL
- changed psPeerContextNew callback to BOOL

2)
Fixed lots of missing alloc and error checks in the
changed code's neighbourhood.

3)
Check freerdp_client_codecs_prepare result to avoid segfaults
caused by using non-initialized codecs.

4)
Fixed deadlocks in x11 caused by missing xf_unlock_x11() calls
in some error handlers

5)
Some fixes in thread pool:
- DEFAULT_POOL assignment did not match TP_POOL definition
- don't free the pool pointer if it points to the static DEFAULT_POOL
- added error handling and cleanup in InitializeThreadpool
2015-04-29 18:18:39 +02:00
Bryan Everly
6ed90e831e Fixed linker warning about insecure crypto and fixed compiler warning about unsigned being compared to less than zero 2015-04-28 10:50:29 -04:00
Jonathan Kaplan
8dee5dab27 Fix issue when numWindowIds is 0 2015-04-28 00:21:38 -07:00
Bernhard Miklautz
ff11057d49 gdi: fix problem with gdi_SelectObject check(s)
When a hdc is created no initial or default objects are created
therefore can the first call of gdi_SelectObject return NULL.
Because of this checking the return value of  gdi_SelectObject failed
for newly create hdc causing errors (disconnects).

Since all types of HGDIOBJECT are handled and the return value of
gdi_SelectObject isn't used the recently added checks were removed
again.
2015-04-26 22:28:49 +02:00
Norbert Federa
5926bbcf48 codec/rfx: simplification, segfault/malloc fixes
rfx_process_message_sync:
- simplified the check if the header messages got processed

rfx_process_message_tileset:
- ObjectPool_Take result was not checked
- fail if TS_RFX_TILE block type is not CBT_TILE
- CreateThreadpoolWork result was not checked
- post decoding loop code segfaulted in error case

rfx_decoder_tile_new:
- missing malloc check

rfx_message_free:
- segfault protection

rfx_write_message_tileset:
- segfault protection
2015-04-24 17:54:49 +02:00
Norbert Federa
84577b1ca7 codec/rfx: error checking and various fixes
- removed some unneeded null checks for free()
- fixed a memory leak in shadow_client
- removed rfx_compose_message_header from API

Changed the following functions to BOOL, check the result
where they are called and handle failures:
- rfx_compose_message
- rfx_compose_message_header
- rfx_write_tile
- rfx_write_message_tileset
- rfx_write_message_frame_begin
- rfx_write_message_region
- rfx_write_message_frame_end
- rfx_write_message

rfx_process_message:
- check memory allocation failures
- verify protocol-conform order of data messages to prevents memory
  leaks caused by repeated allocations
- verify that header messages were parsed/received before the
  data messages
- treat unknown rlgr mode as error
- fixed/added error handling
- fixed all callers to check/handle result

rfx_encode_message:
- fixed incorrect usage of realloc
- missing malloc check
- missing check of CreateThreadpoolWork
- correct cleanup on failure (threadpool, memory)
- check rfx_encode_message result

rfx_encode_messages:
- check rfx_split_message result
- correct cleanup on failure
- prevent memory leak on failure

rfx_write_message_context:
- fixed invalid channelId value (must be 0xFF for WBT_CONTEXT)

rfx_process_message_codec_versions:
- fixed invalid read size of codec_version (it is 16bit)

rfx_process_message_channels:
- verify protocol conform channelId value

rfx_process_message_region:
- replaced invalid reallocs with malloc
- read and verify regionType and numTileSets from stream

rfx_process_message_tileset:
- check allocation results
- fixed incorrect usages of realloc

setupWorkers:
- fixed incorrect usages of realloc

rfx_split_message:
- removed dead code
- missing malloc check

rfx_compose_message:
- fixed a memory leak
- check/handle rfx_encode_message result
2015-04-23 15:42:21 +02:00
Norbert Federa
af79c30913 Merge pull request #2554 from akallabeth/event_fix
Fix for transport event reset
2015-04-22 11:04:37 +02:00
Hardening
6cd7713e12 Merge pull request #2544 from bmiklautz/boolenization
change return types of callbacks to BOOL
2015-04-22 11:01:27 +02:00
Bernhard Miklautz
159306fc7a Increase API version to 1.2.2 2015-04-22 10:23:25 +02:00
Bryan Everly
8c75127a67 Necessary changes to get latest branch working on OpenBSD 5.6 2015-04-21 14:42:06 -04:00
Bernhard Miklautz
b029e78ae7 Merge pull request #2537 from MartinHaimberger/mh-autodetect-fix
autodetect: debug fixed and level adjusted
2015-04-21 16:52:32 +02:00
Armin Novak
65a4c6e1fc Changed listener callback arguments and return. 2015-04-21 15:57:25 +02:00
Armin Novak
90fa0e3fc6 Fixed handle copy and index. 2015-04-21 15:10:17 +02:00
Bernhard Miklautz
db81151ea4 gdi: fix broken return type checks
Integrates comments from pull request.
2015-04-21 14:18:07 +02:00
Bernhard Miklautz
2c072d33d3 Fix GDI return values and other fixes
* top level GDI functions return 0 on error and != 0 otherwise but the
  low level functions (16bpp.c, 8bpp.c 32bpp.c) which are called did it
	exactly the other way around. Those were adapted.
* change gdi_InvalidateRegion to BOOL and check calls where appropriate
* integrate comments from pull request
2015-04-21 14:18:07 +02:00
Bernhard Miklautz
515502ffa5 change return types of callbacks to BOOL
* change all client/server callbacks to BOOL
* update all clients accordingly
* add multiple return value checks
* small fixes
2015-04-21 14:18:07 +02:00
Armin Novak
d98e485ac0 Fixed some type mismatches. 2015-04-21 12:35:55 +02:00
Armin Novak
d3336340ba Add *get_event_handles handle count, return check. 2015-04-21 12:24:50 +02:00
Armin Novak
6e213bc61b Modified GetEventHandles of listener
Now using nCount as in and out argument.
When called, set nCount to the number of available handles.
This value is checked and an error returned, if not enough
handles are available.
2015-04-21 12:09:44 +02:00
Vic Lee
93d59ac3de h264: change encoder api and add multi-thread support. 2015-04-21 14:02:57 +08:00
Bernhard Miklautz
12e256bb8e Merge pull request #2538 from MartinHaimberger/mh-add-transport-get-bytes
transport: added function to get bytes written
2015-04-20 18:34:13 +02:00
Armin Novak
f634e52289 Using auto reset event now. 2015-04-20 15:04:44 +02:00
Armin Novak
5525d9f88b Fixed uninitialized return value. 2015-04-15 10:38:04 +02:00
Marc-André Moreau
4e1194c53b Merge pull request #2532 from dbungert/4bytestub
GW RPC-HTTP - 2 fixes
2015-04-14 09:23:47 -04:00
Martin Haimberger
5504f4261d autodetect: debug fixed and level adjusted
Fixed two debug statements and moved
to TRACE debug level
2015-04-14 03:54:33 -07:00
Martin Haimberger
9c0d275548 transport: added function to get bytes written
added function to get written bytes on transport.
This is needed to get a more accurate bandwidth
management.
2015-04-14 03:49:01 -07:00
Norbert Federa
951a40b639 Merge pull request #2517 from bmiklautz/alloc
winpr allocation checks
2015-04-14 11:57:33 +02:00
Armin Novak
ea0e255058 Fixed broken pad setting. 2015-04-13 09:28:29 +02:00
Daniel Bungert
0a1273e508 GW RPC-HTTP - Don't drop 4 byte stub from the pipe
* Though not frequent, it's possible to get TsProxySetupReceivePipe
  data of stublength 4 that is actual data.  This happens when
  header->common.call_id == rpc->PipeCallId &&
  !(header->common.pfc_flags & PFC_LAST_FRAG).
  This should address GW disconnects that manifest as SSL read errors.
2015-04-10 15:09:54 -06:00
Daniel Bungert
3910baf49d GW RPC-HTTP login fix
* f469e069dc introduced a logic flip
  that broke RPC-HTTP Gateway.  Fix that.
2015-04-10 14:50:17 -06:00
Bernhard Miklautz
423b15108d Merge pull request #2522 from realjiangms/fix_WriteLock_leak
transport_write sometimes returns directly without cleanup.
2015-04-08 15:39:10 +02:00
zihao.jiang
a057526f1e transport_write sometimes returns directly without cleanup. Fix code path to always do cleanup job. 2015-04-08 21:20:07 +08:00
Bernhard Miklautz
850de59b55 winpr: add checks for *alloc
Add missing checks if memory allocation was successful. Also adapt
caller(s) when possible.
2015-04-08 11:34:37 +02:00
Bernhard Miklautz
879ed36a3c Merge pull request #2513 from hardening/license_and_security_retValues
License and security ret values
2015-04-08 11:33:57 +02:00
David FORT
c03bf75896 Take in account @nfedera's comments 2015-04-07 21:06:53 +02:00
David FORT
c0b191a1c6 Fix a too big Stream_EnsureRemainingCapacity() 2015-04-07 15:19:59 +02:00
David FORT
d84c760f7d Fix a typo in server-side code 2015-04-01 22:26:38 +02:00
David FORT
a4a58aa373 Fix the error case in mcs_send_connect_response() 2015-04-01 17:55:01 +02:00
David FORT
23e11e5a3d Fix code style 2015-04-01 16:58:25 +02:00
David FORT
5302bad2b7 Drop the limit on key size 2015-04-01 15:11:57 +02:00
David FORT
8685a8e0a2 Fixed missing return value 2015-04-01 14:24:37 +02:00
David FORT
9bb4d64608 Correctly handle HMAC_Init_ex() for older versions of OpenSSL 2015-04-01 14:12:08 +02:00
David FORT
edb915943f Treat return values in license.c
This patch changes functions that should not return void and also treat the
callers of these functions.
2015-04-01 11:38:53 +02:00
David FORT
0cf17ef98c Complement gitignore files with new generated files 2015-04-01 11:13:05 +02:00
David FORT
0eb399a717 Treat return values for security.c
This patch make functions in security.c return values when they should instead of
beeing void. And it also fix the callers of these functions.
2015-04-01 11:11:37 +02:00
David FORT
cf8c7631bd Kill more exit() occurences
In general we should not have any exit() call in libfreerdp.
2015-03-31 23:56:40 +02:00
Marc-André Moreau
121ea23595 Merge pull request #2487 from mfleisz/nla_fix
Fix server side NLA
2015-03-31 10:55:04 -04:00
Norbert Federa
89b7eebaf8 Merge pull request #2509 from bmiklautz/security_fixes_v2
NULL dereference fixes
2015-03-31 15:37:16 +02:00
Marc-André Moreau
ad6723835b Merge pull request #2505 from bmiklautz/tls_shutdown
rename and update tls_disconnect
2015-03-31 09:26:30 -04:00
Armin Novak
6b0667c959 Fixed use after free and realloc checks. 2015-03-31 15:18:45 +02:00
David FORT
27c5b5b224 Fix segfault when the xkb layout has no variants
This is a fix for #2399: when there's no variants we should not try to scan them.
I have set the RDP US keyboard for the South African layout, if someone has a better
layout...
Note: we should probably set something that is not zero for other layouts
2015-03-30 21:16:18 +02:00
Hardening
bdb975afe8 Merge pull request #2510 from akallabeth/build_date
Added version and build info functions
2015-03-30 19:14:59 +02:00
Bernhard Miklautz
79de8168f9 Integrate feedback from pull request
* orders.c: remove ; at eol
* rdpdr_main.c: simplify error case
* rdpsnd_pulse.c: fix incorrect check
* rdpsnd_main.c: adapt return value according to documentation
* update.c: fix incorrect return values
2015-03-30 18:29:32 +02:00
Armin Novak
8e521e7aee Fixed return value in test. 2015-03-30 18:18:14 +02:00
Armin Novak
eedf45583a Using sprintf_s now. 2015-03-30 18:17:07 +02:00
Armin Novak
0adab13719 Now returning const char* 2015-03-30 18:09:02 +02:00
Armin Novak
cf941304b3 Fixed windows _snprintf. 2015-03-30 18:05:46 +02:00
Armin Novak
827b4f76ca Added test for freerdp version functions. 2015-03-30 17:57:16 +02:00
Armin Novak
8f228163a8 Added version and build info functions
Added functions to get
 * Version String
 * Build Time String
 * Git Revision String
and appropriate tests.
2015-03-30 17:51:29 +02:00
Bernhard Miklautz
74c8400789 coding style fixes
Add missing space after if
2015-03-30 17:15:45 +02:00
Bernhard Miklautz
f469e069dc stream: Stream_Ensure*Capacity: change return type
Change the return type of Stream_Ensure*Capacity from void to BOOL to be
able to detect realloc problems easily. Otherwise the only way to detect
this was to check if the capacity after the call was >= the required
size.
In case Stream_Ensure*Capacity fails the old memory is still available
and need to freed outside.

This commit also adds checks to most calls of Stream_Ensure*Capacity to
check if the call was successful.
2015-03-30 16:33:48 +02:00
Marc-André Moreau
851626f296 Merge pull request #2492 from bmiklautz/malloc_wrap
Fix compiler warnings and code hardening
2015-03-30 09:35:36 -04:00
Marc-André Moreau
ad6dc92e12 Merge pull request #2508 from nfedera/fix-2015-03-30-01
crypto: support MSFT iOS clients with faulty SNI
2015-03-30 08:23:59 -04:00
Norbert Federa
1ba681fecc crypto: support MSFT iOS clients with faulty SNI
Microsoft iOS Remote Desktop Clients eventually send NULL-terminated
hostnames in SNI which is not allowed in the OpenSSL implementation.

Since we're not using SNI this commit adds an OpenSSL TLS extension
debug callback which modifies the SSL context in a way preventing it
from parsing this extension
2015-03-30 13:48:51 +02:00
Norbert Federa
abeb79f2bb nego: fixed X.224 Connection Request PDU parsing
The X.224 Connection Request PDU might contain an optional cookie or
routing token before the optional RDP Negotiation Request (rdpNegReq).
If present, both of these fields must be terminated by a 0x0D0A
two-byte sequence. It seems that until now FreeRDP has incorrectly
assumed that a token or cookie must always be present.
If that was not the case, FreeRDP was searching for 0x0D0A until it
arrived at the end of the stream which prevented the remaining data
(RDP Negotiation Request, RDP Correlation Info) from being parsed.
2015-03-30 13:07:03 +02:00
Bernhard Miklautz
90968e07e1 rename and update tls_disconnect
tls_disconnect shut down the ssl stream but didn't inform
the BIO(s) about this therefore could happen that a second shut down
was initiated (e.g. in bio_rdp_tls_free) causing rather long delays.

After removing the shut down from tls_disconnect the only thing the
function does is to prepare/send an alert therefore it was renamed to
tls_send_alert.
2015-03-30 11:56:09 +02:00
Bernhard Miklautz
aa2181dcf2 Merge pull request #2483 from akallabeth/feat/freerdp_set_last_error_name
Feat/freerdp last error name
2015-03-26 16:42:54 +01:00
Bernhard Miklautz
7f3326d41c Fix compiler warnings
gcc 4.7.2
* warning: value computed is not used [-Wunused-value]
* warning: unused variable ‘oss’ [-Wunused-variable]
2015-03-25 17:38:21 +01:00
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01:00
Bernhard Miklautz
90579ae16f gdi/gfx: remove unused variables 2015-03-25 17:38:21 +01:00
Bernhard Miklautz
f75ced240d gdi: remove unnecessary includes 2015-03-25 17:38:20 +01:00
Bernhard Miklautz
b9cc206a78 gdi: remove dead code 2015-03-25 17:38:20 +01:00
Vic Lee
5f375d0a6f tls: revert checking SSL_ERROR_SYSCALL which may cause deadlock. 2015-03-25 16:07:39 +08:00
Martin Fleisz
5fa777b11c Merge pull request #2482 from llyzs/llyzs
tls: fix error handling of no error code.
2015-03-23 16:06:12 +01:00
Martin Fleisz
8d783bd2f0 Fix server side NLA 2015-03-23 08:33:14 +01:00
Hardening
20433e6f29 Merge pull request #2443 from realjiangms/fix_region
Incorrect extents calculation in region16_intersect_rect (libfreerdp/codec/region.c)
2015-03-20 22:12:48 +01:00
zihao.jiang
a6311d29e7 Add ascii art for norbert_test_case 2015-03-21 01:07:54 +08:00
zihao.jiang
2a91988975 resolve comments from hardening 2015-03-21 00:04:30 +08:00
zihao.jiang
ce06229499 fix tab/space style 2015-03-20 23:40:48 +08:00
zihao.jiang
f94935224c Fixes extents of region16_intersect_rect.
See Issue #2443.
When there's more than 2 rectangles in the region structure, region16_intersect_rect would calculate extents by all 'intersected' sub rectangles.
But it always extend the extents to (0,0) because it initialize the new extents as (0,0,0,0) and union later rectangles with this empty point by simple MIN/MAX calculation.

Also fixed rectangle_is_empty although it has not been used yet. The function does not work as its name.
Reuse norbert case. That case is enough for the intersect fix, but the expected result is not correct. The test case is also fixed.
Added test case to check empty rectangle.
2015-03-20 20:55:06 +08:00
Vic Lee
2137ccc3db tls: retry for all SSL_ERROR_SYSCALL errors. 2015-03-20 10:03:30 +08:00
Marc-André Moreau
cb8e61cf99 libfreerdp-core: fix rdg.c header include 2015-03-19 12:13:37 -04:00
Marc-André Moreau
69f4d78785 libfreerdp-core: fix rdg.h header include 2015-03-19 12:08:30 -04:00
Marc-André Moreau
6202f48c12 libfreerdp-core: add configurable TSG/RGB fallback, fix edge cases 2015-03-19 11:44:47 -04:00
Marc-André Moreau
a2ff1e8348 Merge branch 'gateway' of https://github.com/dvincent-devolutions/FreeRDP into gateway 2015-03-19 09:41:50 -04:00
Denis Vincent
08a3d40ef8 libfreerdp-core: minor code corrections 2015-03-19 09:17:56 -04:00
Armin Novak
3a429e5add Removed unused define. 2015-03-19 14:17:48 +01:00
Armin Novak
48d8058f9b fixed log message arguments. 2015-03-19 11:11:43 +01:00
Armin Novak
56dc61cc06 Added error name and string functions.
Added new functions allowing to get a string representation of an error code
and a description of the error for connect and base error classes.
2015-03-19 11:05:16 +01:00
Denis Vincent
205ccb70c8 libfreerdp-core: added fallback to RPC. 2015-03-18 16:13:32 -04:00
Marc-André Moreau
1380895a2a libfreerdp-core: fix RDG http receive 2015-03-18 09:48:21 -04:00
Marc-André Moreau
3c4bee3d95 libfreerdp-core: fix RDG valgrind issues 2015-03-17 16:54:45 -04:00
Marc-André Moreau
dc913d9f2c libfreerdp-core: fix some RDG valgrind issues 2015-03-17 16:09:17 -04:00
Marc-André Moreau
360e2c5e4e libfreerdp-core: fix rdg event handles 2015-03-17 15:13:11 -04:00
Marc-André Moreau
bdf17450e5 Merge branch 'gateway' of https://github.com/dvincent-devolutions/FreeRDP into gateway 2015-03-17 14:54:04 -04:00
Denis Vincent
144d0d9b23 libfreerdp-core: Initial RDG support. 2015-03-17 14:54:16 -04:00
Marc-André Moreau
0e94ac663d libfreerdp-codec: add support for 16 color palette image copy 2015-03-16 14:01:43 -04:00
Marc-André Moreau
9562439bd8 libfreerdp-codec: add support for 1bpp image copy 2015-03-16 13:27:27 -04:00
Marc-André Moreau
2094501d8b freerdp: fix failing tests 2015-03-16 09:26:38 -04:00
Marc-André Moreau
ad02c75af8 libfreerdp-gdi: disable broken BitBlt tests 2015-03-16 08:55:06 -04:00
Marc-André Moreau
c21bff5415 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-03-16 08:01:54 -04:00
Jean-Louis Dupond
ede7993fe8 libfreerdp-core: Initialize values correctly 2015-03-15 14:09:16 +01:00
Jean-Louis Dupond
8a0fe0861d fix size error introduced in commit 99b14815a5 2015-03-15 11:50:10 +01:00
Marc-André Moreau
afdd55fa81 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-03-13 15:30:31 -04:00
Marc-André Moreau
e3a42e011e Merge pull request #2462 from zhangzl2013/fix
Fix
2015-03-13 14:46:08 -04:00
Jason Plum
6ce5991e74 libfreerdp: crypto: add certificate chain validation! 2015-03-13 13:50:54 -04:00
Armin Novak
2b7a8d324c Fixed mixed declaration of code and variables. 2015-03-13 12:17:22 +01:00
Zhang Zhaolong
4b618852e4 core/gateway: fix memory leak of packet.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-13 11:26:22 +08:00
Zhang Zhaolong
93ae1d997b core: fix double close on fp.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-13 11:21:12 +08:00
Marc-André Moreau
dfc1238523 Merge pull request #2447 from ivan-83/master
Fix poor sound quality with ALSA, add OSS sound system support, FreeBSD patches
2015-03-12 10:09:02 -04:00
Marc-André Moreau
5ab34dfa3e Merge pull request #2456 from zhangzl2013/fix-realloc
Fix incorrect usage of realloc
2015-03-12 07:33:27 -04:00
Marc-André Moreau
0e339786e6 Merge pull request #2452 from bmiklautz/cmd_fix
settings: handle collection_add in detection case
2015-03-12 07:31:11 -04:00
Marc-André Moreau
719a0fd3e9 Merge pull request #2426 from bjcollins/master
xfreerdp fullscreen enhancements
2015-03-12 07:27:29 -04:00
Bernhard Miklautz
6072165fd7 crypto: use PEM as certificate store file format
Currently the certificate format expected in FreeRDPs certificate store
is DER (ASN1). On most linux/unix systems the system certificate store
default format is PEM. Which is also the more common format used by CAs
to distribute their certificates.

Changing the default format to PEM allows the usage of system
certificates or published CA certificates without the need to convert them.

This fixes a part of issue #2446.
2015-03-11 12:06:52 +01:00
Zhang Zhaolong
f0adff1812 codec: check return value of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 14:18:45 +08:00
Zhang Zhaolong
c31ee019fa keyboard_layout: fix incorrect usage of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 14:02:20 +08:00
Zhang Zhaolong
bd234419b8 gdi: fix incorrect usage of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 13:55:41 +08:00
Zhang Zhaolong
a52e7f012d settings: fix incorrect usage of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 13:52:24 +08:00
Zhang Zhaolong
99b14815a5 core: fix incorrect usage of realloc.
realloc can handle the case that its first parameter is NULL.

Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 13:40:20 +08:00
Zhang Zhaolong
4205dac57f crypto: fix incorrect usage of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 12:37:35 +08:00
Jason Plum
30f28d4ac9 Fix case sensitive hostname comparison in tls
To do this I've swapped _strnicmp with memcmp. Seemless, but does lock it to the restrictions of that function.

Signed-off-by: Jason Plum <jplum@archlinuxarm.org>
2015-03-10 16:48:35 -04:00
Bernhard Miklautz
e9985c2093 settings: handle collection_add in detection case
Command line detection is run with dummy settings where not everything
is allocated. Collections (device, dynamic channel and static
channel) didn't handle this case properly.
2015-03-10 13:10:39 +01:00
ivan-83
f5dbe2c9a5 * FreeBSD timezone detection patch 2015-03-10 04:40:47 +03:00
Martin Fleisz
c9c8f8cc89 Merge pull request #2435 from llyzs/llyzs
Add openh264 encoder support.
2015-03-06 11:33:30 +01:00
Bernhard Miklautz
a371723c4f build: fix compiler warnings
warning: redundant redeclaration
Tested with: 4.7.2 and 3.5.0-1~exp1
2015-03-03 19:36:54 +01:00
Vic Lee
3c3c7068a0 Add openh264 encoder support. 2015-03-02 18:11:28 +08:00
Marc-André Moreau
8ee4cbdffd Merge branch 'gateway' of https://github.com/dvincent-devolutions/FreeRDP 2015-02-26 09:08:56 -05:00
Marc-André Moreau
1416ef8017 libfreerdp-core: fix tsg receiving of text/html content 2015-02-24 16:39:00 -05:00
Denis Vincent
baab23fd14 libfreerdp-core: Make tsg out channel recycling event driven 2015-02-24 15:34:41 -05:00
bjcollins
d4a9a2d3a8 Remove override redirect flag for fullscreen with keyboard grab enabled. Window manager should always know about the main window.
Small cleanup of passing around decorations flag.
Limit PercentScreen to single monitor vs. entire desktop. IMO - this is better behavior in a multimonitor environment.

Handle fullscreen windows better:
1. Ensure that size hints are set to allow resizing before setting a window to fullscreen as some window managers do not behave properly.
2. Handle fullscreen toggles without destroying and recreating window.
3. Use NET_WM_STATE_FULLSCREEN Extended Window Manager Hint for fullscreen functionality
4. Use the NET_WM_FULLSCREEN_MONITORS Extended Window Manager Hint when appropriate
5. When a single monitor fullscreen is requested - use the current monitor(as determined from mouse location)
6. Handle cases where there is no local monitor at coordinate 0,0. The Windows server expect there to be a monitor at this location, so we maintain offset if necessary between our local primary monitor and the server side primary monitor located at 0,0.
2015-02-23 11:22:28 -06:00
Mike McDonald
6dd333c4c8 Modified virtual channel open (as a result of an MCS channel join) to do a case-insensitive comparison of the virtual channel name. 2015-02-23 09:24:43 -05:00
Norbert Federa
1fd5508afd Merge pull request #2416 from zavadovsky/transport_dead_end_fix
libfreerdp-core: fix dead-end state in transport_read_pdu()
2015-02-23 12:56:26 +01:00
Zavadovsky Yan
ab8aedd801 libfreerdp-core: add comments for previous fix 2015-02-23 13:57:46 +03:00
Zavadovsky Yan
2be175cec4 libfreerdp-core: fix dead-end state in transport_read_pdu()
Situation: we have fragmented TPKT PDU without two last bytes
(or one last byte - for fast-path) in network stack.

First call to transport_read_pdu() works normally, read
available bytes and exit with status 0 - no whole PDU readed.

Before second call this missed bytes arrive.
Optionally with next PDU.

In second call header parsing code unconditionally read this
two bytes(one byte) despite this is not header bytes.
And increase stream position, so stream now contains whole PDU.

This cause (pduLength - Stream_GetPosition(s)) calculation to be 0.
So transport_read_layer_bytes()-->transport_read_layer() return 0
and transport_read_pdu() exits with "not enough data is available"
status.

If next PDU isn't available next calls to transport_read_pdu()
give same result.
If next PDU arrive - (pduLength - Stream_GetPosition(s)) will be
less than 0. Stream position will grow, grow and grow on each call.
And transport_read_pdu() never signals that PDU is readed.

Caught on Android FreeRDP client with high RDP traffic (several MBytes/s).
2015-02-22 00:28:22 +03:00
Bernhard Miklautz
388d014888 core/tcp: set TCP_USER_TIMEOUT if available
Keepalive settings are usually (depending on the implementation) only
used if the TCP connection is idle.
If the network is interrupted/disconnected/... click or keyboard input
generates outgoing traffic therefore the connection isn't idle
anymore and keepalives might not be used causing the connection to
stay open and the client to stall.

Linux 2.6.36 added a TCP_USER_TIMEOUT TCP socket option that lets a
program specify the maximum time transmitted data may remain
unacknowledged before TCP will close the corresponding connection with
ETIMEDOUT.

Setting TCP_USER_TIMEOUT allows us to detect a network problem (like
cable disconnect) even if the connection isn't idle.
2015-02-20 13:22:01 +01:00
Marc-André Moreau
65b2842792 libfreerdp-core: improve RTS PDU receiving 2015-02-19 16:06:20 -05:00
Marc-André Moreau
b5f1958b69 libfreerdp-core: cleanup channel recycling 2015-02-19 15:06:57 -05:00
Marc-André Moreau
dfee7710e1 Merge branch 'gateway' of https://github.com/dvincent-devolutions/FreeRDP into gateway 2015-02-19 14:11:12 -05:00
Denis Vincent
3e90726bac libfreerdp-core: add TS Gateway out channel recycling support 2015-02-19 13:41:00 -05:00
Marc-André Moreau
44d06888bb libfreerdp-core: fix BIO leaks 2015-02-18 15:36:57 -05:00
Marc-André Moreau
2f4a305c67 libfreerdp-core: fix tsg_get_event_handles 2015-02-18 13:50:03 -05:00
Marc-André Moreau
e9fe5bace6 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-02-18 13:42:28 -05:00
Norbert Federa
5f525e4f8d core: fix refreshRect/suppressOutput capabilities
refreshRectSupport and suppressOutputSupport of the General
Capability Set (MS-RDPBCGR 2.2.7.1.1) are server-only flags
that indicate whether the Refresh Rect or Suppress Output
PDUs are supported by the server.

Therefore in rdp_read_general_capability_set() we must only
change the respective settings if we are not in server mode.
2015-02-18 19:33:19 +01:00
Marc-André Moreau
f9885da81c Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-02-18 09:51:11 -05:00
Marc-André Moreau
f86f5bc252 Merge pull request #2397 from hardening/nego_fix2
Fix disconnection when negociation has failed
2015-02-18 09:50:46 -05:00
Marc-André Moreau
0e57706de5 libfreerdp-core: cleanup connect error codes, fix Win32 NLA 2015-02-17 21:01:27 -05:00
Marc-André Moreau
c2a107ac9d libfreerdp-core: initial support for tsg silent reauth 2015-02-17 16:36:01 -05:00
Marc-André Moreau
3b622d15d1 libfreerdp-core: refactor TsProxy* calls 2015-02-17 16:15:57 -05:00
Marc-André Moreau
b8b94327c8 libfreerdp-core: improve tsg debug output and reauth sequence 2015-02-17 14:34:42 -05:00