1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

s3-netlogon: let get_md4pw() return a struct samr_Password.

(in preparation of credential merge).

Guenther
This commit is contained in:
Günther Deschner 2009-08-25 18:44:24 +02:00
parent 1a53b61771
commit 5b46e5985e
2 changed files with 7 additions and 8 deletions

View File

@ -104,9 +104,7 @@ static void creds_init_64(struct dcinfo *dc,
unsigned char sum2[8]; unsigned char sum2[8];
/* Just in case this isn't already there */ /* Just in case this isn't already there */
if (dc->mach_pw != mach_pw) { memcpy(dc->mach_pw, mach_pw, 16);
memcpy(dc->mach_pw, mach_pw, 16);
}
sum[0] = IVAL(clnt_chal_in->data, 0) + IVAL(srv_chal_in->data, 0); sum[0] = IVAL(clnt_chal_in->data, 0) + IVAL(srv_chal_in->data, 0);
sum[1] = IVAL(clnt_chal_in->data, 4) + IVAL(srv_chal_in->data, 4); sum[1] = IVAL(clnt_chal_in->data, 4) + IVAL(srv_chal_in->data, 4);

View File

@ -296,7 +296,7 @@ WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
gets a machine password entry. checks access rights of the host. gets a machine password entry. checks access rights of the host.
******************************************************************/ ******************************************************************/
static NTSTATUS get_md4pw(char *md4pw, const char *mach_acct, static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct,
uint16_t sec_chan_type, uint32_t *rid) uint16_t sec_chan_type, uint32_t *rid)
{ {
struct samu *sampass = NULL; struct samu *sampass = NULL;
@ -390,8 +390,8 @@ static NTSTATUS get_md4pw(char *md4pw, const char *mach_acct,
return NT_STATUS_LOGON_FAILURE; return NT_STATUS_LOGON_FAILURE;
} }
memcpy(md4pw, pass, 16); memcpy(md4pw->hash, pass, 16);
dump_data(5, (uint8 *)md4pw, 16); dump_data(5, md4pw->hash, 16);
if (rid) { if (rid) {
*rid = pdb_get_user_rid(sampass); *rid = pdb_get_user_rid(sampass);
@ -481,6 +481,7 @@ NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p,
struct netr_Credential srv_chal_out; struct netr_Credential srv_chal_out;
const char *fn; const char *fn;
uint32_t rid; uint32_t rid;
struct samr_Password mach_pwd;
/* According to Microsoft (see bugid #6099) /* According to Microsoft (see bugid #6099)
* Windows 7 looks at the negotiate_flags * Windows 7 looks at the negotiate_flags
@ -546,7 +547,7 @@ NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p,
goto out; goto out;
} }
status = get_md4pw((char *)p->dc->mach_pw, status = get_md4pw(&mach_pwd,
r->in.account_name, r->in.account_name,
r->in.secure_channel_type, r->in.secure_channel_type,
&rid); &rid);
@ -564,7 +565,7 @@ NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p,
p->dc, p->dc,
&p->dc->clnt_chal, /* Stored client chal. */ &p->dc->clnt_chal, /* Stored client chal. */
&p->dc->srv_chal, /* Stored server chal. */ &p->dc->srv_chal, /* Stored server chal. */
p->dc->mach_pw, mach_pwd.hash,
&srv_chal_out); &srv_chal_out);
/* Check client credentials are valid. */ /* Check client credentials are valid. */