From 69a551cdf7993d510de30790682f798b72c30f9b Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 16 Dec 2014 12:20:57 -0800 Subject: [PATCH] libxrdp: indent, no logic change --- libxrdp/xrdp_iso.c | 74 +++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/libxrdp/xrdp_iso.c b/libxrdp/xrdp_iso.c index ed2a11f0..3c012b8f 100644 --- a/libxrdp/xrdp_iso.c +++ b/libxrdp/xrdp_iso.c @@ -51,39 +51,47 @@ xrdp_iso_delete(struct xrdp_iso *self) /*****************************************************************************/ /* returns error */ static int APP_CC -xrdp_iso_negotiate_security(struct xrdp_iso *self) { - int rv = 0; - int server_security_layer = self->mcs_layer->sec_layer->rdp_layer->client_info.security_layer; - - self->selectedProtocol = server_security_layer; - - switch (server_security_layer) { - case PROTOCOL_RDP: - self->rdpNegData = 0; /* no need to send rdp_neg_data back to client */ - break; - case PROTOCOL_SSL: - if (self->requestedProtocol & PROTOCOL_SSL) { - self->selectedProtocol = PROTOCOL_SSL; - } else { - self->failureCode = SSL_REQUIRED_BY_SERVER; - rv = 1; /* error */ - } - break; - case PROTOCOL_HYBRID: - case PROTOCOL_HYBRID_EX: - default: - if (self->requestedProtocol & PROTOCOL_SSL) { - /* thats a patch since we don't support CredSSP for now */ - self->selectedProtocol = PROTOCOL_SSL; - } else { - self->selectedProtocol = PROTOCOL_RDP; - } - break; - } - - DEBUG(("xrdp_iso_negotiate_security: server security layer %d , client security layer %d", - self->selectedProtocol, self->requestedProtocol)); - return rv; +xrdp_iso_negotiate_security(struct xrdp_iso *self) +{ + int rv = 0; + int server_security_layer = self->mcs_layer->sec_layer->rdp_layer->client_info.security_layer; + + self->selectedProtocol = server_security_layer; + + switch (server_security_layer) + { + case PROTOCOL_RDP: + self->rdpNegData = 0; /* no need to send rdp_neg_data back to client */ + break; + case PROTOCOL_SSL: + if (self->requestedProtocol & PROTOCOL_SSL) + { + self->selectedProtocol = PROTOCOL_SSL; + } + else + { + self->failureCode = SSL_REQUIRED_BY_SERVER; + rv = 1; /* error */ + } + break; + case PROTOCOL_HYBRID: + case PROTOCOL_HYBRID_EX: + default: + if (self->requestedProtocol & PROTOCOL_SSL) + { + /* thats a patch since we don't support CredSSP for now */ + self->selectedProtocol = PROTOCOL_SSL; + } + else + { + self->selectedProtocol = PROTOCOL_RDP; + } + break; + } + + DEBUG(("xrdp_iso_negotiate_security: server security layer %d , client security layer %d", + self->selectedProtocol, self->requestedProtocol)); + return rv; } /*****************************************************************************/