diff options
Diffstat (limited to 'source3/auth/auth_wbc.c')
-rw-r--r-- | source3/auth/auth_wbc.c | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/source3/auth/auth_wbc.c b/source3/auth/auth_wbc.c index 05097ee39f..e4fffc7cf8 100644 --- a/source3/auth/auth_wbc.c +++ b/source3/auth/auth_wbc.c @@ -71,13 +71,18 @@ static NTSTATUS check_wbc_security(const struct auth_context *auth_context, params.parameter_control= user_info->logon_parameters; /* Handle plaintext */ - if (!user_info->encrypted) { + switch (user_info->password_state) { + case AUTH_PASSWORD_PLAIN: + { DEBUG(3,("Checking plaintext password for %s.\n", user_info->mapped.account_name)); params.level = WBC_AUTH_USER_LEVEL_PLAIN; - params.password.plaintext = (char *)user_info->plaintext_password.data; - } else { + params.password.plaintext = user_info->password.plaintext; + } + case AUTH_PASSWORD_RESPONSE: + case AUTH_PASSWORD_HASH: + { DEBUG(3,("Checking encrypted password for %s.\n", user_info->mapped.account_name)); params.level = WBC_AUTH_USER_LEVEL_RESPONSE; @@ -86,12 +91,33 @@ static NTSTATUS check_wbc_security(const struct auth_context *auth_context, auth_context->challenge.data, sizeof(params.password.response.challenge)); - params.password.response.nt_length = user_info->nt_resp.length; - params.password.response.nt_data = user_info->nt_resp.data; - params.password.response.lm_length = user_info->lm_resp.length; - params.password.response.lm_data = user_info->lm_resp.data; + params.password.response.nt_length = user_info->password.response.nt.length; + params.password.response.nt_data = user_info->password.response.nt.data; + params.password.response.lm_length = user_info->password.response.lanman.length; + params.password.response.lm_data = user_info->password.response.lanman.data; + } +#if 0 + case AUTH_PASSWORD_HASH: + { + DEBUG(3,("Checking logon (hash) password for %s.\n", + user_info->mapped.account_name)); + params.level = WBC_AUTH_USER_LEVEL_HASH; + + if (user_info->password.hash.nt) { + memcpy(params.password.hash.nt_hash, user_info->password.hash.nt, sizeof(* user_info->password.hash.nt)); + } else { + memset(params.password.hash.nt_hash, '\0', sizeof(params.password.hash.nt_hash)); + } + + if (user_info->password.hash.lanman) { + memcpy(params.password.hash.lm_hash, user_info->password.hash.lanman, sizeof(* user_info->password.hash.lanman)); + } else { + memset(params.password.hash.lm_hash, '\0', sizeof(params.password.hash.lm_hash)); + } } +#endif + } /* we are contacting the privileged pipe */ become_root(); |