From 2bd77ff7314932dc4116773731a810fe0f7ce4b7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 28 Oct 2024 16:00:52 +0100 Subject: [PATCH] libcli/auth: make use of netlogon_creds_encrypt_SendToSam This will help when implementing netr_ServerAuthenticateKerberos()... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425 Signed-off-by: Stefan Metzmacher Reviewed-by: Douglas Bagnall --- libcli/auth/netlogon_creds_cli.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c index 017f3060139..3a42d57f001 100644 --- a/libcli/auth/netlogon_creds_cli.c +++ b/libcli/auth/netlogon_creds_cli.c @@ -4079,22 +4079,14 @@ static void netlogon_creds_cli_SendToSam_locked(struct tevent_req *subreq) } ZERO_STRUCT(state->rep_auth); - if (state->tmp_creds.negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) { - status = netlogon_creds_aes_encrypt(&state->tmp_creds, - state->opaque.data, - state->opaque.length); - if (tevent_req_nterror(req, status)) { - netlogon_creds_cli_SendToSam_cleanup(req, status); - return; - } - } else { - status = netlogon_creds_arcfour_crypt(&state->tmp_creds, - state->opaque.data, - state->opaque.length); - if (tevent_req_nterror(req, status)) { - netlogon_creds_cli_SendToSam_cleanup(req, status); - return; - } + status = netlogon_creds_encrypt_SendToSam(&state->tmp_creds, + state->opaque.data, + state->opaque.length, + state->auth_type, + state->auth_level); + if (tevent_req_nterror(req, status)) { + netlogon_creds_cli_SendToSam_cleanup(req, status); + return; } subreq = dcerpc_netr_NetrLogonSendToSam_send(state, state->ev,