prisma / tiberius

TDS 7.2+ (Microsoft SQL Server) driver for Rust
Apache License 2.0
325 stars 121 forks source link

Fix header type for SSPI response message #351

Open staticlibs opened 3 months ago

staticlibs commented 3 months ago

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.