]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
librpc/rpc: add dcerpc_binding_handle_auth_session_key()
authorStefan Metzmacher <metze@samba.org>
Sat, 14 Sep 2024 07:55:20 +0000 (09:55 +0200)
committerJule Anger <janger@samba.org>
Thu, 12 Jun 2025 11:27:14 +0000 (11:27 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 5e34173041eb04e30f3f6f81a3269d621220b09c)

librpc/rpc/binding_handle.c
librpc/rpc/rpc_common.h

index f165b47451d6409c073c53716b95a2b7c1e5cffb..f8c7add27eaa5226e52d4b66e98271f257ee5732 100644 (file)
@@ -144,6 +144,18 @@ void dcerpc_binding_handle_auth_info(struct dcerpc_binding_handle *h,
        h->ops->auth_info(h, auth_type, auth_level);
 }
 
+NTSTATUS dcerpc_binding_handle_auth_session_key(
+               struct dcerpc_binding_handle *h,
+               TALLOC_CTX *mem_ctx,
+               DATA_BLOB *session_key)
+{
+       if (h->ops->auth_session_key == NULL) {
+               return NT_STATUS_NO_USER_SESSION_KEY;
+       }
+
+       return h->ops->auth_session_key(h, mem_ctx, session_key);
+}
+
 struct dcerpc_binding_handle_raw_call_state {
        const struct dcerpc_binding_handle_ops *ops;
        uint8_t *out_data;
index 7faeb5f00b3d0978340edd70d52796b0b5f9c089..565c68c2ecfe9021b910fa49a3c7bf4641d86eba 100644 (file)
@@ -184,6 +184,9 @@ struct dcerpc_binding_handle_ops {
        void (*auth_info)(struct dcerpc_binding_handle *h,
                          enum dcerpc_AuthType *auth_type,
                          enum dcerpc_AuthLevel *auth_level);
+       NTSTATUS (*auth_session_key)(struct dcerpc_binding_handle *h,
+                                    TALLOC_CTX *mem_ctx,
+                                    DATA_BLOB *session_key);
 
        struct tevent_req *(*raw_call_send)(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
@@ -266,6 +269,11 @@ void dcerpc_binding_handle_auth_info(struct dcerpc_binding_handle *h,
                                     enum dcerpc_AuthType *auth_type,
                                     enum dcerpc_AuthLevel *auth_level);
 
+NTSTATUS dcerpc_binding_handle_auth_session_key(
+               struct dcerpc_binding_handle *h,
+               TALLOC_CTX *mem_ctx,
+               DATA_BLOB *session_key);
+
 struct tevent_req *dcerpc_binding_handle_raw_call_send(TALLOC_CTX *mem_ctx,
                                                struct tevent_context *ev,
                                                struct dcerpc_binding_handle *h,