libxrdp: remove a global, remove some tabs

ulab-next-nosound
Jay Sorg 10 years ago
parent 831ebe4519
commit 605df27103

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

@ -906,7 +906,8 @@ xrdp_mcs_send_connect_response(struct xrdp_mcs *self)
int APP_CC int APP_CC
xrdp_mcs_incoming(struct xrdp_mcs *self) xrdp_mcs_incoming(struct xrdp_mcs *self)
{ {
int i; int index;
DEBUG((" in xrdp_mcs_incoming")); DEBUG((" in xrdp_mcs_incoming"));
if (xrdp_mcs_recv_connect_initial(self) != 0) if (xrdp_mcs_recv_connect_initial(self) != 0)
@ -945,7 +946,7 @@ xrdp_mcs_incoming(struct xrdp_mcs *self)
return 1; 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) 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, if (xrdp_mcs_send_cjcf(self, self->userid,
self->userid + MCS_USERCHANNEL_BASE + i) != 0) self->userid + MCS_USERCHANNEL_BASE + index) != 0)
{ {
return 1; return 1;
} }

@ -185,8 +185,6 @@ static const tui8 g_fips_ivec[8] =
0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF 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 static void APP_CC
hex_str_to_bin(char *in, char *out, int out_len) 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->server_mcs_data));
self->fastpath_layer = xrdp_fastpath_create(self, trans); self->fastpath_layer = xrdp_fastpath_create(self, trans);
self->chan_layer = xrdp_channel_create(self, self->mcs_layer); self->chan_layer = xrdp_channel_create(self, self->mcs_layer);
self->is_security_header_present = 1;
DEBUG((" out xrdp_sec_create")); DEBUG((" out xrdp_sec_create"));
return self; return self;
@ -448,10 +447,11 @@ xrdp_sec_create(struct xrdp_rdp *owner, struct trans *trans)
/*****************************************************************************/ /*****************************************************************************/
void APP_CC void APP_CC
xrdp_sec_delete(struct xrdp_sec *self) { xrdp_sec_delete(struct xrdp_sec *self)
{
if (self == 0) { if (self == 0)
g_writeln("xrdp_sec_delete: indata is null"); {
g_writeln("xrdp_sec_delete: self is null");
return; return;
} }
@ -490,7 +490,6 @@ xrdp_sec_init(struct xrdp_sec *self, struct stream *s)
} }
else else
{ {
// s_push_layer(s, sec_hdr, 4);
} }
return 0; 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; 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 if (self->crypt_level == CRYPT_LEVEL_NONE
&& self->crypt_method == CRYPT_METHOD_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")); DEBUG((" out xrdp_sec_recv"));

Loading…
Cancel
Save