Example #1
0
        public void S2_DataTransfer_SecurityChannelCreation_LossyConnection()
        {
            CheckSecurityProtocolForMultitransport();

            Site.Log.Add(LogEntryKind.Debug, "Establishing RDP connection ...");
            StartRDPConnection();

            this.TestSite.Log.Add(LogEntryKind.Comment, "Create a Lossy UDP connection.");
            this.EstablishUDPConnection(TransportMode.Lossy, waitTime, true);

            // Set the autoHandle to true, then can be used for create security channel.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Start DTLS handshake.");
            this.rdpeudpSocketL.AutoHandle = true;

            String           certFile = this.Site.Properties["CertificatePath"];
            String           certPwd  = this.Site.Properties["CertificatePassword"];
            X509Certificate2 cert     = new X509Certificate2(certFile, certPwd);

            rdpemtServerL = new RdpemtServer(rdpeudpSocketL, cert, false);

            this.TestSite.Log.Add(LogEntryKind.Comment, "Wait for a RDP_TUNNEL_CREATEREQUEST message from client after security channel creation");

            RDP_TUNNEL_CREATEREQUEST createReq = rdpemtServerL.ExpectTunnelCreateRequest(waitTime);

            Site.Assert.IsNotNull(createReq, "Client should send a RDP_TUNNEL_CREATEREQUEST message after security channel creation.");
        }
        public void S2_DataTransfer_SecurityChannelCreation_ReliableConnection()
        {
            CheckSecurityProtocolForMultitransport();

            Site.Log.Add(LogEntryKind.Debug, "Establishing RDP connection ...");
            StartRDPConnection();

            this.TestSite.Log.Add(LogEntryKind.Comment, "Create a reliable UDP connection.");
            this.EstablishUDPConnection(TransportMode.Reliable, waitTime, true, true);

            // Set the autoHandle to true, then can be used for create security channel.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Start TLS handshake.");

            String certFile;

            PtfPropUtility.GetPtfPropertyValue(Site, "CertificatePath", out certFile);

            String certPwd;

            PtfPropUtility.GetPtfPropertyValue(Site, "CertificatePassword", out certPwd);

            X509Certificate2 cert = new X509Certificate2(certFile, certPwd);

            rdpemtServerR = new RdpemtServer(rdpeudpSocketR, cert, false);

            this.TestSite.Log.Add(LogEntryKind.Comment, "Wait for a RDP_TUNNEL_CREATEREQUEST message from client after security channel creation");
            RDP_TUNNEL_CREATEREQUEST createReq = rdpemtServerR.ExpectTunnelCreateRequest(waitTime);

            Site.Assert.IsNotNull(createReq, "Client should send a RDP_TUNNEL_CREATEREQUEST message after security channel creation.");
        }