Generate LM hash when getting pwd from cred_store
authorSimo Sorce <simo@redhat.com>
Wed, 6 Aug 2014 17:26:35 +0000 (13:26 -0400)
committerSimo Sorce <simo@redhat.com>
Wed, 6 Aug 2014 19:44:28 +0000 (15:44 -0400)
This is needed when NTLMSSP_NEGOTIATE_LM_KEY is used at lower,
LM_COMPTE_LEVEL (eg, level 0) by a client and NTLMv1 auth.

src/gss_creds.c

index 7ccc6bed5ee758bfe9243b9eb8ae4a06756986d9..17ac3f60171ac38a6c7921c5d812fd8263be3571 100644 (file)
@@ -221,6 +221,14 @@ static int get_creds_from_store(struct gssntlm_name *name,
             cred->cred.user.nt_hash.length = 16;
             ret = NTOWFv1(cred_store->elements[i].value,
                           &cred->cred.user.nt_hash);
+
+            if (gssntlm_get_lm_compatibility_level() < 3) {
+                cred->cred.user.lm_hash.length = 16;
+                ret = LMOWFv1(cred_store->elements[i].value,
+                              &cred->cred.user.lm_hash);
+                if (ret) return ret;
+            }
+
             if (ret) return ret;
         }
     }