Skip to content

Commit 09e1173

Browse files
gpotter2matt335672
andcommitted
Apply suggestions
Co-Authored-By: matt335672 <30179339+matt335672@users.noreply.github.com>
1 parent f0bae00 commit 09e1173

File tree

2 files changed

+17
-32
lines changed

2 files changed

+17
-32
lines changed

libxrdp/xrdp_iso.c

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -129,40 +129,25 @@ xrdp_iso_negotiate_security(struct xrdp_iso *self)
129129
protostr);
130130
security_type_mask &= self->requestedProtocol;
131131

132-
/* In VMConnect mode, we support everything. */
133-
if (client_info->vmconnect && (self->requestedProtocol > PROTOCOL_RDP))
132+
if (security_type_mask & PROTOCOL_HYBRID_EX)
134133
{
135-
if (security_type_mask & PROTOCOL_HYBRID_EX)
136-
{
137-
LOG(LOG_LEVEL_INFO, "Selected HYBRID_EX security");
138-
self->selectedProtocol = PROTOCOL_HYBRID_EX;
139-
got_protocol = 1;
140-
}
141-
else if (security_type_mask & PROTOCOL_HYBRID)
142-
{
143-
LOG(LOG_LEVEL_INFO, "Selected HYBRID security");
144-
self->selectedProtocol = PROTOCOL_HYBRID;
145-
got_protocol = 1;
146-
}
147-
else if (security_type_mask & PROTOCOL_SSL)
148-
{
149-
LOG(LOG_LEVEL_INFO, "Selected TLS security");
150-
self->selectedProtocol = PROTOCOL_SSL;
151-
got_protocol = 1;
152-
}
153-
else
154-
{
155-
/* Impossible */
156-
LOG(LOG_LEVEL_ERROR, "Impossible case.");
157-
rv = 1;
158-
}
134+
/* Currently supported by VMConnect mode only */
135+
LOG(LOG_LEVEL_INFO, "Selected HYBRID_EX security");
136+
self->selectedProtocol = PROTOCOL_HYBRID_EX;
137+
got_protocol = 1;
138+
}
139+
else if (security_type_mask & PROTOCOL_HYBRID)
140+
{
141+
/* Currently supported by VMConnect mode only */
142+
LOG(LOG_LEVEL_INFO, "Selected HYBRID security");
143+
self->selectedProtocol = PROTOCOL_HYBRID;
144+
got_protocol = 1;
159145
}
160-
/* Is there a match on SSL/TLS? */
161146
else if ((security_type_mask & PROTOCOL_SSL) != 0)
162147
{
163-
/* Can we do TLS? (basic check) */
164-
if (g_file_readable(client_info->certificate) &&
165-
g_file_readable(client_info->key_file))
148+
/* Can we do TLS? (basic check). VMConnect is exempt. */
149+
if ((g_file_readable(client_info->certificate) &&
150+
g_file_readable(client_info->key_file)) || client_info->vmconnect)
166151
{
167152
LOG(LOG_LEVEL_INFO, "Selected TLS security");
168153
self->selectedProtocol = PROTOCOL_SSL;

xrdp/xrdp.ini.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ port=3389
2727
; prefer use vsock://<cid>:<port> above
2828
use_vsock=false
2929

30-
; if used inside a Hyper-V VM with vmconnect, turn this on to enable
31-
; wider protocol support.
30+
; if used inside a Hyper-V VM through vmconnect and bound on vsock,
31+
; turn this on to enable wider security protocol support.
3232
#vmconnect=true
3333

3434
; Unprivileged User name and group to run the xrdp daemon.

0 commit comments

Comments
 (0)