Fix bug #9117 - smbclient can't connect to a Windows 7 server using NTLMv2 (crypto...
[samba.git] / libcli / auth / smbencrypt.c
index f7c60e7de123c4f4e6716a772a35a07b7c6af91d..e821dbcdf7ceafa963f188a940cad8d23f147ee6 100644 (file)
@@ -471,8 +471,11 @@ bool SMBNTLMv2encrypt_hash(TALLOC_CTX *mem_ctx,
        /* We don't use the NT# directly.  Instead we use it mashed up with
           the username and domain.
           This prevents username swapping during the auth exchange
+          NB. *DON'T* tell ntv2_owf_gen() to uppercase the domain
+          name here, we may have already been added to an NTLMSSP
+          exchange in the non-uppercase form.
        */
-       if (!ntv2_owf_gen(nt_hash, user, domain, true, ntlm_v2_hash)) {
+       if (!ntv2_owf_gen(nt_hash, user, domain, false, ntlm_v2_hash)) {
                return false;
        }