Remove useless bool "upper_case_domain" parameter from ntv2_owf_gen().
authorJeremy Allison <jra@samba.org>
Thu, 23 Aug 2012 23:02:09 +0000 (16:02 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 15 Oct 2012 09:34:30 +0000 (11:34 +0200)
The code in SMBNTLMv2encrypt_hash() should not be requesting case
changes on the domain name.
(cherry picked from commit c47183b337d996640f009d133d47f90c153acd56)

The last 3 patches address bug #9117 - smbclient can't connect to a Windows 7
server using NTLMv2 (crypto code changes domain case).

libcli/auth/ntlm_check.c
libcli/auth/proto.h
libcli/auth/smbencrypt.c

index 31855586215a7d9294f1b2f8d7066fd83cf1d4c3..74787a4aa5d66d6ac22c92a287799cdfed94a9ab 100644 (file)
@@ -121,7 +121,7 @@ static bool smb_pwd_check_ntlmv2(TALLOC_CTX *mem_ctx,
           but for NTLMv2 it is meant to contain the current time etc.
        */
 
-       if (!ntv2_owf_gen(part_passwd, user, domain, false, kr)) {
+       if (!ntv2_owf_gen(part_passwd, user, domain, kr)) {
                return false;
        }
 
@@ -190,7 +190,7 @@ static bool smb_sess_key_ntlmv2(TALLOC_CTX *mem_ctx,
 
        client_key_data = data_blob_talloc(mem_ctx, ntv2_response->data+16, ntv2_response->length-16);
 
-       if (!ntv2_owf_gen(part_passwd, user, domain, false, kr)) {
+       if (!ntv2_owf_gen(part_passwd, user, domain, kr)) {
                return false;
        }
 
index 34a0052f7a4804e547c350713c18268c7bce1ddf..11b720df33ae5b8e054d21ab118334540f5fe5bc 100644 (file)
@@ -109,7 +109,6 @@ bool E_deshash(const char *passwd, uint8_t p16[16]);
 void nt_lm_owf_gen(const char *pwd, uint8_t nt_p16[16], uint8_t p16[16]);
 bool ntv2_owf_gen(const uint8_t owf[16],
                  const char *user_in, const char *domain_in,
-                 bool upper_case_domain, /* Transform the domain into UPPER case */
                  uint8_t kr_buf[16]);
 void SMBOWFencrypt(const uint8_t passwd[16], const uint8_t *c8, uint8_t p24[24]);
 void SMBNTencrypt_hash(const uint8_t nt_hash[16], uint8_t *c8, uint8_t *p24);
index ed1172b0478683590239a67ac4eb043992085999..e0326d4c9ee2972089b3c0421f0922b7b7687e0c 100644 (file)
@@ -168,7 +168,6 @@ void nt_lm_owf_gen(const char *pwd, uint8_t nt_p16[16], uint8_t p16[16])
 /* Does both the NTLMv2 owfs of a user's password */
 bool ntv2_owf_gen(const uint8_t owf[16],
                  const char *user_in, const char *domain_in,
-                 bool upper_case_domain, /* Transform the domain into UPPER case */
                  uint8_t kr_buf[16])
 {
        smb_ucs2_t *user;
@@ -198,14 +197,6 @@ bool ntv2_owf_gen(const uint8_t owf[16],
                return false;
        }
 
-       if (upper_case_domain) {
-               domain_in = strupper_talloc(mem_ctx, domain_in);
-               if (domain_in == NULL) {
-                       talloc_free(mem_ctx);
-                       return false;
-               }
-       }
-
        ret = push_ucs2_talloc(mem_ctx, &user, user_in, &user_byte_len );
        if (!ret) {
                DEBUG(0, ("push_uss2_talloc() for user failed)\n"));
@@ -474,7 +465,7 @@ bool SMBNTLMv2encrypt_hash(TALLOC_CTX *mem_ctx,
           the username and domain.
           This prevents username swapping during the auth exchange
        */
-       if (!ntv2_owf_gen(nt_hash, user, domain, true, ntlm_v2_hash)) {
+       if (!ntv2_owf_gen(nt_hash, user, domain, ntlm_v2_hash)) {
                return false;
        }