public static void TreeConnectResponse(
            int messageId,
            int sessionId,
            int treeId,
            bool isSecuritySignatureZero,
            ShareType shareType,
            MessageStatus messageStatus,
            bool isSigned,
            bool isDfsShare,
            bool isSupportExtSignature)
        {
            Checker.CheckTreeConnectResponse(
                smbConnection,
                messageId,
                sessionId,
                treeId,
                isSigned,
                isSecuritySignatureZero,
                shareType,
                smbState,
                messageStatus,
                MessageStatus.Success);

            TreeConnectRequest request = (TreeConnectRequest)smbConnection.sentRequest[messageId];

            if (request.shareName == Parameter.shareFileNames[2])
            {
                Condition.IsTrue(Parameter.isSupportDfs && isDfsShare);
            }
            else
            {
                Condition.IsTrue(!isDfsShare);
            }
            if (request.isRequestExtSignature)
            {
                Condition.IsTrue(isSupportExtSignature);
            }
            else if (!request.isRequestExtSignature)
            {
                Condition.IsTrue(!isSupportExtSignature);
            }

            Update.UpdateTreeConnectResponse(smbConnection, messageId, sessionId, treeId, shareType);

            smbState = SmbState.TreeConnectSuccess;
        }
 public static void TreeMultipleConnectRequest(
     int messageId,
     int sessionId,
     bool isTidDisconnectionSet,
     bool isRequestExtSignature,
     bool isRequestExtResponse,
     string share,
     ShareType shareType,
     bool isSigned)
 {
     Checker.CheckTreeMultipleConnectRequest(
         smbConnection,
         messageId,
         sessionId,
         smbState,
         isSigned,
         share,
         shareType);
     smbRequest = new TreeConnectRequest(
         messageId,
         sessionId,
         isTidDisconnectionSet,
         isRequestExtSignature,
         isRequestExtResponse,
         share,
         shareType);
     Update.UpdateTreeConnectRequest(smbConnection, smbRequest);
     smbState = SmbState.TreeConnectSent;
 }
        public static void NegotiateResponse(
            int messageId,
            bool isSignatureRequired,
            bool isSignatureEnabled,
            int dialectIndex,
            [Domain("SutCapabilities")] Set<Capabilities> sutCapabilities,
            MessageStatus messageStatus)
        {
            Checker.CheckNegotiateResponse(
                smbConnection,
                messageId,
                smbState,
                messageStatus,
                MessageStatus.Success);
            Condition.IsTrue(
                !((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.Contains(Dialect.Invalid));
            Condition.IsTrue(messageStatus == MessageStatus.Success);
            Condition.IsTrue(!sutCapabilities.Contains(Capabilities.None));
            Condition.IsTrue(
                (dialectIndex >= 0)
                    && (dialectIndex < ((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.Count));
            Condition.IsTrue(
                dialectIndex
                    == ((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.IndexOf(Dialect.NtLanMan));

            if (smbConnection.isClientSupportExtSecurity)
            {
                if (Parameter.sutPlatform != Platform.NonWindows)
                {
                    if (Parameter.sutPlatform == Platform.Win2K
                            || Parameter.sutPlatform == Platform.Win2K3
                            || Parameter.sutPlatform == Platform.Win2K8
                            || Parameter.sutPlatform == Platform.Win2K8R2)
                    {
                        Condition.IsTrue(sutCapabilities.Contains(Capabilities.CapExtendedSecurity));
                    }
                }
            }
            else if (!smbConnection.isClientSupportExtSecurity)
            {
                Condition.IsTrue(!sutCapabilities.Contains(Capabilities.CapExtendedSecurity));
            }

            if (Parameter.isSupportDfs)
            {
                Condition.IsTrue(sutCapabilities.Contains(Capabilities.CapDfs));
            }
            else
            {
                Condition.IsTrue(!sutCapabilities.Contains(Capabilities.CapDfs));
            }

            switch (Parameter.sutSignState)
            {
                case SignState.Required:
                    Condition.IsTrue(isSignatureRequired && isSignatureEnabled);
                    break;
                case SignState.Enabled:
                    Condition.IsTrue(!isSignatureRequired && isSignatureEnabled);
                    break;
                case SignState.Disabled:
                case SignState.DisabledUnlessRequired:
                    Condition.IsTrue(!isSignatureRequired && !isSignatureEnabled);
                    break;
                default:
                    break;
            }

            // If the result is Blocked (Client:Required & Server:Disabled, Client:Disabled & Server:Required), the
            // underlying transport connection must be closed.
            if (((smbConnection.clientSignState == SignState.Disabled)
                    && (Parameter.sutSignState == SignState.Required))
                || ((smbConnection.clientSignState == SignState.Required)
                    && (Parameter.sutSignState == SignState.Disabled)))
            {
                smbState = SmbState.Closed;
            }
            else
            {
                smbState = SmbState.NegotiateSuccess;
            }

            if (Parameter.sutPlatform != Platform.NonWindows)
            {
                if (smbConnection.isClientSupportExtSecurity
                        && sutCapabilities.Contains(Capabilities.CapExtendedSecurity))
                {
                    ModelHelper.CaptureRequirement(
                        2308,
                        "[In Receiving an SMB_COM_NEGOTIATE Request] Generating Extended Security Token: If the client " +
                        "indicated support for extended security by setting SMB_FLAGS2_EXTENDED_SECURITY in the Flags2 " +
                        "field of the SMB header of the SMB_COM_NEGOTIATE request, then the SUT sets " +
                        "CAP_EXTENDED_SECURITY in the SMB_COM_NEGOTIATE response in windows if it supports extended " +
                        "security.");
                }
            }

            // The client has received the response from the SUT.
            ModelHelper.CaptureRequirement(
                4747,
                "[In Receiving an SMB_COM_NEGOTIATE Request] Generating Extended Security Token: The SMB_COM_NEGOTIATE " +
                "response packet is sent to the client.<113>");

            Update.UpdateNegotiateResponse(smbConnection, messageId, Parameter.sutSignState, sutCapabilities);
        }
 public static void SmbConnectionResponse(Platform clientPlatform, Platform sutPlatform)
 {
     Condition.IsTrue(smbState == SmbState.ConnectionRequest);
     Condition.IsTrue(clientPlatform == Platform.Win2K
                         || clientPlatform == Platform.WinXP
                         || clientPlatform == Platform.WinVista
                         || clientPlatform == Platform.NonWindows
                         || clientPlatform == Platform.Win7);
     Condition.IsTrue(sutPlatform == Platform.WinNt
                         || sutPlatform == Platform.Win2K3
                         || sutPlatform == Platform.Win2K8
                         || sutPlatform == Platform.NonWindows
                         || sutPlatform == Platform.Win2K8R2);
     Parameter.clientPlatform = clientPlatform;
     Parameter.sutPlatform = sutPlatform;
     smbState = SmbState.ConnectionSuccess;
 }
        public static void ErrorSessionSetupResponse(int messageId, MessageStatus messageStatus)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(messageStatus == MessageStatus.NetworkSessionExpired);
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.SmbComSessionSetup);

            if (messageStatus == MessageStatus.NetworkSessionExpired)
            {
                ModelHelper.CaptureRequirement(
                    4732,
                    @"[In Receiving Any Message]Session Validation and Re-authentication: [If
                    Connection.SessionTable[UID].AuthenticationState is equal to Expired] Otherwise[if a session renewal
                    is indicated], the server MUST fail this operation with STATUS_NETWORK_SESSION_EXPIRED.");
                ModelHelper.CaptureRequirement(
                    4765,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Determine Reauth or Continuation of Previous
                    Auth: The server MUST prevent any further operations from executing on this session until
                    authentication is complete, and fail them with STATUS_NETWORK_SESSION_EXPIRED.");
            }
            smbState = SmbState.Closed;
            smbConnection.sentRequest.Remove(messageId);
        }
        public static void ErrorTreeConnectResponse(int messageId, MessageStatus messageStatus, bool isRs357Implemented)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(messageStatus == MessageStatus.NetworkSessionExpired
                                || messageStatus == MessageStatus.StatusBadNetWorkName || messageStatus == MessageStatus.InvalidSmb);
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.SmbComTreeConnect);
            TreeConnectRequest request = (TreeConnectRequest)smbConnection.sentRequest[messageId];

            if (request.isTidDisconnectionSet && messageStatus == MessageStatus.StatusBadNetWorkName)
            {
                if (isRs357Implemented)
                {
                    ModelHelper.CaptureRequirement(
                        357,
                        @"[In Client Request Extensions,TREE_CONNECT_ANDX_DISCONNECT_TID]If set, the tree connect
                        specified by the TID in the SMB header of the request SHOULD be disconnected when the server
                        sends the response.");

                    if (Parameter.sutPlatform != Platform.NonWindows)
                    {
                        ModelHelper.CaptureRequirement(
                            10357,
                            @"[In Client Request Extensions,TREE_CONNECT_ANDX_DISCONNECT_TID]If set, the tree connect
                            specified by the TID in the SMB header of the request is disconnected when the server sends
                            the response in Windows.");
                    }
                }
            }

            if (request.isTidDisconnectionSet && messageStatus == MessageStatus.InvalidSmb)
            {
                if (isRs357Implemented)
                {
                    ModelHelper.CaptureRequirement(
                        357,
                        @"[In Client Request Extensions,TREE_CONNECT_ANDX_DISCONNECT_TID]If set, the tree connect
                        specified by the TID in the SMB header of the request SHOULD be disconnected when the server
                        sends the response.");

                    if (Parameter.sutPlatform != Platform.NonWindows)
                    {
                        ModelHelper.CaptureRequirement(
                            10357,
                            @"[In Client Request Extensions,TREE_CONNECT_ANDX_DISCONNECT_TID]If set, the tree connect
                            specified by the TID in the SMB header of the request is disconnected when the server sends
                            the response in Windows.");
                    }
                }
            }

            if (messageStatus == MessageStatus.NetworkSessionExpired)
            {

            }

            smbConnection.sessionList.Remove(request.sessionId);
            smbState = SmbState.Closed;
            smbConnection.sentRequest.Remove(messageId);
        }
        public static void SessionClose(int sessionId)
        {
            Condition.IsTrue(smbState == SmbState.End);
            Condition.IsTrue(smbConnection.sessionList.ContainsKey(sessionId));

            ModelHelper.CaptureRequirement(
                2299,
                "[In Receiving Any Message]Signing: If the signature on the received packet is incorrect, the " +
                "server SHOULD<111> terminate the connection.");

            smbState = SmbState.Closed;
        }
        public static void ErrorNegotiateResponse(int messageId, MessageStatus messageStatus)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(messageStatus == MessageStatus.ErrorGenFailure);
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.SmbComNegotiate);

            if (((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.Contains(Dialect.LanMan21))
            {
                ModelHelper.CaptureRequirement(
                    8579,
                    "[In Sending Any Error Response Message] <110> Section 3.3.4.1.1: If the negotiated dialect " +
                    "is DOS LANMAN 2.1, an ERROR_GEN_FAILURE error is returned.");
            }

            if (((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.Contains(Dialect.LanMan10))
            {
                ModelHelper.CaptureRequirement(
                    8580,
                    "[In Sending Any Error Response Message] <110> Section 3.3.4.1.1: If the negotiated dialect is " +
                    "prior to LANMAN 1.0, an ERROR_GEN_FAILURE error is returned.");
            }

            smbState = SmbState.Closed;
            smbConnection.sentRequest.Remove(messageId);
        }
        public static void ServerSetup(
            FileSystemType fsType,
            SignState sutSignState,
            bool isSupportDfs,
            bool isSupportPreviousVersion,
            bool isMessageModePipe)
        {
            Condition.IsTrue(smbState == SmbState.ConnectionSuccess);

            if (Parameter.sutPlatform != Platform.NonWindows)
            {
                if (Parameter.sutPlatform == Platform.Win2K3)
                {
                    // It is not possible to disable the DFS capability from the WS03 the SUT.
                    Condition.IsTrue(isSupportDfs);
                }
            }

            if (Parameter.sutPlatform != Platform.NonWindows)
            {
                if (fsType == FileSystemType.Fat)
                {
                    Parameter.isSupportQuota = false;
                    // In Windows, the Generic file system (FAT) does not support File IDs.
                    Parameter.isSupportUniqueFileId = false;
                    // FAT does not support streams.
                    Parameter.isSupportStream = false;
                    // FAT does not support the previous version.
                    Condition.IsTrue(!isSupportPreviousVersion);

                    Requirement.AssumeCaptured("Server doesn't support stream");
                }
                else
                {
                    Parameter.isSupportQuota = true;
                    // In Windows, the Generic file system (NTFS) file system supports File IDs.
                    Parameter.isSupportUniqueFileId = true;
                    // NTFS supports streams.
                    Parameter.isSupportStream = true;
                    // NTFS supports the previous version.
                    Condition.IsTrue(isSupportPreviousVersion);
                    Requirement.AssumeCaptured("Server doesn't support stream");
                }
            }

            Parameter.isSupportPreviousVersion = isSupportPreviousVersion;
            Parameter.fsType = fsType;
            Parameter.isSupportDfs = isSupportDfs;
            Parameter.sutSignState = sutSignState;
            Parameter.isMessageModePipe = isMessageModePipe;
            smbState = SmbState.ServerSetupRequest;
        }
        public static void ServerSetupResponse(
            int totalBytesWritten,
            bool isSupportInfoLevelPassthrough,
            bool isSupportNtSmb,
            bool isRapServerActive,
            bool isSupportResumeKey,
            bool isSupportCopyChunk)
        {
            Condition.IsTrue(smbState == SmbState.ServerSetupRequest);

            // The model abstracts the totalBytesWritten as 1.
            // And when request copy chunk, totalBytesWritten is N*1 (N is an integer >= 1).
            Condition.IsTrue(totalBytesWritten == 1);

            if (Parameter.sutPlatform == Platform.Win2K3
                    || Parameter.sutPlatform == Platform.Win2K8
                    || Parameter.sutPlatform == Platform.Win2K8R2)
            {
                Condition.IsTrue(isSupportInfoLevelPassthrough
                                    && isSupportNtSmb
                                    && isRapServerActive
                                    && isSupportResumeKey
                                    && isSupportCopyChunk);
            }

            Parameter.totalBytesWritten = totalBytesWritten;
            Parameter.isSupportInfoLevelPassThrough = isSupportInfoLevelPassthrough;
            if (!isSupportNtSmb)
            {
                Requirement.AssumeCaptured("Server doesn't support NT SMBs");
            }
            else
            {
                Requirement.AssumeCaptured("Server supports NT SMBs");
            }

            Parameter.isSupportNtSmb = isSupportNtSmb;
            Parameter.isRapServerActive = isRapServerActive;
            Parameter.isSupportResumeKey = isSupportResumeKey;
            Parameter.isSupportCopyChunk = isSupportCopyChunk;
            smbState = SmbState.ServerSetupSuccess;
        }
 public static void CreatePipeAndMailslot(Set<string> pipes, Set<string> mailslot, out bool isCreatePipeStatus)
 {
     Condition.IsTrue(smbState == SmbState.ServerSetupSuccess);
     Condition.IsTrue(pipes == PipeNames() && mailslot == MailslotNames());
     isCreatePipeStatus = true;
     smbState = SmbState.CreateNamePipeAndMailslotSucceed;
 }
        public static void NonExtendedSessionSetupResponse(
            int messageId,
            int sessionId,
            int securitySignatureValue,
            bool isSigned,
            bool isGuestAccount,
            bool isRs2322Implemented,
            MessageStatus messageStatus)
        {
            Checker.CheckNonExtendedSessionSetupResponse(
                smbConnection,
                smbState,
                messageId,
                sessionId,
                securitySignatureValue,
                isSigned,
                isGuestAccount,
                messageStatus,
                MessageStatus.Success);

            if (!smbConnection.clientCapabilities.Contains(Capabilities.CapExtendedSecurity))
            {
                ModelHelper.CaptureRequirement(
                    2322,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Extended Security: Otherwise[if
                        CAP_EXTENDED_SECURITY is not set in ClientCapabilities], it[server] MUST continue to the
                        following NTLM authentication section.");
            }

            if (smbConnection.sentRequest[messageId].command == Command.SmbComSessionSetup)
            {
                ModelHelper.CaptureRequirement(
                    8380,
                    "[In Sequence Diagram] The server MUST respond to each client request that it receives.");
                smbState = SmbState.SessionSetupSuccess;
            }

            Update.UpdateNonExtSessionSetupResponse(smbConnection, messageId, sessionId);
        }
        public static void NonExtendedNegotiateResponse(
            int messageId,
            bool isSignatureRequired,
            bool isSignatureEnabled,
            int dialectIndex,
            [Domain("SutCapabilitiesForNonextendedSecurity ")] Set<Capabilities> serverCapabilities,
            MessageStatus messageStatus)
        {
            Condition.IsTrue(!serverCapabilities.Contains(Capabilities.CapExtendedSecurity));

            // The adapter will read the response according to [CIFS] section 4.1.1.
            Checker.CheckNegotiateResponse(
                smbConnection,
                messageId,
                smbState,
                messageStatus,
                MessageStatus.Success);

            if (!((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.Contains(Dialect.Invalid))
            {
                Condition.IsTrue(messageStatus == MessageStatus.Success);
                Condition.IsTrue(!serverCapabilities.Contains(Capabilities.None));

                Condition.IsTrue(
                    !((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.Contains(Dialect.Invalid));
                Condition.IsTrue(
                    (dialectIndex >= 0)
                        && (dialectIndex < ((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.Count));
                Condition.IsTrue(
                    ((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.IndexOf(Dialect.NtLanMan)
                        == dialectIndex);

                if (Parameter.isSupportDfs)
                {
                    Condition.IsTrue(serverCapabilities.Contains(Capabilities.CapDfs));
                }
                else
                {
                    Condition.IsTrue(!serverCapabilities.Contains(Capabilities.CapDfs));
                }

                switch (Parameter.sutSignState)
                {
                    case SignState.Required:
                        Condition.IsTrue(isSignatureRequired && isSignatureEnabled);
                        break;
                    case SignState.Enabled:
                        Condition.IsTrue(!isSignatureRequired && isSignatureEnabled);
                        break;
                    case SignState.Disabled:
                    case SignState.DisabledUnlessRequired:
                        Condition.IsTrue(!isSignatureRequired && !isSignatureEnabled);
                        break;
                    default:
                        break;
                }

                // If the result is Blocked (Client:Required&Server:Disabled Client:Disabled&Server:Required),
                // the underlying transport connection must be closed.
                if (((smbConnection.clientSignState == SignState.Disabled)
                        && (Parameter.sutSignState == SignState.Required))
                    || ((smbConnection.clientSignState == SignState.Required)
                        && (Parameter.sutSignState == SignState.Disabled)))
                {
                    smbState = SmbState.Closed;
                }
                else
                {
                    smbState = SmbState.NegotiateSuccess;
                }
            }
            else if (((NegotiateRequest)smbConnection.sentRequest[messageId]).dialectNames.Contains(Dialect.Invalid))
            {
                // The message status equals NOT_SUPPORTED means an error happens.
                Condition.IsTrue(messageStatus == MessageStatus.Success);
                Condition.IsTrue(serverCapabilities.Contains(Capabilities.None)
                                    && !isSignatureEnabled
                                    && !isSignatureRequired);
                Condition.IsTrue(dialectIndex == -1);
                smbState = SmbState.Closed;
            }
            Update.UpdateNegotiateResponse(smbConnection, messageId, Parameter.sutSignState, serverCapabilities);
        }
        public static void ErrorCreateResponse(int messageId, MessageStatus messageStatus)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.NtCreateRequest);
            Condition.IsTrue(messageStatus == MessageStatus.NotSupported
                                || messageStatus == MessageStatus.BadImpersonationLevel
                                || messageStatus == MessageStatus.NetworkSessionExpired
                                || messageStatus == MessageStatus.ObjectPathNotFound
                                || messageStatus == MessageStatus.StatusFileIsADirectory
                                || messageStatus == MessageStatus.AccessDenied);

            CreateRequest request = (CreateRequest)smbConnection.sentRequest[messageId];
            bool isFileExists = false;
            foreach (SmbFile file in smbConnection.openedFiles.Values)
            {
                if (request.name == file.name)
                {
                    isFileExists = true;
                    break;
                }
            }

            // Parameter.fileName[2] indicates "ExistTest.txt" which is already created in the SUT.
            if (request.name == Parameter.fileNames[2])
            {
                isFileExists = true;
            }

            foreach (SmbPipe pipe in smbConnection.openedPipes.Values)
            {
                if (request.name == pipe.name)
                {
                    isFileExists = true;
                    break;
                }
            }

            foreach (SmbMailslot mailslot in smbConnection.openedMailslots.Values)
            {
                if (request.name == mailslot.pipeName)
                {
                    isFileExists = true;
                    break;
                }
            }

            switch (messageStatus)
            {
                case MessageStatus.NotSupported:
                    if (!request.isOpenByFileId)
                    {
                        if (isFileExists)
                        {
                            Condition.IsTrue(request.createDisposition == CreateDisposition.FileCreate);
                        }
                        else
                        {
                            Condition.IsTrue(request.createDisposition == CreateDisposition.FileOpen
                                                && request.createDisposition == CreateDisposition.FileOverwrite);
                        }
                    }
                    if (Parameter.sutPlatform == Platform.WinNt)
                    {
                        Condition.IsTrue(request.impersonationLevel != 3);
                    }

                    if (Parameter.dirNames.Contains(request.name))
                    {
                        Condition.IsTrue(request.isDirectoryFile);
                    }
                    else if (!Parameter.dirNames.Contains(request.name))
                    {
                        Condition.IsTrue(!request.isDirectoryFile);
                    }

                    if ((Parameter.sutPlatform != Platform.NonWindows) && !request.isOpenByFileId)
                    {
                        Condition.IsTrue(request.name != Parameter.fileNames[3]);
                    }

                    smbState = SmbState.End;
                    break;
                case MessageStatus.StatusFileIsADirectory:
                    Condition.IsTrue(!request.isOpenByFileId);
                    if (Parameter.dirNames.Contains(request.name))
                    {
                        if (isFileExists)
                        {
                            Condition.IsTrue(request.createDisposition != CreateDisposition.FileCreate);
                        }
                        else
                        {
                            Condition.IsTrue(request.createDisposition != CreateDisposition.FileOpen
                                                && request.createDisposition != CreateDisposition.FileOverwrite);
                        }

                        if (Parameter.sutPlatform == Platform.WinNt)
                        {
                            Condition.IsTrue(request.impersonationLevel != 3);
                        }
                        if (Parameter.sutPlatform != Platform.NonWindows)
                        {
                            Condition.IsTrue(request.name != Parameter.fileNames[3]);
                        }
                        Condition.IsTrue(!request.isDirectoryFile);
                    }
                    else if (!Parameter.dirNames.Contains(request.name))
                    {
                        if (isFileExists)
                        {
                            Condition.IsTrue(request.createDisposition != CreateDisposition.FileCreate);
                        }
                        else
                        {
                            Condition.IsTrue(request.createDisposition != CreateDisposition.FileOpen
                                                && request.createDisposition != CreateDisposition.FileOverwrite);
                        }

                        if (Parameter.sutPlatform == Platform.WinNt)
                        {
                            Condition.IsTrue(request.impersonationLevel != 3);
                        }

                        if (Parameter.sutPlatform != Platform.NonWindows)
                        {
                            Condition.IsTrue(request.name != Parameter.fileNames[3]);
                        }
                        Condition.IsTrue(request.isDirectoryFile);
                    }

                    smbState = SmbState.End;
                    break;
                case MessageStatus.BadImpersonationLevel:
                    Condition.IsTrue(!request.isOpenByFileId);
                    if (Parameter.dirNames.Contains(request.name))
                    {
                        Condition.IsTrue(request.isDirectoryFile);
                    }
                    else if (!Parameter.dirNames.Contains(request.name))
                    {
                        Condition.IsTrue(!request.isDirectoryFile);
                    }

                    if (Parameter.sutPlatform != Platform.NonWindows)
                    {
                        Condition.IsTrue(request.name != Parameter.fileNames[3]);
                    }

                    if (isFileExists)
                    {
                        Condition.IsTrue(request.createDisposition != CreateDisposition.FileCreate);
                    }
                    else
                    {
                        Condition.IsTrue(request.createDisposition != CreateDisposition.FileOpen
                                            && request.createDisposition != CreateDisposition.FileOverwrite);
                    }

                    // The request.impersonationLevel = 3 means the impersonationLevel is SECURITY_ANONYMOUS,
                    // while the SUT is Windows NT, it can't perform this impersonation.
                    if (request.impersonationLevel == 0)
                    {
                        ModelHelper.CaptureRequirement(
                            30075,
                            "[In Receiving an SMB_COM_NT_CREATE_ANDX Request] If the impersonation level is" +
                            "SECURITY_ANONYMOUS, then the server MUST fail the request with" +
                            "STATUS_BAD_IMPERSONATION_LEVEL.<118>");
                    }

                    if (request.impersonationLevel > 3 || request.impersonationLevel < 0)
                    {
                        ModelHelper.CaptureRequirement(
                            1004000,
                            "<53> Section 2.2.4.9.1: Windows-based servers fail the request with " +
                            "STATUS_BAD_IMPERSONATION_LEVEL if the impersonation level is not one of SECURITY_ANONYMOUS, " +
                            "SECURITY_IDENTIFICATION, SECURITY_IMPERSONATION, or SECURITY_DELEGATION.");
                    }

                    smbState = SmbState.End;
                    break;
                case MessageStatus.ObjectPathNotFound:
                    Condition.IsTrue(!request.isOpenByFileId);

                    if (Parameter.dirNames.Contains(request.name))
                    {
                        Condition.IsTrue(request.isDirectoryFile);
                    }
                    else if (!Parameter.dirNames.Contains(request.name))
                    {
                        Condition.IsTrue(!request.isDirectoryFile);
                    }

                    if (Parameter.sutPlatform == Platform.WinNt)
                    {
                        Condition.IsTrue(request.impersonationLevel != 3);
                    }

                    if (isFileExists)
                    {
                        Condition.IsTrue(request.createDisposition != CreateDisposition.FileCreate);
                    }
                    else
                    {
                        Condition.IsTrue(request.createDisposition != CreateDisposition.FileOpen &&
                                            request.createDisposition != CreateDisposition.FileOverwrite);
                    }

                    Condition.IsTrue(Parameter.sutPlatform != Platform.NonWindows);

                    // Create "Dir1\Test1.txt"
                    Condition.IsTrue(request.name == Parameter.fileNames[3]);
                    smbState = SmbState.End;
                    break;
                case MessageStatus.NetworkSessionExpired:
                    smbConnection.sessionList.Remove(request.sessionId);
                    smbState = SmbState.Closed;
                    break;
                case MessageStatus.AccessDenied:
                    Condition.IsTrue(isClientMaxAllowedSet);
                    smbState = SmbState.End;
                    break;
                default:
                    break;
            }
            smbConnection.sentRequest.Remove(messageId);
        }
        public static void SessionSetupRequest(
            AccountType account,
            int messageId,
            int sessionId,
            int securitySignature,
            bool isRequireSign,
            [Domain("ClientCapabilities")] Set<Capabilities> capabilities,
            bool isSendBufferSizeExceeds,
            bool isWriteBufferSizeExceeds,
            bool flag2)
        {
            Condition.IsTrue(flag2);
            Checker.CheckSessionSetupRequest(
                smbConnection,
                messageId,
                sessionId,
                smbState,
                isRequireSign,
                capabilities,
                isSendBufferSizeExceeds,
                isWriteBufferSizeExceeds);
            if (capabilities.Contains(Capabilities.CapExtendedSecurity))
            {
                ModelHelper.CaptureRequirement(
                    8388,
                    "[In Sequence Diagram] Session Setup Roundtrip: If the CAP_EXTENDED_SECURITY bit is set " +
                    "(0x80000000), then the SMB the SUT does support extended security.");
            }

            smbRequest = new SessionSetupRequest(
                account,
                messageId,
                sessionId,
                securitySignature,
                isRequireSign,
                capabilities);

            Update.UpdateSessionSetupRequest(smbConnection, smbRequest);
            smbState = SmbState.SessionSetupSent;
        }
        public static void ErrorFsctlBadCommandResponse(int messageId, MessageStatus messageStatus)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.InvalidFsctlCommand);

            Condition.IsTrue(messageStatus == MessageStatus.NotSupported);
            ModelHelper.CaptureRequirement(
                9343,
                @"[In Client Request Extensions]Server implementations that receive undefined FSCTL or IOCTL operation
                requests MUST either pass the operation code and data (if any) through to the underlying object store
                or fail the operation by returning STATUS_NOT_SUPPORTED.<68>");

            if (Parameter.sutPlatform != Platform.NonWindows)
            {
                if (badCommand == FsctlInvalidCommand.FsctlRequestOplockLevle1
                        || badCommand == FsctlInvalidCommand.FsctlRequestOplockLevel2
                        || badCommand == FsctlInvalidCommand.FsctlRequestBatchOplock
                        || badCommand == FsctlInvalidCommand.FsctlOplockBreakAcknowledge
                        || badCommand == FsctlInvalidCommand.FsctlOpBatchAckClosePending
                        || badCommand == FsctlInvalidCommand.FsctlOpLockBreakNotify
                        || badCommand == FsctlInvalidCommand.FsctlMoveFile
                        || badCommand == FsctlInvalidCommand.FsctlMarkHandle
                        || badCommand == FsctlInvalidCommand.FsctlQueryRetrievalPointers
                        || badCommand == FsctlInvalidCommand.FsctlPipeAssignEvent
                        || badCommand == FsctlInvalidCommand.FsctlGetVolumeBitmap
                        || badCommand == FsctlInvalidCommand.FsctlGetNtfsFileRecord
                        || badCommand == FsctlInvalidCommand.FsctlInvalidateVolumes)
                {
                    ModelHelper.CaptureRequirement(
                        9568,
                        "<69> Section 2.2.7.2.1: The following FSCTLs[FSCTL_REQUEST_OPLOCK_LEVEL_1," +
                        "FSCTL_REQUEST_OPLOCK_LEVEL_2,FSCTL_REQUEST_BATCH_OPLOCK,FSCTL_OPLOCK_BREAK_ACKNOWLEDGE," +
                        "FSCTL_OPBATCH_ACK_CLOSE_PENDING,FSCTL_OPLOCK_BREAK_NOTIFY,FSCTL_MOVE_FILE,FSCTL_MARK_HANDLE," +
                        "FSCTL_QUERY_RETRIEVAL_POINTERS,FSCTL_PIPE_ASSIGN_EVENT,FSCTL_GET_VOLUME_BITMAP," +
                        "FSCTL_GET_NTFS_FILE_RECORD,FSCTL_INVALIDATE_VOLUMES]are explicitly blocked by the server and " +
                        "are failed with STATUS_NOT_SUPPORTED.");
                }

                //Win2K8R2
                if (Parameter.sutPlatform == Platform.Win2K8R2)
                {
                    if (badCommand == FsctlInvalidCommand.FsctlQueryDependentVolume
                        || badCommand == FsctlInvalidCommand.FsctlSdGlobalChange
                        || badCommand == FsctlInvalidCommand.FsctlGetBootAreaInfo
                        || badCommand == FsctlInvalidCommand.FsctlGetRetrievalPointerBase
                        || badCommand == FsctlInvalidCommand.FsctlSetPersistentVolumeState
                        || badCommand == FsctlInvalidCommand.FsctlQueryPersistentVolumeState
                        || badCommand == FsctlInvalidCommand.FsctlRequestOpLock
                        || badCommand == FsctlInvalidCommand.FsctlTxFsModifyRm
                        || badCommand == FsctlInvalidCommand.FsctlTxfsQueryRmInformation
                        || badCommand == FsctlInvalidCommand.FsctlTxFsRollForwardRedo
                        || badCommand == FsctlInvalidCommand.FsctlTxFsRollForwardUndo
                        || badCommand == FsctlInvalidCommand.FsctlTxfsStartRm
                        || badCommand == FsctlInvalidCommand.FsctlTxfsShutdownRm
                        || badCommand == FsctlInvalidCommand.FsctlTxfsReadBackupInformation
                        || badCommand == FsctlInvalidCommand.FsctlTxfsReadBackupInformation2
                        || badCommand == FsctlInvalidCommand.FsctlTxfsCreateSecondaryRm
                        || badCommand == FsctlInvalidCommand.FsctlTxfsGetMetadataInfo
                        || badCommand == FsctlInvalidCommand.FsctlTxfsGetTransactedVersion
                        || badCommand == FsctlInvalidCommand.FsctlTxfsSavePointInformation
                        || badCommand == FsctlInvalidCommand.FsctlTxfsCreateMiniVersion
                        || badCommand == FsctlInvalidCommand.FsctlTxfsTransactionActive
                        || badCommand == FsctlInvalidCommand.FsctlTxfsListTransactions)
                    {
                        ModelHelper.CaptureRequirement(
                            9571,
                            "The following FSCTLs[FSCTL_REQUEST_OPLOCK_LEVEL_1, FSCTL_REQUEST_OPLOCK_LEVEL_2," +
                            "FSCTL_REQUEST_BATCH_OPLOCK,FSCTL_REQUEST_FILTER_OPLOCK,FSCTL_OPLOCK_BREAK_ACKNOWLEDGE," +
                            "FSCTL_OPBATCH_ACK_CLOSE_PENDING, FSCTL_OPLOCK_BREAK_NOTIFY,FSCTL_MOVE_FILE," +
                            "FSCTL_MARK_HANDLE,FSCTL_QUERY_RETRIEVAL_POINTERS,FSCTL_PIPE_ASSIGN_EVENT," +
                            "FSCTL_GET_VOLUME_BITMAP,FSCTL_GET_NTFS_FILE_RECORD,FSCTL_INVALIDATE_VOLUMES," +
                            "FSCTL_READ_USN_JOURNAL,FSCTL_CREATE_USN_JOURNAL, FSCTL_QUERY_USN_JOURNAL," +
                            "FSCTL_DELETE_USN_JOURNAL,FSCTL_ENUM_USN_DATA,FSCTL_QUERY_DEPENDENT_VOLUME," +
                            "FSCTL_SD_GLOBAL_CHANGE, FSCTL_GET_BOOT_AREA_INFO,FSCTL_GET_RETRIEVAL_POINTER_BASE," +
                            "FSCTL_SET_PERSISTENT_VOLUME_STATE,FSCTL_QUERY_PERSISTENT_VOLUME_STATE, FSCTL_REQUEST_OPLOCK," +
                            "FSCTL_TXFS_MODIFY_RM,FSCTL_TXFS_QUERY_RM_INFORMATION,FSCTL_TXFS_ROLLFORW ARD_REDO," +
                            "FSCTL_TXFS_ROLLFORWARD_UNDO,FSCTL_TXFS_START_RM,FSCTL_TXFS_SHUTDOWN_RM," +
                            "FSCTL_TXFS_READ_BACKUP_INFORMATION, FSCTL_TXFS_WRITE_BACKUP_INFORMATION," +
                            "FSCTL_TXFS_WRITE_BACKUP_INFORMATION,FSCTL_TXFS_CREATE_SECONDARY_RM," +
                            "FSCTL_TXFS_GET_METADATA_INFO,FSCTL_TXFS_GET_TRANSACTED_VERSION," +
                            "FSCTL_TXFS_SAVEPOINT_INFORMATION, FSCTL_TXFS_CREATE_MINIVERSION," +
                            "FSCTL_TXFS_TRANSACTION_ACTIVE,FSCTL_TXFS_LIST_TRANSACTIONS," +
                            "FSCTL_TXFS_READ_BACKUP_INFORMATION2,FSCTL_TXFS_WRITE_BACKUP_INFORMATION2]are explicitly" +
                            "blocked by Windows server 2008 R2 and are not passed through to the object store. They are" +
                            "failed with STATUS_NOT_SUPPORTED.");
                    }
                }
            }
            smbConnection.sentRequest.Remove(messageId);
            smbState = SmbState.End;
        }
        public static void SessionSetupRequestAdditional(
            AccountType accountType,
            int messageId,
            int sessionId,
            int securitySignature,
            bool isRequireSign,
            [Domain("ClientCapabilities")] Set<Capabilities> capabilities,
            bool isSendBufferSizeExceeds,
            bool isWriteBufferSizeExceeds,
            bool flag2,
            bool isGSSTokenValid,
            bool isUserIdValid)
        {
            Condition.IsTrue(flag2);
            Checker.CheckSessionSetupRequest(
                smbConnection,
                messageId,
                sessionId,
                smbState,
                isRequireSign,
                capabilities,
                isSendBufferSizeExceeds,
                isWriteBufferSizeExceeds);

            smbRequest = new SessionSetupRequestAdditional(
                accountType,
                messageId,
                sessionId,
                securitySignature,
                isRequireSign,
                capabilities,
                isGSSTokenValid,
                isUserIdValid);
            Update.UpdateSessionSetupRequestAdditional(smbConnection, smbRequest);
            smbState = SmbState.SessionSetupSent;
        }
        public static void ErrorReadResponse(int messageId, MessageStatus messageStatus)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(messageStatus == MessageStatus.NetworkSessionExpired);
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.NtReadRequest);
            ReadRequest request = (ReadRequest)smbConnection.sentRequest[messageId];

            if (messageStatus == MessageStatus.NetworkSessionExpired)
            {
                smbConnection.sessionList.Remove(request.sessionId);
                smbState = SmbState.Closed;
            }

            smbConnection.sentRequest.Remove(messageId);
        }
        public static void SessionSetupResponseAdditional(
            int messageId,
            int sessionId,
            int securitySignatureValue,
            bool isSigned,
            bool isGuestAccount,
            MessageStatus messageStatus)
        {
            Checker.CheckSessionSetupResponseAdditional(
                smbConnection,
                smbState,
                messageId,
                sessionId,
                securitySignatureValue,
                isSigned,
                isGuestAccount,
                messageStatus,
                MessageStatus.Success);
            Condition.IsTrue(((SessionSetupRequestAdditional)smbConnection.sentRequest[messageId]).isUserIdValid);
            Condition.IsTrue(((SessionSetupRequestAdditional)smbConnection.sentRequest[messageId]).isGssValid);
            if (smbConnection.sentRequest[messageId].command == Command.SmbComSessionSetupAdditional)
            {
                ModelHelper.CaptureRequirement(
                    8380,
                    "[In Sequence Diagram] The server MUST respond to each client request that it receives.");
                ModelHelper.CaptureRequirement(
                    2193,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Response]NTLM Authentication: The connection MUST
                    remain open for the client to attempt another authentication.");
                smbState = SmbState.SessionSetupSuccess;
            }

            // Authentication is completed.
            if (messageStatus == MessageStatus.Success)
            {
                ModelHelper.CaptureRequirement(
                    4143,
                    @"[In Sequence Diagram]The exchange of security tokens MUST continue until either the client or the
                    server determines that authentication has failed or both sides decide that authentication is
                    complete.");

                if (((SessionSetupRequestAdditional)smbConnection.sentRequest[messageId]).isGssValid)
                {
                    ModelHelper.CaptureRequirement(
                        2329,
                        @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Extended Security: If the GSS mechanism
                        indicates success, then  the server MUST create an SMB_COM_SESSION_SETUP_ANDX response
                        (section 2.2.4.6.2).");

                    ModelHelper.CaptureRequirement(
                        4784,
                        @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Extended Security: If the GSS mechanism
                        indicates that the current output token is the last output token of the authentication exchange
                        based on the return code, as specified in [RFC2743]: Then the Status field in the SMB header of
                        the response MUST be set to STATUS_SUCCESS.");
                }
            }

            if (smbConnection.clientCapabilities.Contains(Capabilities.CapExtendedSecurity))
            {
                ModelHelper.CaptureRequirement(
                    8390,
                    "[In Sequence Diagram] Session Setup Roundtrip: The request is sent to the SMB server, and the " +
                    "server builds an extended SMB_COM_SESSION_SETUP_ANDX response. (section 2.2.4.6.2.). ");
            }

            Update.UpdateSessionSetupResponseAdditional(smbConnection, messageId, sessionId);

            if (smbConnection.isSigningActive)
            {
                ModelHelper.CaptureRequirement(
                    2341,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Signing Initialization: Otherwise[if opposite
                    to the condition: IsSigningActive is FALSE, and the response of the SMB_COM_SESSION_SETUP_ANDX
                    operation contains STATUS_SUCCESS], Server.Connection.IsSigningActive MUST be set to TRUE.");
            }
        }
        public static void ErrorSessionSetupResponseAdditional(int messageId, MessageStatus messageStatus)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(messageStatus == MessageStatus.NetworkSessionExpired
                                || messageStatus == MessageStatus.MoreProcessingRequired
                                || messageStatus == MessageStatus.StatusSmbBadUid);
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.SmbComSessionSetupAdditional);

            if (messageStatus == MessageStatus.MoreProcessingRequired)
            {
                Condition.IsTrue(!((SessionSetupRequestAdditional)smbConnection.sentRequest[messageId]).isGssValid);
            }

            if (messageStatus == MessageStatus.StatusSmbBadUid)
            {
                Condition.IsTrue(!((SessionSetupRequestAdditional)smbConnection.sentRequest[messageId]).isUserIdValid);

                ModelHelper.CaptureRequirement(
                    2326,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Extended Security: If the GSS mechanism
                    indicates an error that is not STATUS_MORE_PROCESSING_REQUIRED, then the server MUST fail the client
                    request, and return only an SMB header and propagate the failure code.");
                ModelHelper.CaptureRequirement(
                    4776,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Extended Security: If the GSS mechanism
                    indicates an error that is not STATUS_MORE_PROCESSING_REQUIRED, the authentication has failed and
                    no further processing is done on this request.");
                ModelHelper.CaptureRequirement(
                    4777,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Extended Security: If the GSS mechanism
                    indicates an error that is not STATUS_MORE_PROCESSING_REQUIRED, this error response is sent to the
                    client.");
                ModelHelper.CaptureRequirement(
                    2333,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Extended Security: Otherwise[If the GSS
                    mechanism does not indicate that the current output token is the last output token of the
                    authentication exchange based on the return code], the Status field in the SMB header of the
                    response MUST be set to STATUS_MORE_PROCESSING_REQUIRED.");

                ModelHelper.CaptureRequirement(
                    80172,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Determine Reauth or Continuation of Previous
                    Auth: If there is no session for the provided UID, then the request MUST be failed with
                    STATUS_SMB_BAD_UID.");
            }

            if (messageStatus == MessageStatus.NetworkSessionExpired)
            {
                ModelHelper.CaptureRequirement(
                    4765,
                    @"[In Receiving an SMB_COM_SESSION_SETUP_ANDX Request]Determine Reauth or Continuation of Previous
                    Auth: The server MUST prevent any further operations from executing on this session until
                    authentication is complete, and fail them with STATUS_NETWORK_SESSION_EXPIRED.");
            }

            smbState = SmbState.Closed;
            smbConnection.sentRequest.Remove(messageId);
        }
 public static void SmbConnectionRequest()
 {
     Condition.IsTrue(smbState == SmbState.Init);
     smbState = SmbState.ConnectionRequest;
 }
        public static void ErrorWriteResponse(int messageId, MessageStatus messageStatus, bool isRs5229Implemented)
        {
            Condition.IsTrue(smbConnection.sentRequest.ContainsKey(messageId));
            Condition.IsTrue(messageStatus == MessageStatus.NetworkSessionExpired
                                || messageStatus == MessageStatus.StatusMaxBufferExceeded
                                || messageStatus == MessageStatus.AccessDenied);
            Condition.IsTrue(smbConnection.sentRequest[messageId].command == Command.NtWriteRequest);
            WriteRequest request = (WriteRequest)smbConnection.sentRequest[messageId];

            if (isRs5229Implemented)
            {
                ModelHelper.CaptureRequirement(
                    5229,
                    @"[In Message Syntax]When an error occurs, unless otherwise noted in this specification, an SMB
                    server SHOULD return an Error Response message. ");

                if (Parameter.sutPlatform != Platform.NonWindows)
                {
                    ModelHelper.CaptureRequirement(
                        105229,
                        @"[In Message Syntax]When an error occurs, unless otherwise noted in this specification, an SMB
                        server returns an Error Response message in Windows. ");
                }
            }

            if (messageStatus == MessageStatus.StatusMaxBufferExceeded)
            {
                if (!smbConnection.sutCapabilities.Contains(Capabilities.CapExtendedSecurity))
                {
                    if (smbConnection.sutCapabilities.Contains(Capabilities.CapLargeWritex)
                            && smbConnection.clientCapabilities.Contains(Capabilities.CapLargeWritex))
                    {
                        ModelHelper.CaptureRequirement(
                            9207,
                            @"[In Non-Extended Security Response]MaxBufferSize (4 bytes): The only exceptions in which
                            this maximum buffer size MUST be exceeded are:When the SMB_COM_WRITE_ANDX command is used
                            and both the client and server support the CAP_LARGE_WRITEX capability (see the
                            Capabilities field for more information).");
                    }

                    if (smbConnection.sutCapabilities.Contains(Capabilities.CapRawMode)
                            && smbConnection.clientCapabilities.Contains(Capabilities.CapRawMode))
                    {
                        ModelHelper.CaptureRequirement(
                            9208,
                            @"[In Non-Extended Security Response]MaxBufferSize (4 bytes): The only exceptions in which
                            this maximum buffer size MUST be exceeded are:When the SMB_COM_WRITE_RAW command is used
                            and both the client and server support the CAP_RAW_MODE capability.");
                    }
                }
            }
            else if (messageStatus == MessageStatus.AccessDenied)
            {
                Condition.IsTrue(createFileAccess == 1);
                ModelHelper.CaptureRequirement(
                    9096,
                    @"[In File_Pipe_Printer_Access_Mask]If no access is granted for the client on this file, the server
                    MUST fail the open with STATUS_ACCESS_DENIED.");
                ModelHelper.CaptureRequirement(
                    9119,
                    @"[In Directory_Access_Mask]Directory_Access_Mask (4 bytes):MAXIMUM_ALLOWED 0x02000000:If no access
                    is granted for the client on this directory, then the server MUST fail the open with
                    STATUS_ACCESS_DENIED.");
            }

            if (messageStatus == MessageStatus.NetworkSessionExpired)
            {
                ModelHelper.CaptureRequirement(
                    8553,
                    @"[In Receiving Any Message]Session Validation and Re-authentication: [If
                    Connection.SessionTable[UID].AuthenticationState is equal to Expired] Otherwise[if a session renewal
                    is successful], the server MUST fail this operation with STATUS_NETWORK_SESSION_EXPIRED.");
            }

            smbConnection.sessionList.Remove(request.sessionId);
            smbState = SmbState.Closed;
            smbConnection.sentRequest.Remove(messageId);
        }
 public static void NegotiateRequest(
     int messageId,
     bool isSupportExtSecurity,
     SignState clientSignState,
     Sequence<Dialect> dialectName)
 {
     Checker.CheckNegotiateRequest(smbConnection, messageId, smbState, clientSignState, dialectName);
     smbRequest = new NegotiateRequest(messageId, isSupportExtSecurity, clientSignState, dialectName);
     Update.UpdateNegotiateRequest(smbConnection, smbRequest);
     smbState = SmbState.NegotiateSent;
 }