summaryrefslogtreecommitdiff
path: root/source4/rpc_server/netlogon
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-03-24 06:30:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:16 -0500
commita19d002ceea84b0b7350b1b3ebf181a03ac5b494 (patch)
tree3d300530d2c61c0f13202781530d0f575fed636f /source4/rpc_server/netlogon
parent21d9419b1e4d6ef113a26382315ad96b3509d156 (diff)
downloadsamba-a19d002ceea84b0b7350b1b3ebf181a03ac5b494.tar.gz
samba-a19d002ceea84b0b7350b1b3ebf181a03ac5b494.tar.bz2
samba-a19d002ceea84b0b7350b1b3ebf181a03ac5b494.zip
r6032: Fix up SetServerPassword2 on NETLOGON for [bigendian]. Clearly nobody
has the patience to run test_w2k3.sh to completion :-) It looks to me that the Windows server runs the RC4 over the C struct, not the NDR data. Andrew Bartlett (This used to be commit c324d974134c35b4c50c91d5a932a63c78b67046)
Diffstat (limited to 'source4/rpc_server/netlogon')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 0b6106d485..141aeef1bf 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1018,6 +1018,8 @@ static NTSTATUS netr_ServerPasswordSet2(struct dcesrv_call_state *dce_call, TALL
char new_pass[512];
uint32_t new_pass_len;
+ struct samr_CryptPassword password_buf;
+
const char *attrs[] = {"objectSid", NULL };
const char **domain_attrs = attrs;
@@ -1080,10 +1082,12 @@ static NTSTATUS netr_ServerPasswordSet2(struct dcesrv_call_state *dce_call, TALL
NT_STATUS_HAVE_NO_MEMORY(mod);
mod->dn = talloc_reference(mod, msgs[0]->dn);
- creds_arcfour_crypt(pipe_state->creds, r->in.new_password.data, 516);
+ memcpy(password_buf.data, r->in.new_password.data, 512);
+ SIVAL(password_buf.data,512,r->in.new_password.length);
+ creds_arcfour_crypt(pipe_state->creds, password_buf.data, 516);
- ret = decode_pw_buffer(r->in.new_password.data, new_pass, sizeof(new_pass),
- &new_pass_len, STR_UNICODE);
+ ret = decode_pw_buffer(password_buf.data, new_pass, sizeof(new_pass),
+ &new_pass_len, STR_UNICODE);
if (!ret) {
DEBUG(3,("netr_ServerPasswordSet2: failed to decode password buffer\n"));
return NT_STATUS_ACCESS_DENIED;