libxrdp: remove a global, remove some tabs

This commit is contained in:
Jay Sorg 2014-11-06 16:51:39 -08:00
parent 831ebe4519
commit 605df27103
3 changed files with 40 additions and 38 deletions

View File

@ -129,6 +129,7 @@ struct xrdp_sec
void *encrypt_fips_info;
void *decrypt_fips_info;
void *sign_fips_info;
int is_security_header_present; /* boolean */
};
/* channel */

View File

@ -906,7 +906,8 @@ xrdp_mcs_send_connect_response(struct xrdp_mcs *self)
int APP_CC
xrdp_mcs_incoming(struct xrdp_mcs *self)
{
int i;
int index;
DEBUG((" in xrdp_mcs_incoming"));
if (xrdp_mcs_recv_connect_initial(self) != 0)
@ -945,7 +946,7 @@ xrdp_mcs_incoming(struct xrdp_mcs *self)
return 1;
}
for (i = 0; i < self->channel_list->count + 2; i++)
for (index = 0; index < self->channel_list->count + 2; index++)
{
if (xrdp_mcs_recv_cjrq(self) != 0)
{
@ -953,7 +954,7 @@ xrdp_mcs_incoming(struct xrdp_mcs *self)
}
if (xrdp_mcs_send_cjcf(self, self->userid,
self->userid + MCS_USERCHANNEL_BASE + i) != 0)
self->userid + MCS_USERCHANNEL_BASE + index) != 0)
{
return 1;
}

View File

@ -185,8 +185,6 @@ static const tui8 g_fips_ivec[8] =
0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF
};
static int is_security_header_present = 1; /* next packet should contain security header? */
/*****************************************************************************/
static void APP_CC
hex_str_to_bin(char *in, char *out, int out_len)
@ -441,6 +439,7 @@ xrdp_sec_create(struct xrdp_rdp *owner, struct trans *trans)
&(self->server_mcs_data));
self->fastpath_layer = xrdp_fastpath_create(self, trans);
self->chan_layer = xrdp_channel_create(self, self->mcs_layer);
self->is_security_header_present = 1;
DEBUG((" out xrdp_sec_create"));
return self;
@ -448,10 +447,11 @@ xrdp_sec_create(struct xrdp_rdp *owner, struct trans *trans)
/*****************************************************************************/
void APP_CC
xrdp_sec_delete(struct xrdp_sec *self) {
if (self == 0) {
g_writeln("xrdp_sec_delete: indata is null");
xrdp_sec_delete(struct xrdp_sec *self)
{
if (self == 0)
{
g_writeln("xrdp_sec_delete: self is null");
return;
}
@ -490,7 +490,6 @@ xrdp_sec_init(struct xrdp_sec *self, struct stream *s)
}
else
{
// s_push_layer(s, sec_hdr, 4);
}
return 0;
@ -1209,7 +1208,7 @@ xrdp_sec_recv(struct xrdp_sec *self, struct stream *s, int *chan)
}
if (!is_security_header_present)
if (!(self->is_security_header_present))
{
return 0;
}
@ -1326,7 +1325,8 @@ xrdp_sec_recv(struct xrdp_sec *self, struct stream *s, int *chan)
if (self->crypt_level == CRYPT_LEVEL_NONE
&& self->crypt_method == CRYPT_METHOD_NONE)
{
is_security_header_present = 0; /* in tls mode, no more security header from now on */
/* in tls mode, no more security header from now on */
self->is_security_header_present = 0;
}
DEBUG((" out xrdp_sec_recv"));