FreeRDP/include/freerdp
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
..
cache libfreerdp-cache: refactor glyph cache and add logging 2013-11-01 10:01:16 -04:00
channels freerdp: patch valgrind leaks, cleanup 2014-12-03 14:17:27 -05:00
client Add server-side RDPEI 2014-11-20 22:19:29 +01:00
codec Fixed missing extern C 2014-12-01 13:12:51 +01:00
crypto Fixed missing extern C 2014-12-01 13:12:51 +01:00
gdi Fixed missing extern C 2014-12-01 13:12:51 +01:00
locale Fixed missing extern C 2014-12-01 13:12:51 +01:00
server Fixed missing extern C 2014-12-01 13:12:51 +01:00
utils freerdp: remove tcp, uds utils 2014-11-12 14:06:34 -05:00
addin.h Fixed compilation with -Wstrict-prototypes 2013-02-14 22:20:43 +01:00
altsec.h libfreerdp-core: added message queue stubs 2013-01-24 17:11:43 -05:00
api.h Fix Windows missing __func__ defines. 2013-01-20 10:53:26 +08:00
assistance.h shadow: start Windows Desktop Sharing API support 2014-08-13 17:48:57 -04:00
autodetect.h libfreerdp-core: support continuous auto-detection. 2014-11-07 16:18:49 +08:00
client.h client/common: parse and use remote assistance file 2014-06-28 18:33:46 -04:00
codecs.h Fixed missing extern C 2014-12-01 13:12:51 +01:00
constants.h libfreerdp-core: expose stubbed WtsApi function table from the core 2014-02-16 20:12:45 -05:00
dvc.h freerdp: remove deprecated eventing system 2014-11-12 13:18:18 -05:00
error.h Remove execute bit from many files 2014-07-20 00:52:35 -04:00
event.h xfreerdp: added smart sizing, mt gesture fixes 2014-12-01 11:56:44 +01:00
extension.h libfreerdp: header cleanup 2012-12-14 00:25:48 -05:00
freerdp.h libfreerdp-core: server-side auto-detect feature. 2014-10-29 00:49:49 +08:00
graphics.h xfreerdp: fix glyph index primary drawing order 2014-10-29 20:56:26 +01:00
input.h correct Pause key sequence 2014-07-25 11:31:50 +02:00
listener.h libfreerdp-core: add event handle support to listener 2013-07-21 16:21:46 -04:00
log.h Added headers for converting logging in libfreerdp, channels, clients and servers. 2014-09-09 16:33:05 +02:00
message.h core: add support for set keyboard indicators PDU 2014-10-03 12:10:44 +02:00
metrics.h Fixed missing extern C 2014-12-01 13:12:51 +01:00
peer.h libfreerdp-core: server-side auto-detect feature. 2014-10-29 00:49:49 +08:00
pointer.h libfreerdp: header cleanup 2012-12-14 00:25:48 -05:00
primary.h fix polyline. 2014-10-09 18:11:38 +08:00
primitives.h libfreerdp-codec: add BGR support to egfx 2014-09-16 16:55:47 -04:00
rail.h freerdp: fix build warnings 2014-08-18 17:25:48 -04:00
scancode.h add additional evdev key mappings for multimedia and Korean keyboards 2014-01-14 15:18:20 -07:00
secondary.h libfreerdp-core: fix async updates with palettes 2013-02-03 16:19:25 -05:00
settings.h Standard RDP Security Layer Levels/Method Overhaul 2014-12-12 02:17:12 +01:00
svc.h freerdp: remove deprecated eventing system 2014-11-12 13:18:18 -05:00
types.h libfreerdp-core: refactor codec context management 2014-09-10 00:42:41 -04:00
update.h Offer to disable bulk compression when using remoteFx 2014-11-04 16:14:53 +01:00
version.h.in updated file headers 2013-12-04 11:44:22 +01:00
window.h xfreerdp: add special extended window style WS_EX_DECORATIONS for XRDP 2013-03-28 23:47:39 -04:00