Skip to content

Fix header type for SSPI response message - #351

Open
staticlibs wants to merge 1 commit into
prisma:mainfrom
wiltondb:sspi_response_header_type
Open

Fix header type for SSPI response message#351
staticlibs wants to merge 1 commit into
prisma:mainfrom
wiltondb:sspi_response_header_type

Conversation

@staticlibs

Copy link
Copy Markdown

Hi! I am working on WiltonDB that implements TDS protocol compatible with MSSQL. I've noticed the following problem with Tiberius TDS client:

When Windows Integrated auth is used, Tiberius sends NTLM response message with 0x10 (LOGIN7) header type. According to TDS spec, 0x11 (SSPI Message) header type must be used instead.

MSSQL seems to accept either of these header types. I've implemented TDS SSPI login support in WiltonDB, it requires correct message type in NTLM response. Windows Integrated auth there is currently compatible with Microsoft clients for MSSQL, but not compatible with Tiberius. Thus I suggest this fix.

MattJackson added a commit to MattJackson/tiberius-ng that referenced this pull request Aug 29, 2026
prisma#390, prisma#411)

- header.rs: allow(dead_code) on PacketHeader::sspi (platform/feature-gated use)
- connection.rs: drop needless reborrow in the zeroizing send path
- row.rs: elide lifetime on get_column_data
- rustfmt negative-numeric formatting from prisma#390
joelparkerhenderson added a commit to mssql-rust/mssql-rust that referenced this pull request Aug 29, 2026
Mirrors prisma/tiberius#351. Per MS-TDS, the multi-step SSPI
challenge-response continuation sent during Windows-integrated/NTLM or
GSSAPI login is a distinct packet type (0x11, SSPI Message) from the
initial LOGIN7 (0x10) -- a TDS-spec-conformant server can reject a
continuation framed as another LOGIN7. Classic SQL Server tolerates
both, which is presumably why this has gone unnoticed.

Adds PacketHeader::sspi(id) and uses it at all three of this fork's
SSPI-continuation send sites (upstream's PR only fixed one): winauth's
AuthMethod::Integrated and AuthMethod::Windows on Windows, and GSSAPI's
AuthMethod::Integrated on Unix. Gated the new constructor behind the
same #[cfg] as its call sites so it isn't flagged unused when neither
winauth nor integrated-auth-gssapi is active.

Verified: cargo check across all 6 CI feature combinations plus
--features=integrated-auth-gssapi,native-tls specifically, cargo
clippy --all-targets, cargo fmt --check, and cargo test --lib (152
passing) all pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156Di1tRRLsJK8ctU1AmAJr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant