Commit Graph

220 Commits

Author SHA1 Message Date
ivan-83
0fda0eb0de Code style changed. 2015-05-27 22:59:57 +03:00
ivan-83
1009268158 * debug and error messages now print function name and line number
* add debug messages to trace fake network dissconects
2015-05-27 22:57:10 +03:00
ivan-83
94a7abd2af + tsmf: OSS initial suppot (not work yet)
* tsmf: fix video playback on FreeBSD (proper shared object name)
* tsmf: renamed args: audio->sys, audio-dev->dev
* audin: OSS fix, now it work
* cmdline: add syntax help for /audin, /rdpsnd, /tsmf
* add debug messages
2015-05-27 22:54:13 +03:00
Konrad Witaszczyk
8797eef9b9 Assign peer to settings when a new RDP module is being initialized. 2015-05-21 16:54:19 +02: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
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
ea0e255058 Fixed broken pad setting. 2015-04-13 09:28:29 +02:00
David FORT
c03bf75896 Take in account @nfedera's comments 2015-04-07 21:06:53 +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
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
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01: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
991f7b347d libfreerdp-core: further abstract multiple connections used internally by tsg from rdpTransport 2015-02-15 10:06:17 -05:00
Marc-André Moreau
70fab69347 libfreerdp-core: gateway connection refactoring 2015-02-11 14:27:29 -05:00
Marc-André Moreau
fa06c4d401 libfreerdp-core: improve reconnection 2015-02-06 14:21:26 -05:00
Marc-André Moreau
e4f99834d0 libfreerdp-core: make tsg threadless 2015-02-02 11:50:56 -05:00
Marc-André Moreau
620694c10a Merge pull request #2301 from akallabeth/disconnect_fix
Disconnect / Reconnect fix
2015-01-14 08:56:54 -05:00
Martin Haimberger
bba342a6be added set_error_info function
if an error_info is set, a TS_SET_ERROR_INFO_PDU
will be sent to the client on disconnect with
the error_info
2015-01-13 08:09:36 -08:00
Armin Novak
600074373c Fixed rdp_reset. 2015-01-12 13:47:04 +01:00
Marc-André Moreau
9b28562cc1 libfreerdp-core: fix faulty rdpTransport server-side initialization 2014-12-15 10:23:06 -05:00
Norbert Federa
939f1c639a Standard RDP Security Layer Levels/Method Overhaul
[MS-RDPBCGR] Section 5.3 describes the encryption level and method values for
standard RDP security.

Looking at the current usage of these values in the FreeRDP code gives me
reason to believe that there is a certain lack of understanding of how these
values should be handled.

The encryption level is only configured on the server side in the "Encryption
Level" setting found in the Remote Desktop Session Host Configuration RDP-Tcp
properties dialog and this value is never transferred from the client to the
server over the wire.
The possible options are "None", "Low", "Client Compatible", "High" and
"FIPS Compliant". The client receices this value in the Server Security Data
block (TS_UD_SC_SEC1), probably only for informational purposes and maybe to
give the client the possibility to verify if the server's decision for the
encryption method confirms to the server's encryption level.
The possible encryption methods are "NONE", "40BIT", "56BIT", "128BIT" and
"FIPS" and the RDP client advertises the ones it supports to the server in the
Client Security Data block (TS_UD_CS_SEC).
The server's configured encryption level value restricts the possible final
encryption method.
Something that I was not able to find in the documentation is the priority
level of the individual encryption methods based on which the server makes its
final method decision if there are several options.
My analysis with Windows Servers reveiled that the order is 128, 56, 40, FIPS.
The server only chooses FIPS if the level is "FIPS Comliant" or if it is the
only method advertised by the client.

Bottom line:
* FreeRDP's client side does not need to set settings->EncryptionLevel
(which was done quite frequently).
* FreeRDP's server side does not have to set the supported encryption methods
list in settings->EncryptionMethods

Changes in this commit:

Removed unnecessary/confusing changes of EncryptionLevel/Methods settings

Refactor settings->DisableEncryption
* This value actually means "Advanced RDP Encryption (NLA/TLS) is NOT used"
* The old name caused lots of confusion among developers
* Renamed it to "UseRdpSecurityLayer" (the compare logic stays untouched)

Any client's setting of settings->EncryptionMethods were annihilated
* All clients "want" to set all supported methods
* Some clients forgot 56bit because 56bit was not supported at the time the
code was written
* settings->EncryptionMethods was overwritten anyways in nego_connect()
* Removed all client side settings of settings->EncryptionMethods
The default is "None" (0)
* Changed nego_connect() to advertise all supported methods if
settings->EncryptionMethods is 0 (None)
* Added a commandline option /encryption-methods:comma separated list of the
values "40", "56", "128", "FIPS". E.g. /encryption-methods:56,128
* Print warning if server chooses non-advertised method

