Merge branch 'master' of github.com:awakecoding/FreeRDP into shadow

This commit is contained in:
Marc-André Moreau 2014-08-15 11:44:07 -04:00
commit 78d43ced3d
2 changed files with 29 additions and 17 deletions

View File

@ -892,36 +892,38 @@ BOOL nego_send_negotiation_response(rdpNego* nego)
bm = Stream_GetPosition(s);
Stream_Seek(s, length);
if (nego->selected_protocol > PROTOCOL_RDP)
{
flags = EXTENDED_CLIENT_DATA_SUPPORTED;
if (settings->SupportGraphicsPipeline)
flags |= DYNVC_GFX_PROTOCOL_SUPPORTED;
/* RDP_NEG_DATA must be present for TLS and NLA */
Stream_Write_UINT8(s, TYPE_RDP_NEG_RSP);
Stream_Write_UINT8(s, flags); /* flags */
Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */
Stream_Write_UINT32(s, nego->selected_protocol); /* selectedProtocol */
length += 8;
}
else if (!settings->RdpSecurity)
if ((nego->selected_protocol == PROTOCOL_RDP) && !settings->RdpSecurity)
{
flags = 0;
Stream_Write_UINT8(s, TYPE_RDP_NEG_FAILURE);
Stream_Write_UINT8(s, flags); /* flags */
Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */
/*
* TODO: Check for other possibilities,
* like SSL_NOT_ALLOWED_BY_SERVER.
*/
DEBUG_WARN( "%s: client supports only Standard RDP Security\n", __FUNCTION__);
Stream_Write_UINT32(s, SSL_REQUIRED_BY_SERVER);
length += 8;
status = FALSE;
}
else
{
flags = EXTENDED_CLIENT_DATA_SUPPORTED;
if (settings->SupportGraphicsPipeline)
flags |= DYNVC_GFX_PROTOCOL_SUPPORTED;
/* RDP_NEG_DATA must be present for TLS, NLA, and RDP */
Stream_Write_UINT8(s, TYPE_RDP_NEG_RSP);
Stream_Write_UINT8(s, flags); /* flags */
Stream_Write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */
Stream_Write_UINT32(s, nego->selected_protocol); /* selectedProtocol */
length += 8;
}
em = Stream_GetPosition(s);
Stream_SetPosition(s, bm);
@ -953,13 +955,22 @@ BOOL nego_send_negotiation_response(rdpNego* nego)
if (!settings->LocalConnection)
{
settings->DisableEncryption = TRUE;
settings->DisableEncryption = FALSE;
settings->EncryptionMethods = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_56BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
settings->EncryptionLevel = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
}
if (settings->DisableEncryption && !settings->RdpServerRsaKey && !settings->RdpKeyFile)
if (settings->DisableEncryption)
{
fprintf(stderr, "Encryption is disabled.\n");
return FALSE;
}
if (!settings->RdpServerRsaKey && !settings->RdpKeyFile)
{
fprintf(stderr, "Missing server certificate\n");
return FALSE;
}
}
else if (settings->SelectedProtocol == PROTOCOL_TLS)
{

View File

@ -317,6 +317,7 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds)
event = (WINPR_EVENT*) Object;
status = waitOnFd(event->pipe_fd[0], dwMilliseconds);
if (status < 0)
{
fprintf(stderr, "WaitForSingleObject: event select() failure [%d] %s\n", errno, strerror(errno));