Description
(Continuing from jborean93/smbprotocol#169)
Windows servers have a security policy Microsoft network server: Server SPN target name validation level, which (if enabled) will check the SPN sent in MSV_AV_TARGET_NAME and will reject authentication if it thinks you're authenticating to an unrecognized SPN. (I assume this is meant to prevent NTLM relay attacks, though it also adds checks to Kerberos SPNs as well.)
Latest gss-ntlmssp Git now sends the SPN in the correct format, but still gets rejected by Windows servers with this policy enabled. The biggest difference I can see between gss-ntlmssp and working clients (Win10, Samba, pyspnego) is that gss-ntlmssp now sets the UNTRUSTED_SPN_SOURCE
flag in MSV_AV_FLAGS, which none of the other clients do, and if I understand the NTLM spec right this flag tells the server to pretend the SPN field was empty (which the newly added checks then reject as unrecognized).