Clarify the Fast-Path handling in the T.123/X.224 layer
This commit is contained in:
parent
eec94365c4
commit
63ac9d3c42
13
constants.h
13
constants.h
@ -23,6 +23,19 @@
|
|||||||
#define DEFAULT_CODEPAGE "UTF-8"
|
#define DEFAULT_CODEPAGE "UTF-8"
|
||||||
#define WINDOWS_CODEPAGE "UTF-16LE"
|
#define WINDOWS_CODEPAGE "UTF-16LE"
|
||||||
|
|
||||||
|
/* T-REC-T.123-200701, section 8 */
|
||||||
|
#define T123_HEADER_VERSION 0x3
|
||||||
|
|
||||||
|
/* [MS-RDPBCGR] 2.2.9.1.2 */
|
||||||
|
#define FASTPATH_OUTPUT_ACTION_FASTPATH 0x0
|
||||||
|
#define FASTPATH_OUTPUT_ACTION_X224 T123_HEADER_VERSION
|
||||||
|
|
||||||
|
#define FASTPATH_OUTPUT_SECURE_CHECKSUM 0x1
|
||||||
|
#define FASTPATH_OUTPUT_ENCRYPTED 0x2
|
||||||
|
|
||||||
|
#define IS_FASTPATH(hdr) ((hdr & 0x03) == FASTPATH_OUTPUT_ACTION_FASTPATH)
|
||||||
|
#define IS_SLOWPATH(hdr) ((hdr) == FASTPATH_OUTPUT_ACTION_X224)
|
||||||
|
|
||||||
/* [MS-RDPBCGR] 2.2.9.1.2.1 */
|
/* [MS-RDPBCGR] 2.2.9.1.2.1 */
|
||||||
/* adjusted for position in updateHeader */
|
/* adjusted for position in updateHeader */
|
||||||
#define FASTPATH_UPDATETYPE_ORDERS 0x0
|
#define FASTPATH_UPDATETYPE_ORDERS 0x0
|
||||||
|
15
iso.c
15
iso.c
@ -110,16 +110,17 @@ iso_recv_msg(uint8 * code, uint8 * rdpver)
|
|||||||
in_uint8(s, version);
|
in_uint8(s, version);
|
||||||
if (rdpver != NULL)
|
if (rdpver != NULL)
|
||||||
*rdpver = version;
|
*rdpver = version;
|
||||||
if (version == 3)
|
if (IS_SLOWPATH(version))
|
||||||
{
|
{
|
||||||
in_uint8s(s, 1); /* pad */
|
in_uint8s(s, 1); /* reserved */
|
||||||
in_uint16_be(s, length);
|
in_uint16_be(s, length); /* length */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
in_uint8(s, length);
|
in_uint8(s, length); /* length1 */
|
||||||
if (length & 0x80)
|
if (length & 0x80)
|
||||||
{
|
{
|
||||||
|
/* length2 is only present if the most significant bit of length1 is set */
|
||||||
length &= ~0x80;
|
length &= ~0x80;
|
||||||
next_be(s, length);
|
next_be(s, length);
|
||||||
}
|
}
|
||||||
@ -132,7 +133,7 @@ iso_recv_msg(uint8 * code, uint8 * rdpver)
|
|||||||
s = tcp_recv(s, length - 4);
|
s = tcp_recv(s, length - 4);
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (version != 3)
|
if (IS_FASTPATH(version))
|
||||||
return s;
|
return s;
|
||||||
in_uint8s(s, 1); /* hdrlen */
|
in_uint8s(s, 1); /* hdrlen */
|
||||||
in_uint8(s, *code);
|
in_uint8(s, *code);
|
||||||
@ -166,7 +167,7 @@ iso_send(STREAM s)
|
|||||||
s_pop_layer(s, iso_hdr);
|
s_pop_layer(s, iso_hdr);
|
||||||
length = s->end - s->p;
|
length = s->end - s->p;
|
||||||
|
|
||||||
out_uint8(s, 3); /* version */
|
out_uint8(s, T123_HEADER_VERSION); /* version */
|
||||||
out_uint8(s, 0); /* reserved */
|
out_uint8(s, 0); /* reserved */
|
||||||
out_uint16_be(s, length);
|
out_uint16_be(s, length);
|
||||||
|
|
||||||
@ -188,7 +189,7 @@ iso_recv(uint8 * rdpver)
|
|||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (rdpver != NULL)
|
if (rdpver != NULL)
|
||||||
if (*rdpver != 3)
|
if (IS_FASTPATH(*rdpver))
|
||||||
return s;
|
return s;
|
||||||
if (code != ISO_PDU_DT)
|
if (code != ISO_PDU_DT)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user