From: Stefan Metzmacher Date: Mon, 28 Oct 2024 15:00:52 +0000 (+0100) Subject: libcli/auth: make use of netlogon_creds_encrypt_SendToSam X-Git-Tag: ldb-2.9.2~20 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f035b802236f9276c6edc3c38d0b122ce1d893a;p=thirdparty%2Fsamba.git 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 (cherry picked from commit 2bd77ff7314932dc4116773731a810fe0f7ce4b7) --- 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,