]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/auth: make use of netlogon_creds_encrypt_SendToSam
authorStefan Metzmacher <metze@samba.org>
Mon, 28 Oct 2024 15:00:52 +0000 (16:00 +0100)
committerJule Anger <janger@samba.org>
Wed, 13 Nov 2024 10:39:12 +0000 (10:39 +0000)
This will help when implementing netr_ServerAuthenticateKerberos()...

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit 2bd77ff7314932dc4116773731a810fe0f7ce4b7)

libcli/auth/netlogon_creds_cli.c

index 017f30601396b8a93eb18b18c22fa188e27b5dfa..3a42d57f00190cd8c43d93afdaf943c8c4e55249 100644 (file)
@@ -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,