3.3.5.1 Initial State

The TDS server receives the first packet from the client. The packet SHOULD be a PRELOGIN packet to set up context for login. A Pre-Login message is indicated by the PRELOGIN (0x12) message type described in section 2. The TDS server SHOULD close the underlying transport connection, indicate an error to the upper layer, and enter the "Final State" state, if the first packet is not a structurally correct PRELOGIN packet or if the PRELOGIN packet does not contain the client version as the first option token. Otherwise, the TDS server MUST do one of the following:

  • Return to the client a PRELOGIN structure wrapped in a table response (0x04) packet with Encryption and enter "TLS/SSL Negotiation" state if encryption is negotiated.

  • Return to the client a PRELOGIN structure wrapped in a table response (0x04) packet without Encryption and enter unencrypted "Login Ready" state if encryption is not negotiated.

If a FEDAUTHREQUIRED<59> option is contained in the PRELOGIN structure sent by the server to the client, the TDS server MUST maintain the value of the FEDAUTHREQUIRED option in a state variable to validate the LOGIN7 message with FEDAUTH FeatureId when the message arrives, as described in section 3.3.5.3.

If no FEDAUTHREQUIRED option is contained in the PRELOGIN structure sent by the server to the client, or if the value of B_FEDAUTHREQUIRED = 0, the TDS client can treat both events as equivalent and MUST remember the event in a state variable. Either state will be treated the same when the state variables are examined in the "Login Ready" state (see section 3.3.5.3 for further details).

If NONCEOPT is specified in both the client PRELOGIN message and the server PRELOGIN message, the TDS server MUST maintain a state variable that includes the values of both the NONCE it sent to the client and the NONCE the client sent to it during the PRELOGIN exchange.

Show: