diff options
author | Simo Sorce <simo@redhat.com> | 2013-07-18 16:23:36 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2013-07-18 22:37:25 -0400 |
commit | e2d8e81426aa2a7c3b82467d352fe97b49bff9d2 (patch) | |
tree | 1a5cbf754927b1a9a1dce770b955845d6931f0c7 /src/gss_creds.c | |
parent | a121c1b405c43b6fcc48fb87ebbe78b9e9dbb74c (diff) | |
download | gss-ntlmssp-e2d8e81426aa2a7c3b82467d352fe97b49bff9d2.tar.gz gss-ntlmssp-e2d8e81426aa2a7c3b82467d352fe97b49bff9d2.tar.xz gss-ntlmssp-e2d8e81426aa2a7c3b82467d352fe97b49bff9d2.zip |
Add NTLMv1 support to context initialization
Diffstat (limited to 'src/gss_creds.c')
-rw-r--r-- | src/gss_creds.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gss_creds.c b/src/gss_creds.c index 2f062bd..dc404c7 100644 --- a/src/gss_creds.c +++ b/src/gss_creds.c @@ -98,8 +98,23 @@ static int get_initial_creds(struct gssntlm_name *name, goto done; } cred->cred.user.nt_hash.length = 16; + ret = NTOWFv1(pwd, &cred->cred.user.nt_hash); + if (ret) goto done; + + envvar = getenv("LM_COMPAT_LEVEL"); + if (envvar != NULL) { + cred->lm_compatibility_level = atoi(envvar); + } else { + /* use most secure defaults for now, we can add options to + * relax security later */ + cred->lm_compatibility_level = SEC_LEVEL_MAX; + } + if (cred->lm_compatibility_level < 3) { + cred->cred.user.lm_hash.length = 16; + ret = LMOWFv1(pwd, &cred->cred.user.lm_hash); + } goto done; } } |