Beispiel #1
0
        public static void TreeConnectRequest(ConnectToShareType connectToShareType, ModelRequestType modelRequestType)
        {
            Condition.IsTrue(state == ModelState.Connected);
            Condition.IsNull(request);

            request = new ModelTreeConnectRequest(connectToShareType, modelRequestType);
        }
Beispiel #2
0
 public ModelTreeConnectRequest(
     ConnectToShareType connectToShareType,
     ModelRequestType modelRequestType)
     : base(0)
 {
     this.connectToShareType = connectToShareType;
     this.modelRequestType   = modelRequestType;
 }
        public void TreeConnectRequest(ConnectToShareType connectToShareType, ModelRequestType modelRequestType)
        {
            string sharePath = (connectToShareType == ConnectToShareType.ConnectToEncryptedShare) ?
                               Smb2Utility.GetUncPath(testConfig.SutComputerName, testConfig.EncryptedFileShare) : Smb2Utility.GetUncPath(testConfig.SutComputerName, testConfig.BasicFileShare);

            if (modelRequestType == ModelRequestType.EncryptedRequest)
            {
                testClient.EnableSessionSigningAndEncryption(enableSigning: false, enableEncryption: true);
            }
            else
            {
                testClient.EnableSessionSigningAndEncryption(enableSigning: testConfig.SendSignedRequest, enableEncryption: false);
            }

            try
            {
                uint status = 0;
                TREE_CONNECT_Response?treeConnectResponse = null;
                status = testClient.TreeConnect(
                    sharePath,
                    out treeId,
                    checker: (header, response) =>
                {
                    treeConnectResponse = response;
                });

                ShareEncryptDataType shareEncryptDataType = treeConnectResponse.Value.ShareFlags.HasFlag(ShareFlags_Values.SHAREFLAG_ENCRYPT_DATA) ? ShareEncryptDataType.ShareEncryptDataSet : ShareEncryptDataType.ShareEncryptDataNotSet;

                //TODO: To be implemented after TRANSFORM_HEADER added into Smb2FunctionalClient
                ModelResponseType modelResponseType = (modelRequestType == ModelRequestType.EncryptedRequest) ? ModelResponseType.EncryptedResponse : ModelResponseType.UnEncryptedResponse;
                TreeConnectResponse((ModelSmb2Status)status, shareEncryptDataType, modelResponseType, encryptionConfig);
            }
            catch
            {
            }
        }
 public ModelTreeConnectRequest(
     ConnectToShareType connectToShareType,
     ModelRequestType modelRequestType)
     : base(0)
 {
     this.connectToShareType = connectToShareType;
     this.modelRequestType = modelRequestType;
 }
        public static void TreeConnectRequest(ConnectToShareType connectToShareType, ModelRequestType modelRequestType)
        {
            Condition.IsTrue(state == ModelState.Connected);
            Condition.IsNull(request);

            request = new ModelTreeConnectRequest(connectToShareType, modelRequestType);
        }
        public void TreeConnectRequest(ConnectToShareType connectToShareType, ModelRequestType modelRequestType)
        {
            string sharePath = (connectToShareType == ConnectToShareType.ConnectToEncryptedShare) ?
                Smb2Utility.GetUncPath(testConfig.SutComputerName, testConfig.EncryptedFileShare) : Smb2Utility.GetUncPath(testConfig.SutComputerName, testConfig.BasicFileShare);

            if (modelRequestType == ModelRequestType.EncryptedRequest)
            {
                testClient.EnableSessionSigningAndEncryption(enableSigning: false, enableEncryption: true);
            }
            else
            {
                testClient.EnableSessionSigningAndEncryption(enableSigning: testConfig.SendSignedRequest, enableEncryption: false);
            }

            try
            {
                uint status = 0;
                TREE_CONNECT_Response? treeConnectResponse = null;
                status = testClient.TreeConnect(
                    sharePath,
                    out treeId,
                    checker: (header, response) =>
                    {
                        treeConnectResponse = response;
                    });

                ShareEncryptDataType shareEncryptDataType = treeConnectResponse.Value.ShareFlags.HasFlag(ShareFlags_Values.SHAREFLAG_ENCRYPT_DATA) ? ShareEncryptDataType.ShareEncryptDataSet : ShareEncryptDataType.ShareEncryptDataNotSet;

                //TODO: To be implemented after TRANSFORM_HEADER added into Smb2FunctionalClient
                ModelResponseType modelResponseType = (modelRequestType == ModelRequestType.EncryptedRequest) ? ModelResponseType.EncryptedResponse : ModelResponseType.UnEncryptedResponse;
                TreeConnectResponse((ModelSmb2Status)status, shareEncryptDataType, modelResponseType, encryptionConfig);
            }
            catch
            {
            }
        }