diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-02-16 22:23:33 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-02-16 22:23:33 +0000 |
commit | 6aa3aba3db604d481dc96c3befe066938cb1b0f3 (patch) | |
tree | 58e122bf28e4459189034a7558ed0258b22974a5 /source/auth | |
parent | ffda9e2480414c7ed6156958f516e0d1f3c61350 (diff) | |
download | samba-6aa3aba3db604d481dc96c3befe066938cb1b0f3.tar.gz samba-6aa3aba3db604d481dc96c3befe066938cb1b0f3.tar.xz samba-6aa3aba3db604d481dc96c3befe066938cb1b0f3.zip |
Merge from HEAD - allow "" as a domain in the NLTMv2 hash calculations. Fixes
interop with clients not in our domain.
Andrew Bartlett
Diffstat (limited to 'source/auth')
-rw-r--r-- | source/auth/auth_sam.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source/auth/auth_sam.c b/source/auth/auth_sam.c index e2208e14551..b309833440e 100644 --- a/source/auth/auth_sam.c +++ b/source/auth/auth_sam.c @@ -184,7 +184,7 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context, /* We have the NT MD4 hash challenge available - see if we can use it (ie. does it exist in the smbpasswd file). */ - DEBUG(4,("sam_password_ok: Checking NTLMv2 password\n")); + DEBUG(4,("sam_password_ok: Checking NTLMv2 password with domain [%s]\n", user_info->client_domain.str)); if (smb_pwd_check_ntlmv2( user_info->nt_resp, nt_pw, auth_context->challenge, user_info->smb_name.str, @@ -192,6 +192,16 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context, user_sess_key)) { return NT_STATUS_OK; + } + + DEBUG(4,("sam_password_ok: Checking NTLMv2 password without a domain\n")); + if (smb_pwd_check_ntlmv2( user_info->nt_resp, + nt_pw, auth_context->challenge, + user_info->smb_name.str, + "", + user_sess_key)) + { + return NT_STATUS_OK; } else { DEBUG(3,("sam_password_ok: NTLMv2 password check failed\n")); return NT_STATUS_WRONG_PASSWORD; @@ -250,7 +260,7 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context, /* This is for 'LMv2' authentication. almost NTLMv2 but limited to 24 bytes. - related to Win9X, legacy NAS pass-though authentication */ - DEBUG(4,("sam_password_ok: Checking LMv2 password\n")); + DEBUG(4,("sam_password_ok: Checking LMv2 password with domain %s\n", user_info->client_domain.str)); if (smb_pwd_check_ntlmv2( user_info->lm_resp, nt_pw, auth_context->challenge, user_info->smb_name.str, @@ -260,6 +270,16 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context, return NT_STATUS_OK; } + DEBUG(4,("sam_password_ok: Checking LMv2 password without a domain\n")); + if (smb_pwd_check_ntlmv2( user_info->lm_resp, + nt_pw, auth_context->challenge, + user_info->smb_name.str, + "", + user_sess_key)) + { + return NT_STATUS_OK; + } + /* Apparently NT accepts NT responses in the LM field - I think this is related to Win9X pass-though authentication */ |