summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-05-30 13:44:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:21 -0500
commite86bb4dcc12154ca8ffcec9e3bb1a7f6fd56f57a (patch)
treeea32b8d3ee3ae922fc9df35de198feb4d5eb8b06 /source4/librpc
parent6611f010501d001382a3a73c6d7daafcb6271b18 (diff)
downloadsamba-e86bb4dcc12154ca8ffcec9e3bb1a7f6fd56f57a.tar.gz
samba-e86bb4dcc12154ca8ffcec9e3bb1a7f6fd56f57a.tar.bz2
samba-e86bb4dcc12154ca8ffcec9e3bb1a7f6fd56f57a.zip
r952: fixed schannel from my last commit
(This used to be commit 05b69d9fff0922e2864a336f203bf2afc932d1b9)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc_schannel.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c
index 68b4f6722f..f6d59e4cc3 100644
--- a/source4/librpc/rpc/dcerpc_schannel.c
+++ b/source4/librpc/rpc/dcerpc_schannel.c
@@ -87,6 +87,7 @@ NTSTATUS dcerpc_schannel_key(struct dcerpc_pipe *p,
struct dcerpc_pipe *p2;
struct netr_ServerReqChallenge r;
struct netr_ServerAuthenticate2 a;
+ struct netr_Credential credentials1, credentials2, credentials3;
uint8_t mach_pwd[16];
struct creds_CredentialState creds;
const char *workgroup, *workstation;
@@ -109,7 +110,10 @@ NTSTATUS dcerpc_schannel_key(struct dcerpc_pipe *p,
*/
r.in.server_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dcerpc_server_name(p));
r.in.computer_name = workstation;
- generate_random_buffer(r.in.credentials.data, sizeof(r.in.credentials.data), False);
+ r.in.credentials = &credentials1;
+ r.out.credentials = &credentials2;
+
+ generate_random_buffer(credentials1.data, sizeof(credentials1.data), False);
status = dcerpc_netr_ServerReqChallenge(p2, p->mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -120,8 +124,7 @@ NTSTATUS dcerpc_schannel_key(struct dcerpc_pipe *p,
step 3 - authenticate on the netlogon pipe
*/
E_md4hash(password, mach_pwd);
- creds_client_init(&creds, &r.in.credentials, &r.out.credentials, mach_pwd,
- &a.in.credentials);
+ creds_client_init(&creds, &credentials1, &credentials2, mach_pwd, &credentials3);
a.in.server_name = r.in.server_name;
a.in.username = talloc_asprintf(p->mem_ctx, "%s$", workstation);
@@ -129,12 +132,15 @@ NTSTATUS dcerpc_schannel_key(struct dcerpc_pipe *p,
a.in.computer_name = workstation;
a.in.negotiate_flags = &negotiate_flags;
a.out.negotiate_flags = &negotiate_flags;
+ a.in.credentials = &credentials3;
+ a.out.credentials = &credentials3;
status = dcerpc_netr_ServerAuthenticate2(p2, p->mem_ctx, &a);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
- if (!creds_client_check(&creds, &a.out.credentials)) {
+
+ if (!creds_client_check(&creds, a.out.credentials)) {
return NT_STATUS_UNSUCCESSFUL;
}