libxrdp: fix for 'low' RDP security level (issue #202)

This commit is contained in:
speidy 2014-12-15 22:12:16 +02:00
parent bf622c46a6
commit 5e89424129

View File

@ -480,6 +480,8 @@ xrdp_sec_init(struct xrdp_sec *self, struct stream *s)
return 1; return 1;
} }
if (self->crypt_level > CRYPT_LEVEL_NONE) /* RDP encryption */
{
if (self->crypt_level == CRYPT_LEVEL_FIPS) if (self->crypt_level == CRYPT_LEVEL_FIPS)
{ {
s_push_layer(s, sec_hdr, 4 + 4 + 8); s_push_layer(s, sec_hdr, 4 + 4 + 8);
@ -488,8 +490,10 @@ xrdp_sec_init(struct xrdp_sec *self, struct stream *s)
{ {
s_push_layer(s, sec_hdr, 4 + 8); s_push_layer(s, sec_hdr, 4 + 8);
} }
else else if (self->crypt_level)
{ {
s_push_layer(s, sec_hdr, 4);
}
} }
return 0; return 0;
@ -1408,6 +1412,8 @@ xrdp_sec_send(struct xrdp_sec *self, struct stream *s, int chan)
DEBUG((" in xrdp_sec_send")); DEBUG((" in xrdp_sec_send"));
s_pop_layer(s, sec_hdr); s_pop_layer(s, sec_hdr);
if (self->crypt_level > CRYPT_LEVEL_NONE)
{
if (self->crypt_level == CRYPT_LEVEL_FIPS) if (self->crypt_level == CRYPT_LEVEL_FIPS)
{ {
LLOGLN(10, ("xrdp_sec_send: fips")); LLOGLN(10, ("xrdp_sec_send: fips"));
@ -1431,7 +1437,8 @@ xrdp_sec_send(struct xrdp_sec *self, struct stream *s, int chan)
} }
else else
{ {
// out_uint32_le(s, 0); out_uint32_le(s, 0);
}
} }
if (xrdp_mcs_send(self->mcs_layer, s, chan) != 0) if (xrdp_mcs_send(self->mcs_layer, s, chan) != 0)