Dela via


3.2.4.2.2 Dialect Negotiation

If Client.Connection.NegotiateSent is FALSE, the client MUST set SMB_Dialect.DialectString to Client.SupportDialects and negotiate a protocol dialect using the SMB_COM_NEGOTIATE command, as specified in section 2.2.4.52. This step MUST be completed before progressing to any other operations on the connection.

Upon receipt of the server response the client MUST complete the following steps:

  • The client MUST set Client.Connection.NegotiateSent to TRUE.

  • The CIFS client MUST examine the DialectIndex field in the SMB_COM_NEGOTIATE Server response to determine the negotiated dialect. If an error was returned, or no dialect was selected, then the Negotiate Protocol operation has failed. Otherwise, the selected dialect is stored in Client.Connection.SelectedDialect.

  • The CIFS client examines the SecurityMode bit field in the SMB_COM_NEGOTIATE Server response and performs the following steps in sequence:

    • If the 0x01 bit is zero, Client.Connection.ShareLevelAccessControl MUST be set to TRUE.

    • If the 0x02 bit is set (1), Client.Connection.ServerChallengeResponse MUST be set to TRUE.

    • If Client.Connection.ServerChallengeResponse is TRUE and the 0x04 bit is set (1), Client.Connection.ServerSigningState MUST be set to Enabled.

    • If Client.Connection.ServerSigningState is Enabled and the 0x08 bit is set (1), Client.Connection.ServerSigningState MUST be set to Required.

  • The server capabilities, as returned in the Capabilities field of the SMB_COM_NEGOTIATE Server response, MUST be stored in Client.Connection.ServerCapabilities.

  • The server's maximum buffer size (which is, with specific exceptions, the maximum size of an SMB message that can be sent to the server) MUST be stored in Client.Connection.ServerMaxBufferSize.

If the Negotiate Protocol operation fails, then the connection MUST be closed and an appropriate error message MUST be passed back to the calling application.