Verify received level and method in client's gcc_read_server_security_data
* Only accept valid/known encryption methods
* Verify encryption level/method combinations according to MS-RDPBCGR 5.3.2

Server implementations can now set settings->EncryptionLevel
* The default for settings->EncryptionLevel is 0 (None)
* nego_send_negotiation_response() changes it to ClientCompatible in that case
* default to ClientCompatible if the server implementation set an invalid level

Fix server's gcc_write_server_security_data
* Verify server encryption level value set by server implementations
* Choose rdp encryption method based on level and supported client methods
* Moved FIPS to the lowest priority (only used if other methods are possible)

Updated sample server
* Support RDP Security (RdpKeyFile was not set)
* Added commented sample code for setting the security level
2014-12-12 02:17:12 +01:00
Armin Novak
bde7b156a8 Fixed uninitialized data warning. 2014-11-17 00:05:12 +01:00
Martin Fleisz
53f38d3e89 Merge pull request #2189 from llyzs/llyzs
Support Continuous Auto-Detection.
2014-11-11 08:42:48 +01:00
Mehul Dhorda
e8b8ae1900 Added comment to clarify flow control PDU fields. 2014-11-07 14:58:58 -08:00
Vic Lee
8eaeeebecc libfreerdp-core: support continuous auto-detection. 2014-11-07 16:18:49 +08:00
Mehul Dhorda
f64d620a3b Ignore T.128 FlowPDU in Share Control header
According to the Microsoft RDP specification, T.128 flow control PDUs
should be ignored when reading Share Control headers.
(http://msdn.microsoft.com/en-us/library/cc240576.aspx). This patch
checks if we got a flow control PDU (length = 0x8000) and advances the
stream to ignore the PDU.
2014-11-05 11:32:46 -08:00
Vic Lee
0e7797ffca libfreerdp-core: server-side mcs message channel. 2014-10-29 00:49:27 +08:00
Bernhard Miklautz
f40053577f core: add support for set keyboard indicators PDU
Server Set Keyboard Indicators PDU MS-RDPBCGR 2.2.8.2.1

* add server side code
* add support for client callback
2014-10-03 12:10:44 +02:00
Marc-André Moreau
9daa8bd36f libfreerdp-gdi: handle egfx desktop resize 2014-09-25 22:08:10 -04:00
Marc-André Moreau
6cb4b59426 libfreerdp-core: fix server-side receiving of X224 disconnect TPDU 2014-09-20 20:19:59 -04:00
Armin Novak
2f519d7f16 Replaced logging in libfreerdp with wlog defines. 2014-09-15 08:48:46 +02:00
Vic Lee
af57056228 transport: exit transport loop when the session is activated. 2014-09-11 14:04:32 -07:00
Daniel Bungert
27fc3ee64d Fix multiple cases of use of uninitialized vars
* Zeroing xevent helped address some erratic behavior.
* valgrind complained about using xfBitmap uninitialized
  during shutdown, traced it back to the initialization.
  Bitmap_Prototype->size > sizeof(rdpBitmap).
* Early exit from recv_tpkt_pdu is necessary to address
  a shutdown crash - the channelId value was being used
  without being set in the disconnect case.
2014-08-20 03:54:05 -06:00
Armin Novak
f4c133eaf8 Replaced custom logging mechanism with WLog wrapper. 2014-08-07 16:51:24 +02:00
Marc-André Moreau
c2a59c23a7 libfreerdp-core: fix potential crash on session redirection failure 2014-04-28 16:44:52 -04:00
Marc-André Moreau
09a540b40b libfreerdp-core: remove old, unused extension framework 2014-04-14 14:49:03 -04:00
Hardening
2edd8bee12 Misc fixes to check OOM 2014-04-10 21:10:19 +02:00
Norbert Federa
18cb418c81 core: FIPS for fastpath and RDP security fixes
- fixed invalid stream position if extEncryptionMethods is not used
- enabled 56bit rdp security method
- fixed entropy reduction of the keys for 40 bit and 56 bit
- added rdp security incl. FIPS for fastpath output
- added FIPS encryption to fast path input
- fixed FIPS key generation in server mode
- fixed stream length correction in FIPS mode
- added rdp encryption for licensing packets (apparently some clients,
  specifically cetsc, require the license packets received from the
  server to be encrypted under certain RDP encryption levels)
- replace errnous virtual extended mouse event in focus in event
2014-04-02 14:17:39 +02:00
Benoit LeBlanc
21b5f0e418 Fix windows build 2014-03-21 15:25:00 -04:00
Benoît LeBlanc
3e1dfc6311 updated context error messages. utility macros for getting error code CLASS/TYPE 2014-03-21 13:45:43 -04:00
Bernhard Miklautz
59eadb9213 only process msg channel pdu if msg channel is set 2014-03-14 21:56:10 +01:00
Marc-André Moreau
201bbf5df4 Merge branch 'master' of github.com:awakecoding/FreeRDP into mppc 2014-03-11 11:57:01 -04:00
Marc-André Moreau
2f756745e9 libfreerdp-core: wrap old MPPC implementation under rdpBulk 2014-03-10 13:15:10 -04:00
Marc-André Moreau
61ecd0ff31 libfreerdp-core: add bulk.c to handle bulk compression in a centralized place 2014-03-10 11:41:10 -04:00
Benoît LeBlanc
557c082458 Merge branch 'master' of git://github.com/awakecoding/FreeRDP 2014-03-05 16:35:22 -05:00
Marc-André Moreau
db7a9d2e77 libfreerdp-core: start moving internal MCS variables out of rdpSettings* 2014-02-15 16:32:38 -05:00
Marc-André Moreau
e5990fa60c libfreerdp-core: MCS cleanup, better handling of domain parameters 2014-02-13 17:06:33 -05:00
Marc-André Moreau
cdcd290c44 wfreerdp: fix most build warnings 2014-02-10 22:12:13 -05:00
Benoît LeBlanc
9d929469d2 Merge branch 'master' of git://github.com/awakecoding/FreeRDP
# By Marc-André Moreau (27) and others
# Via Marc-André Moreau
* 'master' of git://github.com/awakecoding/FreeRDP: (48 commits)
  afreerdp: fix build on Android
  libwinpr-wtsapi: include wtsapi32.h on Windows
  wfreerdp: fix target exporting
  wfreerdp: fix building against OpenSSL with MONOLITHIC_BUILD and shared libraries
  wfreerdp: fix test build issues
  libwinpr-crypto: implement CryptProtectMemory/CryptUnprotectMemory
  libwinpr-memory: add missing definitions
  libwinpr-memory: start stubbing
  Increased size of stream on GCC conference create request from 512 to 1024.  For large numbers of static virtual channels, the stream was being overflowed and was causing crashes.
  Fixes to process new command line options (autodetect, heartbeat, multitransport), join the MCS message channel and process auto-detect PDUs during the connection sequence.
  wfreerdp: fix build against static openssl library
  winpr-hash: fix building against openssl in static mode
  libfreerdp-gdi: fix invalidation of region with line drawing
  mfreerdp: fix hungarian keyboard '0' and 'i' key inversion
  Fixes build issue on Windows
  libwinpr-synch: add active/inactive linked list for timer queue
  libwinpr-synch: improve timer queue implementation
  libwinpr-synch: make use of head's expiration time in timer queue
  libwinpr-synch: make use of timespec for timer queue
  libwinpr-synch: improve timer queue implementation
  ...

Conflicts:
	client/common/CMakeLists.txt
2014-02-04 11:37:40 -05:00
Mike McDonald
02c9d07bcf Fixes to process new command line options (autodetect, heartbeat, multitransport), join the MCS message channel and process auto-detect PDUs during the connection sequence. 2014-01-29 22:53:32 -05:00
Marc-André Moreau
6bd4362e6d Merge branch 'auto-detect' of github.com:vworkspace/FreeRDP
Conflicts:
	include/freerdp/settings.h
	libfreerdp/core/gcc.c
	libfreerdp/core/gcc.h
	libfreerdp/core/mcs.h
	libfreerdp/core/rdp.c
2014-01-25 17:08:43 -05:00
Mike McDonald
63f6947872 Added heartbeat to rdpRdp struct and added calls to heartbeat constructor and destructor 2014-01-24 08:38:28 -05:00
Mike McDonald
ac8fe6ad61 Added heartbeat code 2014-01-23 22:23:47 -05:00
Mike McDonald
07083acc97 First cut at network characteristics auto-detect and multitransport protocol 2014-01-23 18:01:31 -05:00
Benoît LeBlanc
4dbe3126aa Merge branch 'master' of git://github.com/awakecoding/FreeRDP 2014-01-13 14:53:15 -05:00
Marc-André Moreau
47f3b879db libfreerdp-core: implement parsing of less frequent core rdp messages 2014-01-11 22:54:08 -05:00
Benoît LeBlanc
70cc837eaf Transport: trigger OnErrorInfo if a read/write error forced the thread to closed. 2013-12-20 18:26:07 -05:00
Marc-André Moreau
498227eb1b libfreerdp-core: map more Disconnect Provider Ultimatum PDU reason codes to error info pdu 2013-11-14 23:41:46 -05:00
Marc-André Moreau
fa12414a4b libfreerdp-core: fix parsing of MCS Disconnect Provider Ultimatum, workaround for 2008 R2 lack of error info pdu on user logoff 2013-11-14 23:05:29 -05:00
Marc-André Moreau
3d339b04d9 libfreerdp-core: modify parsing functions to return int instead of BOOL to propagate session redirection return code 2013-11-04 15:52:29 -05:00
Marc-André Moreau
13b6678977 libfreerdp-core: start untangling session redirection 2013-11-03 16:25:56 -05:00
Marc-André Moreau
76414588b1 libfreerdp-core: fix transport failure case with session redirection 2013-11-01 14:13:09 -04:00
Marc-André Moreau
69345954b8 libfreerdp-core: fix decoupling of rdpSettings* from rdpContext* 2013-10-12 22:58:09 -04:00
Marc-André Moreau
b70ecbbf62 libfreerdp-core: decouple initialization of rdpSettings from freerdp* instance 2013-10-12 18:20:25 -04:00
Marc-André Moreau
518995a05e freerdp: merge with master 2013-09-16 17:10:27 -04:00
Marc-André Moreau
a0e09e6273 libfreerdp-core: fix server-side licensing sequence 2013-09-05 18:53:55 -04:00
Armin Novak
ef91766cf3 Fixed clang issues. 2013-09-05 12:14:34 +02:00
Marc-André Moreau
69128d8018 libfreerdp-core: improvements to the server-side activation/reactivation code 2013-07-19 21:52:28 -04:00
Marc-André Moreau
91103b76b3 libfreerdp-core: modify server-side confirm active pdu receiving logic 2013-07-19 18:24:56 -04:00
Marc-André Moreau
6cde25937d libfreerdp-core: wrap state transition actions 2013-07-18 17:15:10 -04:00
Marc-André Moreau
f27ab422e3 libfreerdp-core: expand comments for connection sequence, split in more steps server-side connection code 2013-07-18 15:18:59 -04:00
Marc-André Moreau
90ce8be9fc freerdp-core: added Terminate event 2013-06-18 16:55:23 -04:00
Marc-André Moreau
508bae674b libwinpr-utils: improve PubSub with automatic strongly-typed helpers 2013-06-18 00:39:48 -04:00
Marc-André Moreau
59b7c53c5f freerdp: remove temporary rdpClient* interface and replace with pubSub hooks 2013-06-15 17:39:45 -04:00
Marc-André Moreau
202614a1a4 libfreerdp-core: reduce reuse of same pdu buffers 2013-05-15 15:54:33 -04:00
Marc-André Moreau
fc592a1750 libfreerdp-core: replace usage of Stream_GetPointer() by Stream_GetPosition() in potentially unsafe places 2013-05-15 14:42:37 -04:00
Marc-André Moreau
367ebf32a3 freerdp: make use of stream macros to access members 2013-05-15 12:14:26 -04:00
Marc-André Moreau
fd230443c5 freerdp: purge old stream utils 2013-05-08 16:27:21 -04:00
Marc-André Moreau
5b92413843 freerdp: purge deprecated stream utils 2013-05-08 16:09:16 -04:00
Marc-André Moreau
946d7ec589 libfreerdp-core: fix compression with stream pool 2013-04-30 11:26:33 -04:00
Marc-André Moreau
51715636a5 freerdp: remove some deprecated stream utils 2013-04-29 22:35:15 -04:00
Marc-André Moreau
4386f49746 libfreerdp-core: add client hook for OnErrorInfo 2013-04-28 20:40:49 -04:00
Hardening
7701c9d934 Replace printf(...) by fprintf(stderr, ...) 2013-03-28 23:06:34 +01:00
Marc-André Moreau
a8201b0d1b libwinpr-utils: combine old and new stream utils 2013-03-21 15:19:33 -04:00
Marc-André Moreau
62eec0c2b5 libfreerdp-utils: rename internal members of STREAM to match new wStream 2013-03-21 15:01:46 -04:00
Vic Lee
7d58aac24f security: add a NULL pointer check to fix a server crash. 2013-03-05 15:08:03 +08:00
Marc-André Moreau
7a289423c0 channels/rdpsnd: refactor scheduling of sending of sound PDUs 2013-02-20 21:34:47 -05:00
Marc-André Moreau
e42b1272ef libfreerdp-core: added ObjectPool 2013-02-14 20:39:56 -05:00
Marc-André Moreau
47a7d54370 xfreerdp: stabilize asynchronous X11 event handling 2013-02-11 20:38:19 -05:00
Marc-André Moreau
1070931479 libfreerdp-core: fix decryption of encrypted error info PDU in license sequence 2013-02-04 16:39:05 -05:00
hardening
9b8ba7f3e0 check size before decompressing
fixed return value from BOOL to int
2013-02-01 22:43:20 +01:00
Marc-André Moreau
930c9907ce libfreerdp-core: code style cleanup 2013-01-18 16:50:25 -05:00
Marc-André Moreau
df01ba88d4 libfreerdp-core: change fastpath return codes 2013-01-16 18:01:10 -05:00
rdp.effort
81c0e99ceb Misc fixes and result checks 2013-01-13 23:37:50 +01:00
rdp.effort
a30075b12d Added checks for RDP layer processing 2013-01-12 00:43:16 +01:00
Marc-André Moreau
45d001ef8b libfreerdp-core: change return values for PDU processing 2013-01-08 17:18:10 -05:00
Marc-André Moreau
811ff44720 libfreerdp-core: change ReceiveCallback return values 2013-01-06 17:24:08 -05:00
Marc-André Moreau
dcf6c17e03 libfreerdp-core: transport cleanup 2012-12-21 15:49:02 -05:00
Marc-André Moreau
3aeb9eb197 libfreerdp-core: TSG partial cleanup 2012-12-11 23:34:51 -05:00
Marc-André Moreau
335add832d libfreerdp-core: split code from rpc.c to rpc_bind.c and rpc_fault.c 2012-11-28 00:32:12 -05:00
Marc-André Moreau
12f0afd1e0 libfreerdp-core: fix TSG socket blocking mode 2012-11-27 18:34:00 -05:00
Marc-André Moreau
b3d8f79b5c libfreerdp-utils: replace ARRAY_SIZE custom macro with ARRAYSIZE() windows macro 2012-11-21 20:50:28 -05:00
Marc-André Moreau
b2c3ca8cc4 libfreerdp-utils: replace all calls to deprecated function xzalloc 2012-11-21 19:22:41 -05:00
Marc-André Moreau
e0b37aa97e channels: load device addins using new command-line api 2012-11-08 19:01:52 -05:00
Marc-André Moreau
410b7ab867 libfreerdp-core: rdpSettings refactoring (part 4) 2012-11-07 23:29:24 -05:00
Marc-André Moreau
8544716104 libfreerdp-core: rdpSettings refactoring (part 3) 2012-11-07 18:23:33 -05:00
Marc-André Moreau
6427c9dd90 libfreerdp-core: rdpSettings refactoring (part 2) 2012-11-07 15:13:14 -05:00
Marc-André Moreau
1a2839a165 libfreerdp-core: rdpSettings refactoring (part 1) 2012-11-07 11:02:46 -05:00
Marc-André Moreau
9d064171a7 freerdp: get rid of old types 2012-10-09 03:26:39 -04:00
Marc-André Moreau
1bf8a45519 freerdp: change uint8, sint8, uint16, sint16 to BYTE, INT8, UINT16, INT16 2012-10-09 03:01:37 -04:00
Marc-André Moreau
1ed644786c freerdp: change boolean type to BOOL type 2012-10-09 02:38:39 -04:00
Marc-André Moreau
5612bc43f8 freerdp: change true/false to TRUE/FALSE 2012-10-09 02:31:28 -04:00
Marc-André Moreau
9909a12af5 libfreerdp-utils: get rid of xmalloc, xrealloc and xfree 2012-10-08 23:21:26 -04:00
Marc-André Moreau
e60a092d81 freerdp: fix headers 2012-10-08 23:02:04 -04:00
Marc-André Moreau
84b21a61c4 libfreerdp-core: fix setting rdp->disconnect 2012-10-02 10:28:04 -04:00
Marc-André Moreau
d5d1eb7762 libfreerdp: add proper config.h inclusions 2012-08-14 17:09:01 -04:00
Marc-André Moreau
19028a27b0 libfreerdp: move all libraries to libfreerdp directory, one step closer to monolithic build option 2012-08-13 23:19:51 -04:00