summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-09-20 17:01:20 +0200
committerGünther Deschner <gd@samba.org>2008-09-21 22:30:21 +0200
commitca56c02d4bdfa26f5eda16c5621dcac67d7458ef (patch)
tree0ec42022268af8756d45ad0d0b9fd597a7c237e0 /source3/libsmb
parent1f9624175ab35fe5c4012e931a165d422bf26fdb (diff)
downloadsamba-ca56c02d4bdfa26f5eda16c5621dcac67d7458ef.tar.gz
samba-ca56c02d4bdfa26f5eda16c5621dcac67d7458ef.tar.bz2
samba-ca56c02d4bdfa26f5eda16c5621dcac67d7458ef.zip
netlogon: use init_netr_CryptPassword in "just_change_the_password"
Guenther
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/trusts_util.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 08a49930b4..9265c60665 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -57,24 +57,21 @@ static NTSTATUS just_change_the_password(struct rpc_pipe_client *cli, TALLOC_CTX
struct netr_Authenticator clnt_creds, srv_cred;
struct netr_CryptPassword new_password;
- struct samr_CryptPassword password_buf;
netlogon_creds_client_step(cli->dc, &clnt_creds);
- encode_pw_buffer(password_buf.data, new_trust_pwd_cleartext, STR_UNICODE);
-
- SamOEMhash(password_buf.data, cli->dc->sess_key, 516);
- memcpy(new_password.data, password_buf.data, 512);
- new_password.length = IVAL(password_buf.data, 512);
+ init_netr_CryptPassword(new_trust_pwd_cleartext,
+ cli->dc->sess_key,
+ &new_password);
result = rpccli_netr_ServerPasswordSet2(cli, mem_ctx,
- cli->dc->remote_machine,
- cli->dc->mach_acct,
- sec_channel_type,
- global_myname(),
- &clnt_creds,
- &srv_cred,
- &new_password);
+ cli->dc->remote_machine,
+ cli->dc->mach_acct,
+ sec_channel_type,
+ global_myname(),
+ &clnt_creds,
+ &srv_cred,
+ &new_password);
/* Always check returned credentials. */
if (!netlogon_creds_client_check(cli->dc, &srv_cred.cred)) {