3.3.5.5.1 Authenticating a New Session

A session object MUST be allocated for this request. The session MUST be inserted into the GlobalSessionTable and a unique Session.SessionId is assigned to serve as a lookup key in the table. The session MUST be inserted into Connection.SessionTable. The server MUST register the session by invoking the event specified in [MS-SRVS] section 3.1.6.2 and assign the return value to Session.SessionGlobalId. ServerStatistics.sts0_sopens MUST be increased by 1. The SMB2 server MUST reserve -1 as an invalid SessionId and 0 as a SessionId for which no session exists. The other values MUST be initialized as follows:

  • Session.Connection is set to the connection on which the request was received.

  • Session.State is set to InProgress.

  • Session.SecurityContext is set to NULL.

  • Session.SessionKey is set to NULL, indicating that it is uninitialized.

  • Session.SigningRequired is set to FALSE.

  • Session.OpenTable is set to an empty table.

  • Session.TreeConnectTable is set to an empty table.

  • Session.IsAnonymous is set to FALSE.

  • Session.CreationTime is set to the current time.

  • Session.IdleTime is set to the current time.

  • If Connection.Dialect belongs to the SMB 3.x dialect family, Session.EncryptData is set to global EncryptData.

  • If Connection.Dialect belongs to the SMB 3.x dialect family, Session.ChannelList MUST be set to an empty list.

  • If Connection.Dialect is "3.1.1", the server MUST set Session.PreauthIntegrityHashValue to Connection.PreauthIntegrityHashValue.

  • If Connection.Dialect is "3.1.1", the server MUST set Session.FullSessionKey to empty.

Using this session, authentication is continued as specified in section 3.3.5.5.3.