mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
core: terminate redirect cookies correctly
This commit is contained in:
parent
b5133db680
commit
6752fb4983
@ -243,10 +243,10 @@ boolean rdp_read_client_auto_reconnect_cookie(STREAM* s, rdpSettings* settings)
|
|||||||
if (stream_get_left(s) < 28)
|
if (stream_get_left(s) < 28)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stream_write_uint32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */
|
stream_read_uint32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */
|
||||||
stream_write_uint32(s, autoReconnectCookie->version); /* version (4 bytes) */
|
stream_read_uint32(s, autoReconnectCookie->version); /* version (4 bytes) */
|
||||||
stream_write_uint32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */
|
stream_read_uint32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */
|
||||||
stream_write(s, autoReconnectCookie->securityVerifier, 16); /* SecurityVerifier */
|
stream_read(s, autoReconnectCookie->securityVerifier, 16); /* SecurityVerifier */
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -473,7 +473,6 @@ void rdp_write_info_packet(STREAM* s, rdpSettings* settings)
|
|||||||
uint16 cbUserName;
|
uint16 cbUserName;
|
||||||
uint8* password;
|
uint8* password;
|
||||||
uint16 cbPassword;
|
uint16 cbPassword;
|
||||||
size_t passwordLength;
|
|
||||||
uint8* alternateShell;
|
uint8* alternateShell;
|
||||||
uint16 cbAlternateShell;
|
uint16 cbAlternateShell;
|
||||||
uint8* workingDir;
|
uint8* workingDir;
|
||||||
@ -516,13 +515,12 @@ void rdp_write_info_packet(STREAM* s, rdpSettings* settings)
|
|||||||
{
|
{
|
||||||
usedPasswordCookie = true;
|
usedPasswordCookie = true;
|
||||||
password = (uint8*)settings->password_cookie->data;
|
password = (uint8*)settings->password_cookie->data;
|
||||||
passwordLength = settings->password_cookie->length;
|
cbPassword = settings->password_cookie->length - 2; /* Strip double zero termination */
|
||||||
cbPassword = passwordLength - 2;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
password = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->password, &passwordLength);
|
password = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->password, &length);
|
||||||
cbPassword = passwordLength;
|
cbPassword = length;
|
||||||
}
|
}
|
||||||
|
|
||||||
alternateShell = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->shell, &length);
|
alternateShell = (uint8*)freerdp_uniconv_out(settings->uniconv, settings->shell, &length);
|
||||||
@ -549,7 +547,7 @@ void rdp_write_info_packet(STREAM* s, rdpSettings* settings)
|
|||||||
stream_write_uint16(s, 0);
|
stream_write_uint16(s, 0);
|
||||||
|
|
||||||
if (cbPassword > 0)
|
if (cbPassword > 0)
|
||||||
stream_write(s, password, passwordLength);
|
stream_write(s, password, cbPassword);
|
||||||
stream_write_uint16(s, 0);
|
stream_write_uint16(s, 0);
|
||||||
|
|
||||||
if (cbAlternateShell > 0)
|
if (cbAlternateShell > 0)
|
||||||
|
@ -105,7 +105,7 @@ boolean rdp_recv_server_redirection_pdu(rdpRdp* rdp, STREAM* s)
|
|||||||
if (redirection->flags & LB_PASSWORD)
|
if (redirection->flags & LB_PASSWORD)
|
||||||
{
|
{
|
||||||
uint32 passwordLength;
|
uint32 passwordLength;
|
||||||
stream_read_uint32(s, passwordLength);
|
stream_read_uint32(s, passwordLength); /* Note: length (hopefully) includes double zero termination */
|
||||||
freerdp_blob_alloc(&redirection->password_cookie, passwordLength);
|
freerdp_blob_alloc(&redirection->password_cookie, passwordLength);
|
||||||
stream_read(s, redirection->password_cookie.data, passwordLength);
|
stream_read(s, redirection->password_cookie.data, passwordLength);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user