Skip to content

Commit 8e5875e

Browse files
authored
Merge pull request #3777 from gpotter2/rename-rdpflags
Rename RDP_INFO flags to spec names
2 parents 36fbebc + 42b830f commit 8e5875e

2 files changed

Lines changed: 20 additions & 15 deletions

File tree

common/ms-rdpbcgr.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,18 @@
152152
#define SEC_TAG_KEYSIG 0x0008 /* BB_SIGNATURE_KEY_BLOB */
153153

154154
/* Info Packet (TS_INFO_PACKET): flags (2.2.1.11.1.1) */
155-
/* TODO: to be renamed */
156-
#define RDP_LOGON_AUTO 0x0008
157-
#define RDP_LOGON_NORMAL 0x0033
158-
#define RDP_COMPRESSION 0x0080
159-
#define RDP_LOGON_BLOB 0x0100
160-
#define RDP_LOGON_LEAVE_AUDIO 0x2000
161-
#define RDP_LOGON_RAIL 0x8000
155+
#define INFO_MOUSE 0x00000001
156+
#define INFO_DISABLECTRLALTDEL 0x00000002
157+
#define INFO_AUTOLOGON 0x00000008
158+
#define INFO_UNICODE 0x00000010
159+
#define INFO_MAXIMIZESHELL 0x00000020
160+
#define INFO_LOGONNOTIFY 0x00000040
161+
#define INFO_COMPRESSION 0x00000080
162+
#define INFO_ENABLEWINDOWSKEY 0x00000100
163+
#define INFO_REMOTECONSOLEAUDIO 0x00002000
164+
#define INFO_RAIL 0x00008000
165+
/* Windows always sends at least 0x33 */
166+
#define INFO_LOGON_NORMAL (INFO_MOUSE | INFO_DISABLECTRLALTDEL | INFO_UNICODE | INFO_MAXIMIZESHELL)
162167

163168
/* Extended Info Packet: clientAddress (2.2.1.11.1.1.1) */
164169
#define EXTENDED_INFO_MAX_CLIENT_ADDR_LENGTH 80

libxrdp/xrdp_sec.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -410,30 +410,30 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
410410
LOG_DEVEL(LOG_LEVEL_TRACE, "Parsing [MS-RDPBCGR] TS_INFO_PACKET");
411411

412412
/* this is the first test that the decrypt is working */
413-
if ((flags & RDP_LOGON_NORMAL) != RDP_LOGON_NORMAL) /* 0x33 */
413+
if ((flags & INFO_LOGON_NORMAL) != INFO_LOGON_NORMAL) /* 0x33 */
414414
{
415415
/* must be or error */
416416
LOG(LOG_LEVEL_ERROR, "received wrong flags, likely decrypt not working");
417417
return 1;
418418
}
419419

420-
if (flags & RDP_LOGON_LEAVE_AUDIO)
420+
if (flags & INFO_REMOTECONSOLEAUDIO)
421421
{
422422
self->rdp_layer->client_info.sound_code = 1;
423423
LOG_DEVEL(LOG_LEVEL_DEBUG, "[MS-RDPBCGR] TS_INFO_PACKET flag INFO_REMOTECONSOLEAUDIO found");
424424
LOG(LOG_LEVEL_DEBUG,
425425
"Client requested that audio on the server be played on the server.");
426426
}
427427

428-
if (flags & RDP_LOGON_RAIL)
428+
if (flags & INFO_RAIL)
429429
{
430430
self->rdp_layer->client_info.rail_enable = 1;
431431
LOG_DEVEL(LOG_LEVEL_DEBUG, "[MS-RDPBCGR] TS_INFO_PACKET flag INFO_RAIL found");
432432
LOG(LOG_LEVEL_DEBUG,
433433
"Client requested Remote Application Integrated Locally (RAIL).");
434434
}
435435

436-
if (flags & RDP_LOGON_AUTO)
436+
if (flags & INFO_AUTOLOGON)
437437
{
438438
LOG_DEVEL(LOG_LEVEL_DEBUG, "[MS-RDPBCGR] TS_INFO_PACKET flag INFO_AUTOLOGON found");
439439
/* todo, for now not allowing autologon and mce both */
@@ -448,7 +448,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
448448
}
449449
}
450450

451-
if (flags & RDP_COMPRESSION)
451+
if (flags & INFO_COMPRESSION)
452452
{
453453
LOG_DEVEL(LOG_LEVEL_DEBUG, "[MS-RDPBCGR] TS_INFO_PACKET flag INFO_COMPRESSION found, "
454454
"CompressionType 0x%1.1x", (flags & 0x00001E00) >> 9);
@@ -574,7 +574,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
574574
// If we require credentials, don't continue if they're not provided
575575
if (self->rdp_layer->client_info.require_credentials)
576576
{
577-
if ((flags & RDP_LOGON_AUTO) == 0)
577+
if ((flags & INFO_AUTOLOGON) == 0)
578578
{
579579
LOG(LOG_LEVEL_ERROR, "Server is configured to require that the "
580580
"client enable auto logon with credentials, but the client did "
@@ -590,7 +590,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
590590
}
591591
}
592592

593-
if (flags & RDP_LOGON_AUTO)
593+
if (flags & INFO_AUTOLOGON)
594594
{
595595
if (ts_info_utf16_in(s, len_password, self->rdp_layer->client_info.password, sizeof(self->rdp_layer->client_info.password)) != 0)
596596
{
@@ -657,7 +657,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s)
657657

658658
/* TODO: explain why the windows key flag is used to determine if the
659659
TS_EXTENDED_INFO_PACKET should be parsed */
660-
if (flags & RDP_LOGON_BLOB) /* INFO_ENABLEWINDOWSKEY */
660+
if (flags & INFO_ENABLEWINDOWSKEY)
661661
{
662662
if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] TS_EXTENDED_INFO_PACKET "
663663
"clientAddressFamily and cbClientAddress"))

0 commit comments

Comments
 (0)