Fix bug #9117 - smbclient can't connect to a Windows 7 server using NTLMv2 (crypto...
authorJeremy Allison <jra@samba.org>
Fri, 24 Aug 2012 22:54:07 +0000 (15:54 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 1 Nov 2012 08:10:37 +0000 (09:10 +0100)
Simple fix for 3.5.x, tested and confirmed as working by original reporter
"Blohm, Guntram (I/FP-37, extern)" <extern.guntram.blohm@audi.de>.
(cherry picked from commit c13c6eb11f49b1fd3b3be95c7265cf9c0738b4e8)

libcli/auth/smbencrypt.c
source3/libsmb/cliconnect.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;
        }
 
index e858280cd95c56cab054a985479b2275313deb48..7b00469ffff8f3cef60bc75bffa18031bb7e7edd 100644 (file)
@@ -1178,6 +1178,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
            (p=strchr_m(user2,*lp_winbind_separator()))) {
                *p = 0;
                user = p+1;
+               strupper_m(user2);
                workgroup = user2;
        }