moved final security connection step into nego_connect for consistency

This commit is contained in:
lysannkessler 2012-07-25 18:50:19 +02:00
parent d9c260f221
commit f8430e246c
3 changed files with 10 additions and 5 deletions

View File

@ -84,13 +84,10 @@ boolean rdp_client_connect(rdpRdp* rdp)
if (!nego_connect(rdp->nego))
{
printf("Error: protocol security negotiation failure\n");
printf("Error: protocol security negotiation or connection failure\n");
return false;
}
if (!nego_security_connect(rdp->nego))
return false;
if ((rdp->nego->selected_protocol & PROTOCOL_TLS) || (rdp->nego->selected_protocol == PROTOCOL_RDP))
{
if ((settings->username != NULL) && ((settings->password != NULL) || (settings->password_cookie != NULL && settings->password_cookie->length > 0)))

View File

@ -46,6 +46,8 @@ static const char PROTOCOL_SECURITY_STRINGS[3][4] =
"NLA"
};
boolean nego_security_connect(rdpNego* nego);
/**
* Negotiate protocol security and connect.
* @param nego
@ -119,6 +121,13 @@ boolean nego_connect(rdpNego* nego)
nego->transport->settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
}
/* finally connect security layer (if not already done) */
if(!nego_security_connect(nego))
{
DEBUG_NEGO("Failed to connect with %s security", PROTOCOL_SECURITY_STRINGS[nego->selected_protocol]);
return false;
}
return true;
}

View File

@ -99,7 +99,6 @@ struct rdp_nego
typedef struct rdp_nego rdpNego;
boolean nego_connect(rdpNego* nego);
boolean nego_security_connect(rdpNego* nego);
boolean nego_send_preconnection_pdu(rdpNego* nego);