Commit Graph

1979 Commits

Author SHA1 Message Date
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
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
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
Marc-André Moreau
668b2c1811 libfreerdp-core: fix tsg buffer flushing 2015-02-17 10:54:39 -05:00
Marc-André Moreau
7639addb40 libfreerdp-core: partial tsg reauth support 2015-02-16 15:35:51 -05:00
Bernhard Miklautz
0b902eeb5d wtsapi: add WTSStartRemoteControlSessionEx
WTSStartRemoteControlSession doesn't allow to specify additional flags
therefore add a new extended version WTSStartRemoteControlSessionEx
with an additional "flags" parameter.

The following flags are defined:

REMOTECONTROL_FLAG_DISABLE_KEYBOARD - disable keyboard input
REMOTECONTROL_FLAG_DISABLE_MOUSE    - disable mouse input
REMOTECONTROL_FLAG_DISABLE_INPUT    - disable input (keyboard and mouse)
2015-02-16 12:16:54 +01:00
Marc-André Moreau
ffe24e8cfb libfreerdp-core: improve TSProxyCreateTunnelRequest 2015-02-15 18:22:49 -05:00
Marc-André Moreau
9c7b7ab561 libfreerdp-core: make NLA event-driven 2015-02-15 16:04:59 -05:00
Marc-André Moreau
eddfee56a3 libfreerdp-core: prepare client-side NLA for event-driven structure 2015-02-15 14:54:10 -05:00
Marc-André Moreau
ab5fdcc3f1 libfreerdp-core: NLA cleanup 2015-02-15 11:10:14 -05:00
Marc-André Moreau
991f7b347d libfreerdp-core: further abstract multiple connections used internally by tsg from rdpTransport 2015-02-15 10:06:17 -05:00
Marc-André Moreau
edfc5120b7 libfreerdp-core: replace rdpTcp by BufferedSocket BIO 2015-02-14 10:14:13 -05:00
Marc-André Moreau
e904195e49 libfreerdp-core: more rdpTcp refactoring 2015-02-13 16:51:08 -05:00
Marc-André Moreau
e241330daf libfreerdp-core: rewrite tls_write_all to use front BIO only 2015-02-13 16:02:37 -05:00
Marc-André Moreau
c001a69d50 libfreerdp-core: move wait_read/wait_write operations under BIO layer 2015-02-13 15:22:27 -05:00
Marc-André Moreau
b7a619ff8a libfreerdp-core: move some rdpTcp operations under BIO layer 2015-02-13 14:26:02 -05:00
David FORT
bb9ba34f1d Fix disconnection when negociation has failed
This patch fixes a bug with mstsc connecting to a RDP security only FreeRDP server.
It seems like the mstsc shipped with Windows Seven considers packets after the nego_failure
packet as an error. So after trying to do TLS, depending on the timing, mstsc can print an
error message instead of retrying to connect with RDP security. With this patch, we
don't send the MCS disconnect message when the negociation has failed.
2015-02-13 18:25:50 +01:00
Marc-André Moreau
69b93c322d libfreerdp-core: fix transport crash, reduce rdpTcp usage 2015-02-13 09:27:54 -05:00
Marc-André Moreau
3e414f1840 libfreerdp-core: fix server-side transport_attach crash 2015-02-13 08:41:47 -05:00
Marc-André Moreau
889ccefe0d libfreerdp-core: remove TlsIn/TlsOut from rdpTransport 2015-02-12 16:22:25 -05:00
Marc-André Moreau
0d85dfd395 libfreerdp-core: handle TCP/TLS connection at TSG RPC channel level 2015-02-12 14:40:26 -05:00
Marc-André Moreau
4ecff39eb6 libfreerdp-core: more tsg in/out channel refactoring 2015-02-12 14:08:38 -05:00
Marc-André Moreau
8f2b2be9f2 libfreerdp-core: integrate new RTS pdu functions from denis 2015-02-12 13:14:43 -05:00
Marc-André Moreau
c92e82b3dc libfreerdp-core: improve TSG virtual connection and channel management 2015-02-12 12:03:15 -05:00
Marc-André Moreau
d330570e62 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-02-12 10:15:14 -05:00
Marc-André Moreau
9263e42120 Merge pull request #2385 from hardening/nego_fix
Fix server-side protocol negociation
2015-02-12 10:12:01 -05:00
Martin Haimberger
b302da2e92 wtsapi: added handler for LogonUser and LogoffUser 2015-02-12 01:31:00 -08:00
David FORT
6a8d21cab9 Fix server-side protocol negociation
Before this patch, RDP security was (wrongly) the fallback when negociating a
security protocol between the client and the server. For example when a client
was claiming TLS-only when connecting to a FreeRDP based-server with RDP security only,
the result of the negociation was that the server started to do RDP security.
The expected behaviour is to send a nego failure packet with error code
SSL_NOT_ALLOWED_BY_SERVER. This patch fixes this.

We also try to handle all cases of failed negociation and return the corresponding
error code.
2015-02-11 21:38:32 +01:00
Marc-André Moreau
75cad064f1 libfreerdp-core: refactor tsg virtual connection, in/out channels 2015-02-11 15:26:22 -05:00
Marc-André Moreau
70fab69347 libfreerdp-core: gateway connection refactoring 2015-02-11 14:27:29 -05:00
Marc-André Moreau
aa8b843250 libfreerdp-core: move stuff down from transport to tsg layer 2015-02-11 11:57:02 -05:00