Fix Fast-Path PDU decryption regression

This solves a problem where rdesktop would get really confused about
the data read from the server and crash in random places just after
connecting.
This commit is contained in:
Karl Mikaelsson 2018-02-02 17:13:36 +01:00
parent fe8438d5c3
commit 08c293b405

View File

@ -844,7 +844,7 @@ sec_process_mcs_data(STREAM s)
STREAM STREAM
sec_recv(RD_BOOL *is_fastpath) sec_recv(RD_BOOL *is_fastpath)
{ {
uint8 fastpath_hdr; uint8 fastpath_hdr, fastpath_flags;
uint16 sec_flags; uint16 sec_flags;
uint16 channel; uint16 channel;
STREAM s; STREAM s;
@ -855,7 +855,9 @@ sec_recv(RD_BOOL *is_fastpath)
{ {
/* If fastpath packet is encrypted, read data /* If fastpath packet is encrypted, read data
signature and decrypt */ signature and decrypt */
if (fastpath_hdr & FASTPATH_OUTPUT_ENCRYPTED) /* FIXME: extracting flags from hdr could be made less obscure */
fastpath_flags = (fastpath_hdr & 0xC0) >> 6;
if (fastpath_flags & FASTPATH_OUTPUT_ENCRYPTED)
{ {
in_uint8s(s, 8); /* signature */ in_uint8s(s, 8); /* signature */
sec_decrypt(s->p, s->end - s->p); sec_decrypt(s->p, s->end - s->p);