summaryrefslogtreecommitdiffstats
path: root/libxrdp/xrdp_mcs.c
diff options
context:
space:
mode:
authorIdan Freiberg <speidy@gmail.com>2014-07-15 18:29:40 +0300
committerIdan Freiberg <speidy@gmail.com>2014-07-15 18:29:40 +0300
commitf0b6c6b1d178419ae82ad1c8ea2d74c97cc2f27b (patch)
tree4507c5940fa37c55c717dca7244faea0ed1507a5 /libxrdp/xrdp_mcs.c
parent5fcf6beffa3367b8b313bf4414ffd6b3419c76d1 (diff)
downloadxrdp-proprietary-f0b6c6b1d178419ae82ad1c8ea2d74c97cc2f27b.tar.gz
xrdp-proprietary-f0b6c6b1d178419ae82ad1c8ea2d74c97cc2f27b.zip
libxrdp: started adding TLS support
Diffstat (limited to 'libxrdp/xrdp_mcs.c')
-rw-r--r--libxrdp/xrdp_mcs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libxrdp/xrdp_mcs.c b/libxrdp/xrdp_mcs.c
index c1b0b908..df4f81f5 100644
--- a/libxrdp/xrdp_mcs.c
+++ b/libxrdp/xrdp_mcs.c
@@ -755,6 +755,21 @@ xrdp_mcs_incoming(struct xrdp_mcs *self)
return 1;
}
+ /* tls */
+ if (PROTOCOL_SSL & self->iso_layer->selectedProtocol)
+ {
+ g_writeln("xrdp_mcs_incoming: TLS mode!");
+ self->sec_layer->crypt_level = CRYPT_LEVEL_NONE;
+ self->sec_layer->crypt_method = CRYPT_METHOD_NONE;
+
+ if (xrdp_tls_accept(self->sec_layer->tls) != 0)
+ {
+ g_writeln("xrdp_mcs_incoming: ssl_tls_accept failed");
+ return 1;
+ }
+ g_writeln("xrdp_mcs_incoming: ssl_tls_accept done!!!!");
+ }
+
if (xrdp_mcs_recv_connect_initial(self) != 0)
{
return 1;
@@ -961,6 +976,7 @@ xrdp_mcs_disconnect(struct xrdp_mcs *self)
if (xrdp_iso_init(self->iso_layer, s) != 0)
{
+ xrdp_tls_disconnect(self->sec_layer->tls);
free_stream(s);
close_rdp_socket(self);
DEBUG((" out xrdp_mcs_disconnect error - 1"));
@@ -973,12 +989,14 @@ xrdp_mcs_disconnect(struct xrdp_mcs *self)
if (xrdp_iso_send(self->iso_layer, s) != 0)
{
+ xrdp_tls_disconnect(self->sec_layer->tls);
free_stream(s);
close_rdp_socket(self);
DEBUG((" out xrdp_mcs_disconnect error - 2"));
return 1;
}
+ xrdp_tls_disconnect(self->sec_layer->tls);
free_stream(s);
close_rdp_socket(self);
DEBUG(("xrdp_mcs_disconnect - close sent"));