public void AppInstanceId_Negative_NoEncryptionInInitialOpen_EncryptionInReOpen() { #region Check Applicability TestConfig.CheckServerEncrypt(); #endregion AppInstanceIdTestWithEncryption(encryptionInInitialOpen: false, encryptionInReOpen: true); }
public void MultipleChannel_Negative_EncryptionOnMainChannel() { #region Check Applicability TestConfig.CheckServerEncrypt(); #endregion uncSharePath = Smb2Utility.GetUncPath(TestConfig.SutComputerName, TestConfig.EncryptedFileShare); uint treeId; FILEID fileId; BaseTestSite.Log.Add( LogEntryKind.TestStep, "Establish main channel with client {0} and server {1}, encryption is enabled.", clientIps[0].ToString(), serverIps[0].ToString()); EstablishMainChannel( TestConfig.RequestDialects, serverIps[0], clientIps[0], out treeId, true); #region CREATE BaseTestSite.Log.Add(LogEntryKind.TestStep, "Main channel: Create file {0}.", fileName); Smb2CreateContextResponse[] serverCreateContexts; status = mainChannelClient.Create( treeId, fileName, CreateOptions_Values.FILE_NON_DIRECTORY_FILE | CreateOptions_Values.FILE_DELETE_ON_CLOSE, out fileId, out serverCreateContexts); #endregion #region WRITE BaseTestSite.Log.Add(LogEntryKind.TestStep, "Main channel: Write content to file."); status = mainChannelClient.Write(treeId, fileId, contentWrite); #endregion BaseTestSite.Log.Add( LogEntryKind.TestStep, "Establish alternative channel with client {0} and server {1}, encryption is NOT enabled.", clientIps[1].ToString(), serverIps[1].ToString()); EstablishAlternativeChannel( TestConfig.RequestDialects, serverIps[1], clientIps[1], treeId, false); #region READ // Skip the verification of signature when sending a non-encrypted CREATE request to an encrypted share alternativeChannelClient.Smb2Client.DisableVerifySignature = true; BaseTestSite.Log.Add(LogEntryKind.TestStep, "Alternative channel: Read content from file."); status = alternativeChannelClient.Read( treeId, fileId, 0, (uint)contentWrite.Length, out contentRead, checker: (header, response) => { BaseTestSite.Log.Add(LogEntryKind.TestStep, "Verify Server response indicates that read content failed."); BaseTestSite.Assert.AreNotEqual( Smb2Status.STATUS_SUCCESS, header.Status, "Read data from file should not success"); BaseTestSite.CaptureRequirementIfAreEqual( Smb2Status.STATUS_ACCESS_DENIED, header.Status, RequirementCategory.STATUS_ACCESS_DENIED.Id, RequirementCategory.STATUS_ACCESS_DENIED.Description); }); #endregion }