1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3:libnet_dssync: make use of dcerpc_binding_handle_auth_session_key()

Note we only need to call this once per connection, not after
each request...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Stefan Metzmacher 2024-09-14 15:57:03 +02:00 committed by Ralph Boehme
parent 77da0914d5
commit 099c8d904e

View File

@ -467,6 +467,15 @@ static NTSTATUS libnet_dssync_getncchanges(TALLOC_CTX *mem_ctx,
}
}
status = dcerpc_binding_handle_auth_session_key(
b, mem_ctx, &ctx->session_key);
if (!NT_STATUS_IS_OK(status)) {
ctx->error_message = talloc_asprintf(ctx,
"Failed to get Session Key: %s",
nt_errstr(status));
goto out;
}
for (y=0, last_query = false; !last_query; y++) {
struct drsuapi_DsReplicaObjectListItemEx *first_object = NULL;
struct drsuapi_DsReplicaOIDMapping_Ctr *mapping_ctr = NULL;
@ -577,14 +586,6 @@ static NTSTATUS libnet_dssync_getncchanges(TALLOC_CTX *mem_ctx,
}
}
status = cli_get_session_key(mem_ctx, ctx->cli, &ctx->session_key);
if (!NT_STATUS_IS_OK(status)) {
ctx->error_message = talloc_asprintf(ctx,
"Failed to get Session Key: %s",
nt_errstr(status));
goto out;
}
libnet_dssync_decrypt_attributes(mem_ctx,
&ctx->session_key,
first_object);